Verify physical route clearance and board containment

This commit is contained in:
Jan Petykiewicz 2026-11-27 14:12:40 -08:00
commit c200d0f7c1
4 changed files with 210 additions and 173 deletions

View file

@ -32,7 +32,7 @@ The near-port attempt uses up to 100 nodes per search and two congestion iterati
## Geometry and refinement
Search proxies approximate the shape of a move for collision checks. Verification uses physical polygons for static keepout checks and self-collisions. For conflicts between nets, it compares the checked path's clearance-expanded physical polygons with the other routes' installed, clearance-expanded proxies. Automatic and bundle modes also check that the physical polygons fit within the board.
Search uses proxies to check moves and estimate congestion. Verification checks the physical polygons against keepouts, other nets, and the board rectangle in every routing mode. It uses the distance between physical polygons to check spacing between nets. Boundary contact with the board is allowed.
At a keepout corner, a mitred clearance buffer can reach farther than the specified clearance. Verification checks the actual distance before counting these hits as collisions. For an example with a corner close to the required clearance, see the [mitred-corner test](../inire/tests/test_collision.py#L146).

View file

@ -42,7 +42,7 @@ Enable the `DiagnosticsOptions` flag for the question you want to answer.
1. Enable `capture_conflict_trace` in `DiagnosticsOptions`. In `run.conflict_trace`, choose the entry with `stage="final"` to inspect the returned paths.
2. Find the two net IDs in `conflict_edges`. In the matching `nets` entry, read `component_conflicts` for `self_component_index`, `other_net_id`, and `other_component_index`.
3. Use those zero-based indices to look up components in each net's `path` in `run.results_by_net`. Plot their physical shapes to see where they approach each other. If their physical spacing looks sufficient, compare the installed proxy used by the [dynamic clearance check](architecture.md#geometry-and-refinement).
3. Use those zero-based indices to look up components in each net's `path` in `run.results_by_net`. Plot their physical shapes and compare the distance between them with the [required clearance](architecture.md#geometry-and-refinement).
An earlier entry such as `restored_best` indexes the paths at that stage. Use the paths from the same stage for a geometry comparison. If verification failed with an empty conflict edge list, check the net's report for a keepout conflict, self-collision, or board boundary violation.

View file

@ -24,7 +24,7 @@ The fields below appear in constructor order. Use one layout unit for coordinate
| Field | Default | Meaning |
| --- | --- | --- |
| `bounds` | Required | Board rectangle as `(xmin, ymin, xmax, ymax)`. |
| `nets` | `()` | Sequence of `NetSpec` objects with unique IDs. |
| `nets` | `()` | Sequence of `NetSpec` objects with unique IDs. Duplicate IDs raise `ValueError`. |
| `static_obstacles` | `()` | Shapely polygons that define keepouts. |
| `initial_paths` | Empty mapping | Net IDs mapped to `PathSeed` objects. |
| `clearance` | `2.0` | Required spacing between physical shapes. |
@ -42,7 +42,7 @@ The fields below appear in constructor order. Use one layout unit for coordinate
| `RoutingResult.is_valid` and `outcome` | `is_valid` is true when the outcome is `completed`. Read `outcome` to distinguish success, a failed geometry check (`colliding`), a path that stopped short (`partial`), or an empty path (`unroutable`). |
| `RoutingResult.path` | Ordered path components from the source to the last reached state. An unroutable result has an empty path. |
| `RoutingResult.reached_target` | Whether the path reached the target position and heading. With heading inference, the check uses the chosen heading. Read `is_valid` for the result of geometry verification. |
| `RoutingResult.report` | `total_length` in layout units plus static, dynamic, and self-collision counts. `out_of_bounds` records a board containment failure when checked. |
| `RoutingResult.report` | `total_length` in layout units plus static, dynamic, and self-collision counts. `out_of_bounds` indicates that physical geometry extends outside the board rectangle. |
| `RoutingResult.locked_geometry` and `as_seed()` | Physical polygons and the sequence of moves, respectively. Check validity before exporting polygons or using them as keepouts. |
| `RoutingRunResult.automatic` | In automatic mode, the selected planner, verified IDs, stage history, and any capacity or port-conflict bound. `None` for explicit modes. |
| `RoutingRunResult.topology` and `metrics` | Corridor counts and seed work when reported by the selected worker, plus work counters across the run. |

View file

@ -7,11 +7,11 @@ Start with `run.results_by_net[net_id].outcome`. It distinguishes a path that st
| `result.outcome` | What to inspect |
| --- | --- |
| `completed` | The path reached its target and passed verification. Read its length in `report.total_length` and follow the [geometry export steps](route-a-layout.md#export-verified-geometry). |
| `colliding` | The path reached its target and failed verification. Check `result.report` for keepout clearance, conflicts with another route, or self-overlap. In automatic mode, also check `report.out_of_bounds`. |
| `colliding` | The path reached its target and failed verification. Check `result.report` for keepout clearance, conflicts with another route, self-overlap, or geometry outside the board. |
| `partial` | Read the position and heading of `result.path[-1].end_port`. Check room for the path to continue from that heading. If the next turn fits, compare search limits. |
| `unroutable` | The path is empty. Check the launch heading and room for the first straight or bend. |
Check `is_valid` before exporting. With explicit `off`, `guide`, or `seed` mode, also check that the physical polygons fit the board if your export requires containment. Automatic mode includes that check in candidate verification.
Check `is_valid` before exporting. Every routing mode checks that the physical polygons fit within the board.
## Why a net stopped short