Tie documentation links to reader workflows
This commit is contained in:
parent
ec2768853e
commit
a029791f33
1 changed files with 161 additions and 119 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Router architecture
|
||||
|
||||
Start with the stage that chooses the route, then inspect the worker that produced it. The public `route()` entry point runs one worker for an explicit mode. Automatic mode can run several. Each worker sees the obstacles, locks, and seed hints passed to it. [Public API](user/api-reference.md) · [Worker setup](../inire/router/_stack.py)
|
||||
An explicit routing mode runs one worker. Automatic routing can run several and compare their results. Each worker receives its own obstacles, locks, and seed hints. To trace how a worker gets its inputs and options, start at [`route_once()`](../inire/router/_stack.py).
|
||||
|
||||
## Automatic routing
|
||||
|
||||
|
|
@ -8,41 +8,45 @@ Start with the stage that chooses the route, then inspect the worker that produc
|
|||
|
||||
The diagram shows the usual sequence for arc bends. A verified layout can reach the routing target early. When attempts run out, selection keeps the best verified coverage found. Custom physical bends, polygonal proxies, or missing constrained triangulation take a lattice-only path.
|
||||
|
||||
1. **Establish a stopping target.** Each disjoint pair of incompatible fixed ports rules out one route. For supported rectangular cuts, the capacity check uses the narrowest guide to bound how many paths fit through each opening. Reaching one of these bounds can justify stopping with partial coverage. Keep those bounds separate from estimates such as corridor occupancy or a failed attempt. [Capacity checks](../inire/router/_capacity.py)
|
||||
2. **Exploit layout structure before search.** Bundles place ordered tracks through barriers. Column schedules assign tracks to openings and stagger turns between them. Compact planners fit local connections between constrained ports. A schedule supplies seeds to the ordinary verifier. This lets the planner make cheap geometric proposals while the verifier checks the resulting physical paths. [Bundles](../inire/router/_bundle.py) · [Columns](../inire/router/_columns.py) · [Compact planners](../inire/router/_compact.py)
|
||||
3. **Probe cheaply before spending the wider budget.** Direct trials can lock verified straight links and search for the remaining nets. A change in lock order or a small unlocked probe can free a nearby turn. The near-port stage uses up to 100 nodes per search and two congestion iterations for the arc proxy. Alternate proxies use the configured iteration limit because another shallow iteration can find a path the wider retry misses or finds at higher cost. The wider lookahead uses up to 500 nodes and the configured iteration limit. Both respect smaller caller limits. Guide and column attempts can precede the probe when the geometry makes them promising. [Stage order](../inire/router/_automatic.py) · [Direct trials](../inire/router/_routing_policy.py)
|
||||
4. **Choose what to keep fixed.** If the remaining ports are still connected with verified paths locked, route the unresolved nets around those paths. If locks disconnect the residual, use movable seed hints so the next search can move an incumbent. A residual with several nets sharing a portal can benefit from a different lane assignment. When those attempts stall, seed and lattice workers can search the whole layout. A final lattice retry can use the caller's ceiling. [Residual routing](../inire/router/_automatic.py) · [Corridors and lanes](topological-routing.md#corridor-planning-and-realization)
|
||||
5. **Accept a checked layout.** Compare verified coverage first. Cost breaks ties between candidates with identical verified IDs. A complete locked layout or an improving joint retry must pass its required whole-layout check before selection. Refinement is also a candidate replacement and must preserve the verified ID set. [Trial selection](../inire/router/_routing_policy.py)
|
||||
1. **Set the coverage target.** Each disjoint pair of incompatible fixed ports rules out one route. At supported rectangular cuts, compute how many paths of the narrowest width can fit through the openings. The resulting upper bound can justify stopping with fewer routes than requested.
|
||||
2. **Try constructive planners.** Bundles assign ordered tracks through barriers. Column schedules place turns between openings. Compact planners fit short connections between constrained ports. Each produces seeds whose physical geometry the worker checks.
|
||||
3. **Start with a small search budget.** Lock verified straight links and search for the remaining nets. A different lock order or a small unlocked probe can free room for a turn. Promising guide and column attempts can run first.
|
||||
4. **Decide what to keep fixed.** If the remaining ports are connected, route around the locked geometry. If the locks disconnect them, pass the incumbents as movable seeds. A joint retry can assign different lanes through a shared portal. If recovery stalls, seed and lattice attempts can search the whole layout, with a final lattice retry up to the caller's ceiling.
|
||||
5. **Select a verified layout.** Prefer greater coverage and compare cost on identical verified net sets. A complete locked layout or an improving joint retry must pass its whole-layout check before selection. A refined candidate must preserve the verified net set.
|
||||
|
||||
The near-port attempt uses up to 100 nodes per search and two congestion iterations with the arc proxy. Alternate proxies use the configured iteration limit because a later shallow iteration can find a cheaper path. Wider lookahead uses up to 500 nodes per search and the configured iteration limit. Both attempts respect smaller caller limits. Follow those budget decisions in the [automatic routing sequence](../inire/router/_automatic.py).
|
||||
|
||||
### Example of a poor lock
|
||||
|
||||
1. A straight trunk in `stress-retry-straight-decoy` fits on its own. Once locked, it divides the board and blocks two perpendicular nets.
|
||||
2. The probe can keep the branches and lower rail. A four-turn dogleg completes the trunk around them before wider search.
|
||||
3. If you change lock ordering or acceptance, check that all four nets still verify together. [Fixture](../inire/tests/stress_routing_benchmarks.py) · [Choose a benchmark](benchmarks.md#choose-a-case)
|
||||
3. If you change lock ordering or acceptance, rerun the case and check that all four nets still verify together. For the command and profile choices, see [Run a benchmark](benchmarks.md#run-a-benchmark).
|
||||
|
||||
## Detailed search and congestion
|
||||
|
||||
- **Build and admit moves.** Weighted A* searches snapped positions and headings. Rays, visible corners, and corridor waypoints propose straight endpoints. Admission checks clearance, cost, and state dominance. A move-generation change can help a net reach its target at the same node budget. [Moves](../inire/router/_astar_moves.py) · [Admission](../inire/router/_astar_admission.py) · [Search](../inire/router/_search.py)
|
||||
- **Build and admit moves.** Weighted A* searches snapped positions and headings. Rays, visible corners, and corridor waypoints propose straight endpoints. Admission checks clearance, cost, and state dominance. To understand which endpoints a net can reach within the same node budget, start with [move generation](../inire/router/_astar_moves.py).
|
||||
|
||||
- **Recheck the installed set.** The congestion driver replaces paths in routing order and raises the overlap penalty between unresolved iterations. A later route can collide with one completed earlier, so the driver verifies the installed set. It ranks snapshots by completed nets, then by conflicts and dynamic collisions. [Routing loop](../inire/router/_router.py) · [Congestion policy](../inire/router/_congestion_policy.py)
|
||||
- **Recheck the installed set.** The driver raises the overlap penalty when successive routes collide. After an iteration it verifies the installed paths, since a later route can collide with one completed earlier. It ranks snapshots by completed nets, then by conflicts and dynamic collisions. To investigate which nets reroute next, read the [congestion policy](../inire/router/_congestion_policy.py).
|
||||
|
||||
- **Repair a small conflict set.** Late iterations can focus on conflicting nets. The driver restores its best iteration before attempting pair-local repair. It keeps the geometry outside an eligible pair fixed, can try either routing order, and checks the proposed replacement in the live world. [Pair-local search](../inire/router/_pair_local.py) · [Read an iteration trace](routing-diagnostics.md#traces)
|
||||
- **Repair a small conflict set.** The driver restores its best iteration and verifies it once for diagnostics and target selection. Pair-local search keeps the geometry outside an eligible pair fixed and can try either routing order. The driver checks replacements in the live world. To compare the restored set with the repaired paths, [follow a late conflict](routing-diagnostics.md#follow-a-late-conflict-into-pair-local-repair).
|
||||
|
||||
## Geometry and refinement
|
||||
|
||||
Search proxies help reject candidates cheaply. Final verification checks physical clearance, self-collisions, and automatic board containment. A mitred obstacle buffer can flag a candidate near a corner even when the physical distance meets clearance. The exact distance check resolves those cases. When changing a broad phase, keep boundary-touching and custom-shape fixtures alongside ordinary rectangle cases. [Collision world](../inire/geometry/collision.py) · [Collision tests](../inire/tests/test_collision.py)
|
||||
Search proxies help reject candidates cheaply. Final verification checks physical clearance, self-collisions, and automatic board containment. A mitred buffer can flag a candidate near a corner even when physical distance meets clearance. The exact distance check resolves those cases. To test changes to the broad phase, use the boundary-touching and custom-shape cases in the [collision tests](../inire/tests/test_collision.py).
|
||||
|
||||
Use timings to decide which geometry work to inspect. Ray counts can point to repeated visibility queries. Congestion candidate counts and exact pair checks can reveal an overly broad dynamic lookup. Compare checks at similar expansion counts before changing the index. [Geometry workload diagnostics](routing-diagnostics.md#route-metrics)
|
||||
When expansion counts are similar but routing time rises, inspect ray casts for repeated visibility queries and exact pair checks for an overly broad dynamic lookup. The [metrics guide](routing-diagnostics.md#route-metrics) maps those questions to counters.
|
||||
|
||||
Refinement looks for cheaper replacements in windows of a completed path. With a finite budget above one window, it prioritizes bend-ended windows so it can try removing expensive turns early. One-window and unlimited runs use longest-first ordering. Candidate scoring precedes polygon construction. A local replacement check relies on the unchanged route and other paths still being valid in the current world. The final check covers the installed result. [Refiner](../inire/router/refiner.py)
|
||||
Refinement scores replacement windows before constructing their polygons. Finite budgets above one window prioritize bend-ended windows to give expensive turns an early chance to be replaced. One-window and unlimited runs try the longest windows first. Local checks rely on the rest of the route and the other installed paths being valid. Final verification checks the installed result.
|
||||
|
||||
## Validate a change
|
||||
|
||||
| Change | What to demonstrate |
|
||||
| --- | --- |
|
||||
| Stage order, locks, or budgets | Which attempt wins, which net IDs and paths it keeps, and whether skipped work reappears in a later attempt. Include tight passages and preplaced crossings. |
|
||||
| Collision or cache behavior | Identical clearance and boundary decisions for physical and proxy shapes. Compare candidate counts and exact checks along with time. |
|
||||
| Congestion, seeds, or pair-local repair | Coverage and conflict evolution at iteration boundaries, plus the final installed geometry after repair. |
|
||||
| Cost or refinement | Equal verified ID sets before comparing per-net lengths or costs. Check that the improvement survives whole-layout verification. |
|
||||
| If you change | What to check | Where to start |
|
||||
| --- | --- | --- |
|
||||
| Stage order or budgets | Which stage wins and whether work reappears in a later attempt. Include tight passages and preplaced crossings. | [Automatic routing](../inire/router/_automatic.py) |
|
||||
| Locks or candidate acceptance | The verified IDs and their paths after the complete layout is checked. | [Direct trials and selection](../inire/router/_routing_policy.py) |
|
||||
| Corridor or seed allocation | Coverage through shared openings and search work when a corridor reaches the wrong lane or leaves too little turn room. | [Corridor planning and realization](topological-routing.md#corridor-planning-and-realization) |
|
||||
| Collision or caching | Clearance and boundary decisions for both physical and proxy shapes. Compare candidate counts and exact checks along with time. | [Collision world](../inire/geometry/collision.py) |
|
||||
| Pair-local repair | Coverage and conflict edges before repair, plus the final installed geometry. | [Pair-local search](../inire/router/_pair_local.py) |
|
||||
| Cost or refinement | Per-net costs on equal verified ID sets and validity after the final check. | [Path refinement](../inire/router/refiner.py) |
|
||||
|
||||
Use [benchmark profiles](benchmarks.md#choose-a-profile) for policy comparisons and [exact parity](routing-diagnostics.md#reproduce-and-compare) for behavior-preserving changes.
|
||||
|
|
|
|||
Loading…
Reference in a new issue