Tie documentation links to reader workflows
This commit is contained in:
parent
ec2768853e
commit
a029791f33
14 changed files with 161 additions and 119 deletions
43
DOCS.md
43
DOCS.md
|
|
@ -2,7 +2,10 @@
|
||||||
|
|
||||||
# User guide
|
# User guide
|
||||||
|
|
||||||
Get a [first route running](README.md#route-a-net), then use these guides for your own layout.
|
If you're new to Inire, start with the [single-net quick start](README.md#route-a-net).
|
||||||
|
|
||||||
|
<a id="incremental-routing-with-locked-geometry"></a>
|
||||||
|
<a id="initial-paths-with-pathseed"></a>
|
||||||
|
|
||||||
## Describe a layout
|
## Describe a layout
|
||||||
|
|
||||||
|
|
@ -10,33 +13,31 @@ Get a [first route running](README.md#route-a-net), then use these guides for yo
|
||||||
- [Route between placed crossings](docs/user/route-a-layout.md#route-between-placed-crossings) uses the cell footprints, port access, and external connections from your layout.
|
- [Route between placed crossings](docs/user/route-a-layout.md#route-between-placed-crossings) uses the cell footprints, port access, and external connections from your layout.
|
||||||
- [Reuse an existing route](docs/user/route-a-layout.md#reuse-an-existing-route) explains fixed routes and movable seeds.
|
- [Reuse an existing route](docs/user/route-a-layout.md#reuse-an-existing-route) explains fixed routes and movable seeds.
|
||||||
|
|
||||||
## Read the result
|
<a id="read-the-result"></a>
|
||||||
|
|
||||||
- [Interpret the result](docs/user/tune-and-troubleshoot.md#read-the-result) before exporting physical paths.
|
|
||||||
- [Diagnose an unfinished net](docs/user/tune-and-troubleshoot.md#why-a-net-stopped-short) and decide whether to change the layout or try another search.
|
|
||||||
|
|
||||||
<a id="topological-routing"></a>
|
<a id="topological-routing"></a>
|
||||||
|
<a id="choose-a-routing-mode"></a>
|
||||||
|
<a id="automatic-routing"></a>
|
||||||
|
<a id="tune-a-run"></a>
|
||||||
|
|
||||||
## Choose a routing mode
|
## Check and improve a route
|
||||||
|
|
||||||
[Compare routing modes](docs/user/tune-and-troubleshoot.md#choose-a-routing-mode) for automatic selection, lattice search, guide, seed, or ordered bundles.
|
- [Check the result](docs/user/tune-and-troubleshoot.md#read-the-result) before exporting physical paths.
|
||||||
|
- [Diagnose an unfinished net](docs/user/tune-and-troubleshoot.md#why-a-net-stopped-short) to decide whether to change the layout or spend more search time.
|
||||||
|
- [Choose a routing mode](docs/user/tune-and-troubleshoot.md#choose-a-routing-mode) when your layout calls for a specific planner.
|
||||||
|
- [Adjust a setting](docs/user/tune-and-troubleshoot.md#choose-the-next-setting) if routes collide, take too long, or use too many bends.
|
||||||
|
|
||||||
## Tune a run
|
<a id="moved-reference-sections"></a>
|
||||||
|
<a id="searchoptions"></a>
|
||||||
[Choose a setting to try](docs/user/tune-and-troubleshoot.md#choose-the-next-setting) when a route is unfinished, too expensive, or slow.
|
<a id="objectiveweights"></a>
|
||||||
|
<a id="congestionoptions"></a>
|
||||||
|
<a id="refinementoptions"></a>
|
||||||
|
<a id="topologyoptions"></a>
|
||||||
|
<a id="diagnosticsoptions"></a>
|
||||||
|
|
||||||
## API reference
|
## API reference
|
||||||
|
|
||||||
[Look up public signatures, result fields, and option defaults](docs/user/api-reference.md).
|
For call signatures, result fields, and option defaults, see the [public API reference](docs/user/api-reference.md).
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
[Browse the visual examples](examples/README.md) for locked paths, bend geometry, congestion, and partial results.
|
See how bends, locks, and congestion affect the routes in the [runnable examples](examples/README.md).
|
||||||
|
|
||||||
## Moved reference sections
|
|
||||||
|
|
||||||
- <a id="incremental-routing-with-locked-geometry"></a><a id="initial-paths-with-pathseed"></a>[Fixed routes and path seeds](docs/user/route-a-layout.md#reuse-an-existing-route)
|
|
||||||
- <a id="automatic-routing"></a>[Automatic routing and other modes](docs/user/tune-and-troubleshoot.md#choose-a-routing-mode)
|
|
||||||
- <a id="searchoptions"></a>[SearchOptions](docs/user/api-reference.md#searchoptions) and <a id="objectiveweights"></a>[ObjectiveWeights](docs/user/api-reference.md#objectiveweights)
|
|
||||||
- <a id="congestionoptions"></a>[CongestionOptions](docs/user/api-reference.md#congestionoptions) and <a id="refinementoptions"></a>[RefinementOptions](docs/user/api-reference.md#refinementoptions)
|
|
||||||
- <a id="topologyoptions"></a>[TopologyOptions](docs/user/api-reference.md#topologyoptions) and <a id="diagnosticsoptions"></a>[DiagnosticsOptions](docs/user/api-reference.md#diagnosticsoptions)
|
|
||||||
|
|
|
||||||
17
README.md
17
README.md
|
|
@ -2,13 +2,9 @@
|
||||||
|
|
||||||
Use Inire to connect fixed ports on a photonic or RF layout with straight segments, 90-degree bends, and S-bends. Supply the device placement, keepouts, and allowed bend radii. The router checks the finished geometry for clearance and returns partial paths to help you diagnose unfinished nets.
|
Use Inire to connect fixed ports on a photonic or RF layout with straight segments, 90-degree bends, and S-bends. Supply the device placement, keepouts, and allowed bend radii. The router checks the finished geometry for clearance and returns partial paths to help you diagnose unfinished nets.
|
||||||
|
|
||||||
<a id="develop-inire"></a>
|
|
||||||
|
|
||||||
[User guide](DOCS.md) · [Developer guide](docs/development.md) · [Benchmarks](docs/benchmarks.md)
|
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
From a checkout with Python 3.11 or newer, run `pip install .`. For development, `uv sync` also installs the test and lint tools.
|
From a checkout with Python 3.11 or newer, run `pip install .`.
|
||||||
|
|
||||||
## Route a net
|
## Route a net
|
||||||
|
|
||||||
|
|
@ -37,7 +33,7 @@ else:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
The example prints `200.0` in the layout's coordinate unit. Both ports have heading 0 because the path travels east at departure and arrival. The plot shows the area around the first route. [Read the result](docs/user/tune-and-troubleshoot.md#read-the-result)
|
The example prints `200.0` in the layout's coordinate unit. Both ports have heading 0 because the path travels east as it leaves the source and enters the target.
|
||||||
|
|
||||||
## Route your own layout
|
## Route your own layout
|
||||||
|
|
||||||
|
|
@ -45,6 +41,13 @@ The example prints `200.0` in the layout's coordinate unit. Both ports have head
|
||||||
- [Choose what to try after a partial route](docs/user/tune-and-troubleshoot.md#why-a-net-stopped-short).
|
- [Choose what to try after a partial route](docs/user/tune-and-troubleshoot.md#why-a-net-stopped-short).
|
||||||
- [Browse visual examples](examples/README.md) of multi-net routing, locked paths, and bend geometry.
|
- [Browse visual examples](examples/README.md) of multi-net routing, locked paths, and bend geometry.
|
||||||
|
|
||||||
|
For the full workflow and API reference, start with the [user guide](DOCS.md).
|
||||||
|
|
||||||
|
## Develop Inire
|
||||||
|
|
||||||
|
- To set up the development environment and find the relevant routing code, use the [developer guide](docs/development.md).
|
||||||
|
- To measure routing coverage, cost, or runtime, run the [routing benchmarks](docs/benchmarks.md).
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
GNU Affero General Public License v3. [License text](LICENSE.md)
|
Inire is distributed under the [GNU Affero General Public License v3](LICENSE.md).
|
||||||
|
|
|
||||||
|
|
@ -6,4 +6,4 @@ Historical plans, run captures, and raw measurements live here. For current work
|
||||||
- **Performance records.** [Example baseline](performance.md) and its [JSON](performance_baseline.json), [optimization log](optimization_pass_01_log.md), and [pair-local characterization](pair_local_characterization.md).
|
- **Performance records.** [Example baseline](performance.md) and its [JSON](performance_baseline.json), [optimization log](optimization_pass_01_log.md), and [pair-local characterization](pair_local_characterization.md).
|
||||||
- **Recorded diagnostics.** [Iteration](iteration_trace.md), [conflict](conflict_trace.md), [frontier](frontier_trace.md), and [pre-pair](pre_pair_frontier_trace.md) traces. Each report has a companion JSON file with the raw data.
|
- **Recorded diagnostics.** [Iteration](iteration_trace.md), [conflict](conflict_trace.md), [frontier](frontier_trace.md), and [pre-pair](pre_pair_frontier_trace.md) traces. Each report has a companion JSON file with the raw data.
|
||||||
|
|
||||||
The baseline comparison tool reads `archive/routing/performance_baseline.json` by default. Capture tools write here by default and replace files with the same name. Pass `--output-dir` for a scratch capture. [Capture and comparison commands](../../docs/routing-diagnostics.md#reproduce-and-compare)
|
The baseline comparison tool reads `archive/routing/performance_baseline.json` by default. Capture tools write here by default and replace files with the same name. To save a scratch capture, pass `--output-dir` as shown in the [diagnostics guide](../../docs/routing-diagnostics.md#reproduce-and-compare).
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Router architecture
|
# 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
|
## 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.
|
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)
|
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. **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)
|
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. **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)
|
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. **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)
|
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. **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)
|
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
|
### 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.
|
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.
|
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
|
## 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
|
## 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
|
## Validate a change
|
||||||
|
|
||||||
| Change | What to demonstrate |
|
| If you change | What to check | Where to start |
|
||||||
| --- | --- |
|
| --- | --- | --- |
|
||||||
| 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. |
|
| 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) |
|
||||||
| Collision or cache behavior | Identical clearance and boundary decisions for physical and proxy shapes. Compare candidate counts and exact checks along with time. |
|
| 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) |
|
||||||
| Congestion, seeds, or pair-local repair | Coverage and conflict evolution at iteration boundaries, plus the final installed geometry after repair. |
|
| 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) |
|
||||||
| Cost or refinement | Equal verified ID sets before comparing per-net lengths or costs. Check that the improvement survives whole-layout verification. |
|
| 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.
|
Use [benchmark profiles](benchmarks.md#choose-a-profile) for policy comparisons and [exact parity](routing-diagnostics.md#reproduce-and-compare) for behavior-preserving changes.
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,18 @@
|
||||||
# Benchmark fixtures
|
# Benchmark fixtures
|
||||||
|
|
||||||
Use the checked-in inputs to repeat a routing comparison offline. The fixture catalogue gives the geometry, options, and expected bound for each case. [Choose a case and profile](benchmarks.md#choose-a-case) · [Fixture catalogue](../inire/tests/routing_corpus.py)
|
The checked-in fixtures let you repeat comparisons offline. To find a board for the behavior you want to measure, use the [benchmark case guide](benchmarks.md#choose-a-case). To inspect the case groups and the options used for each profile, open the [corpus registry](../inire/tests/routing_corpus.py).
|
||||||
|
|
||||||
## Automatic nine-net Terminal-Bench routing
|
## Automatic nine-net Terminal-Bench routing
|
||||||
|
|
||||||
Use this as a check on ordered placement and heading inference. The upstream task supplies point terminals, so `bundle` mode can infer headings and reserve room for the outer return and bend tangencies. The export command starts from the unseeded input. Its nine routes passed the pinned checker below the upstream cost limit. Use the fixed-heading `terminal-bench` fixture to check automatic routing when the headings are part of the input. [Bundle planner](../inire/router/_bundle.py) · [Pinned upstream task](https://github.com/harbor-framework/terminal-bench/tree/249d125b59c0a5352d9e132195cfead6d81446be/tasks/photonic-waveguide-routing)
|
Use `terminal-bench-point-terminals` to test heading inference and ordered tracks through shared openings. The bundle planner reserves room for the outer return and bend tangencies. Use `terminal-bench` to test automatic routing with fixed headings.
|
||||||
|
|
||||||
|
Export the nine routes from the unseeded point-terminal input.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python -m scripts.route_terminal_bench --output /tmp/inire-terminal-bench.json
|
python -m scripts.route_terminal_bench --output /tmp/inire-terminal-bench.json
|
||||||
```
|
```
|
||||||
|
|
||||||
The export CLI's `--reference-lane-plan` and `--single-bottom-track` flags replay authored layouts for comparison. Use the unseeded export to measure the planner and the reference flags to check feasibility or compare lane assignments. [Reference plan](../inire/tests/terminal_bench_lane_plan.py)
|
The unseeded export passed the checker's cost and geometry requirements in the [pinned Terminal-Bench task](https://github.com/harbor-framework/terminal-bench/tree/249d125b59c0a5352d9e132195cfead6d81446be/tasks/photonic-waveguide-routing). To check feasibility or compare lane assignments, use the CLI flags `--reference-lane-plan` and `--single-bottom-track` to replay the [authored lane plans](../inire/tests/terminal_bench_lane_plan.py).
|
||||||
|
|
||||||
## Preplaced crossings
|
## Preplaced crossings
|
||||||
|
|
||||||
|
|
@ -18,11 +20,16 @@ The export CLI's `--reference-lane-plan` and `--single-bottom-track` flags repla
|
||||||
- `crossing-obstructed-approaches` adds blocked approaches and a turning exit.
|
- `crossing-obstructed-approaches` adds blocked approaches and a turning exit.
|
||||||
- `crossing-aligned-grid` and `crossing-staggered-grid` test multiple cells and short links between device banks.
|
- `crossing-aligned-grid` and `crossing-staggered-grid` test multiple cells and short links between device banks.
|
||||||
|
|
||||||
Use unseeded runs to evaluate routing policy. The fixture witnesses are checked independently for geometry and clearance. [Crossing definitions](../inire/tests/routing_crossing_benchmarks.py)
|
Use unseeded runs to evaluate routing policy. For a separate check of geometry and clearance, use the reference paths in the [crossing fixtures](../inire/tests/routing_crossing_benchmarks.py).
|
||||||
|
|
||||||
## Imported fixtures
|
## Imported fixtures
|
||||||
|
|
||||||
The six fixed-placement cases run offline from [converted inputs](../inire/tests/data/external_routing_benchmarks.json). Optical ports snap to a 0.1 µm grid. Device outlines become keepouts with access cutouts. PIC Routing Benchmark contributes splitter-tree, ring-modulator, and MZM cases. LiDAR contributes a toy layout and subsets of the Clements and MRR weight-bank layouts. These fixtures exercise waveguide routing between fixed devices. [PIC data and CC BY 4.0 attribution](https://huggingface.co/datasets/FLYR/pic-benchmark/blob/0c1f445792926d97fae01893c89e96b8a9393800/pic-benchmark/README.md) · [LiDAR source](https://github.com/ScopeX-ASU/LiDAR/tree/4e7004d32b0b80d959553797fb30f0737513de0c/src/picroute/benchmarks) · [LiDAR license](../inire/tests/data/LiDAR-LICENSE.txt)
|
The importer converts placed device outlines to keepouts with port openings and snaps optical ports to a 0.1 µm grid. The six converted layouts exercise routing between fixed devices. To inspect their ports and keepouts, open the [checked-in fixture data](../inire/tests/data/external_routing_benchmarks.json).
|
||||||
|
|
||||||
|
| Cases | Source | License |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Splitter tree, ring modulator, and MZM | [PIC Routing Benchmark](https://huggingface.co/datasets/FLYR/pic-benchmark/blob/0c1f445792926d97fae01893c89e96b8a9393800/pic-benchmark/README.md) | CC BY 4.0 |
|
||||||
|
| Toy layout and subsets of the Clements and MRR weight-bank layouts | [LiDAR benchmarks](https://github.com/ScopeX-ASU/LiDAR/tree/4e7004d32b0b80d959553797fb30f0737513de0c/src/picroute/benchmarks) | [LiDAR license](../inire/tests/data/LiDAR-LICENSE.txt) |
|
||||||
|
|
||||||
The importer checks both pinned archive hashes. It requires PyYAML when regenerating the fixtures.
|
The importer checks both pinned archive hashes. It requires PyYAML when regenerating the fixtures.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
# Benchmark results
|
# Benchmark results
|
||||||
|
|
||||||
Use these measurements to understand the current probe policy and choose follow-up retry experiments. [Run a fresh benchmark](benchmarks.md)
|
Use these measurements when changing the automatic probe budget or retry order. The [benchmark guide](benchmarks.md) explains how to select workloads and compare your results.
|
||||||
|
|
||||||
## Near-port probe and retry experiments
|
## Near-port probe and retry experiments
|
||||||
|
|
||||||
Results recorded on November 26, 2026. The probe decision compared the two-iteration cap with the full configured probe budget. The retry experiments used the pre-cap policy.
|
Results recorded on November 26, 2026. The probe decision compared the two-iteration cap with the full configured probe budget. The retry experiments used the pre-cap policy.
|
||||||
|
|
||||||
The two-iteration probe cuts repeated shallow searches on layouts such as the splitter tree. It reduced public-default expansion counts by 23% on the regression corpus with identical paths there and on the holdouts. The mixed port-bank case did more work because the shorter probe passed the last net to the wider retry. Test both stages when changing the cap. A one-iteration cap increased the cost of a crossing approach, and the clipped-proxy regression required the original probe budget to keep its cheaper route. These are reasons to check path quality and proxy geometry as well as total expansions. [Probe budget in the policy](architecture.md#automatic-routing)
|
The two-iteration probe reduced public-default expansions by 23% on the regression corpus. Paths matched on both the corpus and holdouts. Check individual boards before changing the cap again.
|
||||||
|
|
||||||
|
- The splitter tree benefited from fewer repeated shallow searches.
|
||||||
|
- The mixed port bank did more work because the shorter probe passed its last net to the wider retry.
|
||||||
|
- A one-iteration cap increased the cost of a crossing approach. The clipped-proxy case needed the original probe budget to find its cheaper route, so the current cap applies to the arc proxy. See the [automatic stage sequence](architecture.md#automatic-routing).
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python -m scripts.benchmark_retry_order --case corpus --case retry-holdout \
|
python -m scripts.benchmark_retry_order --case corpus --case retry-holdout \
|
||||||
|
|
@ -15,9 +19,9 @@ python -m scripts.benchmark_retry_order --case corpus --case retry-holdout \
|
||||||
|
|
||||||
### Early and late retries
|
### Early and late retries
|
||||||
|
|
||||||
Early retries can save time when they replace a more expensive stage. Their failures add work before the ordinary fallback. The holdout runs found both effects and a case where early incumbent recovery selected a higher-cost path at the same coverage. Review failed-retry time and common-net cost when deciding whether an early exit is worth using. The archived experiments include the trigger counts and the original commands. [Experiment archive](#experiment-archive)
|
Early retries can save time when they avoid a more expensive stage. Failed retries add work before the ordinary fallback. In one holdout, early incumbent recovery selected a higher-cost path at the same coverage. Use the trigger counts and commands in the [experiment archive](#experiment-archive) to compare failed-retry time and cost on common nets.
|
||||||
|
|
||||||
The experimental `late-residual-3000` policy tests a different question. Can a wider search recover the last net while keeping the rest fixed? It requires room in the caller's budget and skips attempts whose locks disconnect the remaining ports. In the pre-cap holdout sweep it completed the last net on two crossing boards and a return shelf, with all previously verified paths intact. Use the experiment to measure the cost of completing one more net after the normal policy stalls.
|
Use `late-residual-3000` to measure the cost of recovering one more net after the ordinary policy stalls. The policy needs room in the caller's budget and checks that the remaining ports are connected with the incumbents locked. It recovered the last net on two crossing boards and a return shelf in the pre-cap holdout sweep.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python -m scripts.benchmark_retry_order --case retry-holdout --profile public-defaults \
|
python -m scripts.benchmark_retry_order --case retry-holdout --profile public-defaults \
|
||||||
|
|
@ -27,4 +31,6 @@ python -m scripts.benchmark_retry_order --case retry-holdout --profile public-de
|
||||||
|
|
||||||
## Experiment archive
|
## Experiment archive
|
||||||
|
|
||||||
Use `git show ea5cfe7:docs/topological-routing.md` for the original retry experiments, budget sweeps, and manual Terminal-Bench lane comparisons. Use `git show 2b02c6e:docs/topological-routing.md` for the measured probe and holdout tables. For retired policies, check out `ea5cfe7` in a separate worktree to run the matching driver. [Routing development archive](../archive/routing/README.md)
|
- For the original retry experiments, budget sweeps, and manual Terminal-Bench lane comparisons, run `git show ea5cfe7:docs/topological-routing.md`. To rerun a retired policy, use the driver at that revision in a separate worktree.
|
||||||
|
- For the probe and holdout measurement tables, run `git show 2b02c6e:docs/topological-routing.md`.
|
||||||
|
- For earlier plans, traces, and performance baselines, see the [routing development archive](../archive/routing/README.md).
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,7 @@
|
||||||
From the repository root, run the overloaded-gate fixture with the regression profile.
|
From the repository root, run the overloaded-gate fixture with the regression profile.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python -m \
|
python -m scripts.compare_topological_routing \
|
||||||
scripts.compare_topological_routing \
|
|
||||||
--case overloaded-gate \
|
--case overloaded-gate \
|
||||||
--profile corpus-regression \
|
--profile corpus-regression \
|
||||||
--mode automatic
|
--mode automatic
|
||||||
|
|
@ -27,7 +26,7 @@ scripts.compare_topological_routing \
|
||||||
| Lock ordering, tight turns, and competing passages | `stress` runs known-feasible folded returns, competing locks, and shared passages. |
|
| Lock ordering, tight turns, and competing passages | `stress` runs known-feasible folded returns, competing locks, and shared passages. |
|
||||||
| A retry tuned on the regression corpus | `retry-holdout` tests related but separate return shelves, bypasses, and competing trunks. |
|
| A retry tuned on the regression corpus | `retry-holdout` tests related but separate return shelves, bypasses, and competing trunks. |
|
||||||
|
|
||||||
Run `python -m scripts.compare_topological_routing --list` to find individual case names. Select a fixture that exhibits the behavior under study, then use the corpus and relevant holdouts to check generalization. [Fixture sources and reproduction](benchmark-fixtures.md)
|
Run `python -m scripts.compare_topological_routing --list` to find individual case names. Start with a fixture that exhibits the behavior you're changing, then check the rest of the corpus and relevant holdouts. For upstream sources and regeneration commands, see [Benchmark fixtures](benchmark-fixtures.md).
|
||||||
|
|
||||||
## Choose a profile
|
## Choose a profile
|
||||||
|
|
||||||
|
|
@ -42,8 +41,7 @@ The two budget profiles use benchmark weights for automatic candidate selection.
|
||||||
### Run the full regression corpus
|
### Run the full regression corpus
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python -m \
|
python -m scripts.compare_topological_routing \
|
||||||
scripts.compare_topological_routing \
|
|
||||||
--case corpus \
|
--case corpus \
|
||||||
--profile corpus-regression \
|
--profile corpus-regression \
|
||||||
--mode automatic --repeat 3 \
|
--mode automatic --repeat 3 \
|
||||||
|
|
@ -53,8 +51,7 @@ scripts.compare_topological_routing \
|
||||||
### Compare routing modes
|
### Compare routing modes
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python -m \
|
python -m scripts.compare_topological_routing \
|
||||||
scripts.compare_topological_routing \
|
|
||||||
--case offset-gates \
|
--case offset-gates \
|
||||||
--profile matched-budget \
|
--profile matched-budget \
|
||||||
--mode off --mode guide \
|
--mode off --mode guide \
|
||||||
|
|
@ -63,13 +60,12 @@ scripts.compare_topological_routing \
|
||||||
--json /tmp/inire-modes.json
|
--json /tmp/inire-modes.json
|
||||||
```
|
```
|
||||||
|
|
||||||
At this budget, guide mode completes the offset net with no corridor seed. Seed mode also completes it at the same cost. Use this comparison to check corridor hints before tuning seed allocation. [How corridors are built](topological-routing.md)
|
Guide and seed complete the offset net at the same cost. Guide does so with no corridor seed. If a change increases work in seed mode, inspect how the [corridor is realized as a path](topological-routing.md#corridor-planning-and-realization).
|
||||||
|
|
||||||
### Test a retry on holdouts
|
### Test a retry on holdouts
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python -m \
|
python -m scripts.benchmark_retry_order \
|
||||||
scripts.benchmark_retry_order \
|
|
||||||
--case retry-holdout \
|
--case retry-holdout \
|
||||||
--profile public-defaults \
|
--profile public-defaults \
|
||||||
--policy baseline \
|
--policy baseline \
|
||||||
|
|
@ -78,10 +74,10 @@ scripts.benchmark_retry_order \
|
||||||
--json /tmp/inire-residual.json
|
--json /tmp/inire-residual.json
|
||||||
```
|
```
|
||||||
|
|
||||||
Inspect verified IDs, paths, and time spent inside failed attempts. [Prior retry decisions and measurements](benchmark-results.md)
|
Inspect verified IDs, paths, and time spent on failed attempts. The [prior retry experiments](benchmark-results.md#early-and-late-retries) show a case where earlier recovery increased cost at the same coverage.
|
||||||
|
|
||||||
## Compare the results
|
## Compare the results
|
||||||
|
|
||||||
1. **Coverage and bounds.** Check verified IDs, requested nets, and any bound. The overloaded gate exercises passage capacity. The imported LiDAR Clements layout exercises fixed-port conflicts. Verify any feasibility witness separately from the timed run.
|
1. **Coverage and bounds.** Check verified IDs, requested nets, and any bound. The overloaded gate exercises passage capacity. The imported LiDAR Clements layout exercises fixed-port conflicts. Verify any feasibility witness separately from the timed run.
|
||||||
2. **Cost on matching net sets.** Benchmark-weighted length weights physical straights, 90-degree bends, and S-bends by 1, 4, and 13. Native objective cost uses the run's configured objective. Compare costs on identical verified IDs, and report coverage changes separately.
|
2. **Cost on matching net sets.** Benchmark-weighted length weights physical straights, 90-degree bends, and S-bends by 1, 4, and 13. Native objective cost uses the run's configured objective. Compare costs on identical verified IDs, and report coverage changes separately.
|
||||||
3. **Search and time.** Compare expansions and repeated wall times at the same settings. Inspect individual slow cases and unsuccessful attempts. Use the stage and trace information to explain where the work moved. [Diagnostics and exact parity](routing-diagnostics.md)
|
3. **Search and time.** Compare expansions and repeated wall times at the same settings. To investigate a slow case or a change in the selected attempt, use the [stage reports and traces](routing-diagnostics.md).
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,16 @@
|
||||||
|
|
||||||
## Choose a task
|
## Choose a task
|
||||||
|
|
||||||
- **[Benchmarks](benchmarks.md)** runs a single case, the regression corpus, or a mode comparison.
|
- Measure a single case, compare modes, or run the regression corpus with the [benchmark CLI](benchmarks.md).
|
||||||
- **[Architecture](architecture.md)** explains planner selection, locks, search, and verification. Start here to find where a behavior change belongs.
|
- Find where to change planner selection, locks, search, or verification in the [architecture guide](architecture.md).
|
||||||
- **[Diagnostics](routing-diagnostics.md)** connects symptoms to stage reports, counters, and traces.
|
- Investigate coverage, route quality, or runtime using the [routing diagnostics](routing-diagnostics.md).
|
||||||
- **[Public API reference](user/api-reference.md)** gives the caller contract for compatibility checks.
|
- Check the caller contract before changing an option or result field in the [public API reference](user/api-reference.md).
|
||||||
|
|
||||||
## Check a change
|
## Check a change
|
||||||
|
|
||||||
1. Run `uv sync` to install development dependencies. Activate `.venv` or prefix the commands with `uv run`.
|
1. Run `uv sync` to install development dependencies. Activate `.venv` or prefix the commands with `uv run`.
|
||||||
2. Run `python -m pytest` for the correctness suite. Use `python -m pytest -m "not routing_corpus"` for a shorter local check.
|
2. Run `python -m pytest` for the correctness suite. Use `python -m pytest -m "not routing_corpus"` for a shorter local check and `ruff check inire scripts` for lint.
|
||||||
3. For a routing change, use the [benchmark profiles](benchmarks.md#choose-a-profile) or [exact parity instructions](routing-diagnostics.md#reproduce-and-compare) to compare coverage, geometry, and work.
|
3. For a routing change, compare coverage, geometry, and work using a consistent [benchmark profile](benchmarks.md#choose-a-profile). If you expect exact paths, costs, and trace data to match, run an [exact parity comparison](routing-diagnostics.md#reproduce-and-compare).
|
||||||
|
|
||||||
For documentation figures, run `python -m scripts.render_documentation_figures` from the repository root. It writes the route plots and planner diagram under `docs/figures`. Pass `--output-dir` to render a scratch copy for comparison.
|
For documentation figures, run `python -m scripts.render_documentation_figures` from the repository root. It writes the route plots and planner diagram under `docs/figures`. Pass `--output-dir` to render a scratch copy for comparison.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
# Routing diagnostics and metrics
|
# Routing diagnostics and metrics
|
||||||
|
|
||||||
Start with the symptom. For layout or option changes, use the [user troubleshooting guide](user/tune-and-troubleshoot.md).
|
Use these reports to investigate a change in planner selection, coverage, or runtime. To troubleshoot a layout you want to route, start with the [user guide](user/tune-and-troubleshoot.md).
|
||||||
|
|
||||||
## Automatic reports
|
## Automatic reports
|
||||||
|
|
||||||
- **A net is missing.** Compare the verified count with `max_routed`. In `overloaded-gate`, `capacity_limit.cut_x` locates the cut that fits three of four requested routes. Below the bound, read `stages` for skipped or locked nets and for the attempt where coverage stopped increasing. [Run the overloaded-gate fixture](benchmarks.md#run-a-benchmark)
|
- **A net is missing.** Compare the verified count with `max_routed`. If the count falls short of the bound, read `stages` for skipped or locked nets and look for the attempt where coverage stopped increasing. To see a run that reaches its bound of three routes out of four, try the [overloaded-gate benchmark](benchmarks.md#run-a-benchmark).
|
||||||
|
|
||||||
- **The chosen route changed.** Start at `stages[selected_stage]`. The `planner` identifies the source of the proposal and `mode` identifies the worker, so a bundle seed can be checked by an `off` worker. Use `planner_rejections` for constructive candidates that never reached selection. [Report definitions](../inire/results.py)
|
- **The chosen route changed.** Start at `stages[selected_stage]`. The `planner` identifies the source of the proposal and `mode` identifies the worker, so a bundle seed can be checked by an `off` worker. Use `planner_rejections` for constructive candidates that never reached selection.
|
||||||
|
|
||||||
- **The run slowed down.** Group exclusive `timings` by policy and operation, including failed attempts. `duration_s` also includes orchestration. Detailed traces, corridor reports, and expanded states describe the selected attempt when present. Check `run.metrics` and stage data for work across attempts. [Benchmark profiles](benchmarks.md#choose-a-profile)
|
- **The run slowed down.** Group exclusive `timings` by policy and operation, including failed attempts. `duration_s` also includes orchestration. Use `run.metrics` and stage data for work across attempts. Detailed traces, corridor reports, and expanded states describe the selected attempt when present.
|
||||||
|
|
||||||
## Route metrics
|
## Route metrics
|
||||||
|
|
||||||
|
|
@ -22,7 +22,7 @@ Pair each counter with a question about the work. Use a repeated wall-time compa
|
||||||
| Refinement takes longer | Compare `refinement_windows_considered`, `refinement_candidates_verified`, and `refinement_candidates_accepted`. Check whether the added windows buy a better path before enlarging the default budget. |
|
| Refinement takes longer | Compare `refinement_windows_considered`, `refinement_candidates_verified`, and `refinement_candidates_accepted`. Check whether the added windows buy a better path before enlarging the default budget. |
|
||||||
| Attempts reach targets while verified coverage stays flat | Compare `iteration_conflict_edges` and `nets_carried_forward`. Inspect pair-local attempts and accepts after congestion stops. `pair_local_search_nodes_expanded` counts searches that returned a locally valid pair, so consult the attempt count to see failed searches. |
|
| Attempts reach targets while verified coverage stays flat | Compare `iteration_conflict_edges` and `nets_carried_forward`. Inspect pair-local attempts and accepts after congestion stops. `pair_local_search_nodes_expanded` counts searches that returned a locally valid pair, so consult the attempt count to see failed searches. |
|
||||||
|
|
||||||
`nets_routed` and `nets_reached_target` count attempts. To count final successes use `result.is_valid` or `verified_net_ids`. Fields ending in `_total_ns` measure durations and can vary between identical runs. Use the counter schema for exact field names and the example snapshot to investigate earlier observations. [Counter schema](../inire/results.py) · [Historical example snapshot](../archive/routing/performance.md) · [Snapshot JSON](../archive/routing/performance_baseline.json)
|
`nets_routed` and `nets_reached_target` count attempts. Use `result.is_valid` or `verified_net_ids` to count final successes. Duration counters ending in `_total_ns` can vary between identical runs. For the full field list, see the [`RouteMetrics` definition](../inire/results.py).
|
||||||
|
|
||||||
## Traces
|
## Traces
|
||||||
|
|
||||||
|
|
@ -45,11 +45,12 @@ python -m scripts.record_iteration_trace --scenario example_07_large_scale_routi
|
||||||
--output-dir /tmp/inire-trace
|
--output-dir /tmp/inire-trace
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Open the generated `iteration_trace.md`. Compare the last iteration's completed count and conflict edges with the final result summary. In the recorded example, the last iteration had six completed nets and two conflict edges.
|
1. Compare the last iteration with the final result in `iteration_trace.md`. The last iteration had six completed nets and two conflict edges in the [recorded fan-out run](../archive/routing/iteration_trace.md#example_07_large_scale_routing_no_warm_start).
|
||||||
2. Inspect the final result and pair-local counters in `iteration_trace.json`. All ten nets verified after repair in the recorded run. The last congestion iteration alone misses this improvement.
|
2. Read the final result and pair-local counters in `iteration_trace.json`. All ten nets verified after repair in this run.
|
||||||
3. To see which paths overlapped, capture the same scenario with `scripts.record_conflict_trace`. Compare `restored_best` with `final`. Use the pre-pair trace to investigate reroute order and per-net work before repair. [Recorded iteration trace](../archive/routing/iteration_trace.md#example_07_large_scale_routing_no_warm_start) · [Conflict trace](../archive/routing/conflict_trace.md) · [Pre-pair trace](../archive/routing/pre_pair_frontier_trace.md)
|
3. Substitute `scripts.record_conflict_trace` in the command to locate the overlapping components. Compare `restored_best` with `final` as shown in the [recorded conflict trace](../archive/routing/conflict_trace.md).
|
||||||
|
4. Substitute `scripts.record_pre_pair_frontier_trace` to see the reroute order and per-net work leading up to repair. Compare your run with the [recorded pre-pair trace](../archive/routing/pre_pair_frontier_trace.md).
|
||||||
|
|
||||||
Use an `iteration_callback` for live progress across automatic attempts and the final result for coverage. [Callback API](user/api-reference.md#route-a-problem)
|
Use the returned result to count final successes. For live progress during routing, pass an [`iteration_callback`](user/api-reference.md#route-a-problem).
|
||||||
|
|
||||||
## Reproduce and compare
|
## Reproduce and compare
|
||||||
|
|
||||||
|
|
@ -64,6 +65,10 @@ python -m scripts.routing_benchmark_parity capture /tmp/routing-after.json --cas
|
||||||
python -m scripts.routing_benchmark_parity compare /tmp/routing-before.json /tmp/routing-after.json
|
python -m scripts.routing_benchmark_parity compare /tmp/routing-before.json /tmp/routing-after.json
|
||||||
```
|
```
|
||||||
|
|
||||||
Use `scripts.record_iteration_trace` and `scripts.record_pre_pair_frontier_trace` to inspect a late conflict. Use `scripts.record_conflict_trace` and `scripts.record_frontier_trace` to locate an overlap and inspect rejected moves near it. Pass `--output-dir /tmp/inire-trace` for a scratch capture. Select any built-in trace case by name with `--scenario`.
|
Select a built-in trace case by name with `--scenario`. Use `--output-dir` to write the capture in a scratch directory.
|
||||||
|
|
||||||
For isolated timing gates, run `INIRE_RUN_PERFORMANCE=1 python -m pytest -q inire/tests/test_example_performance.py`. Use `scripts.record_performance_baseline` with `--output-dir` to record a snapshot. Use `scripts.diff_performance_baseline` to compare a fresh run with the archived baseline, or pass `--baseline` to select a different snapshot. Use `--metric` to select counters. [Routing development archive](../archive/routing/README.md)
|
### Check timing and counters
|
||||||
|
|
||||||
|
- Run the isolated timing gates with `INIRE_RUN_PERFORMANCE=1 python -m pytest -q inire/tests/test_example_performance.py`.
|
||||||
|
- Record a snapshot with `python -m scripts.record_performance_baseline --output-dir /tmp/inire-baseline`. For the resulting coverage, timing, and counter summary, see the [example baseline](../archive/routing/performance.md).
|
||||||
|
- Compare a fresh run with `python -m scripts.diff_performance_baseline`. Use `--metric` to focus on specific work or `--baseline` to override the [default baseline JSON](../archive/routing/performance_baseline.json).
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
# Topological routing
|
# Topological routing
|
||||||
|
|
||||||
Guide mode suggests routes through connected free space. Seed mode also tries to realize those suggestions as physical paths. [Run corridor benchmarks](benchmarks.md#compare-routing-modes)
|
Guide mode suggests routes through connected free space. Seed mode also tries to realize those suggestions as physical paths.
|
||||||
|
|
||||||
## Corridor planning and realization
|
## Corridor planning and realization
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
The offset-gates fixture has two openings at different heights. The mesh highlights the portals used by the chosen corridor. The dashed lane remains angular, while detailed guide-mode search fits an S-bend between the openings. [Reproduce the mode comparison](benchmarks.md#compare-routing-modes)
|
The offset-gates fixture has two openings at different heights. The highlighted triangle edges form the corridor's portals. The dashed line shows the lane suggestion, and the solid S-bend shows the physical route that guide mode found.
|
||||||
|
|
||||||
1. **Find connected space for centerlines.** Inset the board by half the widest net's width and expand obstacles by that half-width plus clearance. Shared edges of a constrained Delaunay triangulation act as portals. A short lead tries to attach each terminal to the mesh along its heading. Using the widest net gives the planner a common representation. Narrower nets may still find a path in lattice search through a passage this mesh excludes.
|
1. **Find connected space for centerlines.** Inset the board by half the widest net's width and expand obstacles by that half-width plus clearance. Shared edges of a constrained Delaunay triangulation act as portals. A short lead tries to attach each terminal to the mesh along its heading. Using the widest net gives the planner a common representation. Narrower nets may still find a path in lattice search through a passage this mesh excludes.
|
||||||
2. **Choose a passage and a lane.** Rank portal sequences by distance, occupancy, and estimated overflow. Use lane samples and estimated turn room to select where to cross each portal without crowding another net's access. A different lane through the same portal can make space for a turn. Joint retries use that distinction to revise a shared passage assignment.
|
2. **Choose a passage and a lane.** Rank portal sequences by distance, occupancy, and estimated overflow. Use lane samples and estimated turn room to select where to cross each portal without crowding another net's access. A different lane through the same portal can make space for a turn. Joint retries use that distinction to revise a shared passage assignment.
|
||||||
|
|
@ -18,16 +18,21 @@ The offset-gates fixture has two openings at different heights. The mesh highlig
|
||||||
|
|
||||||
- **No corridor reported.** Inspect `run.topology` from an explicit guide or seed run. Check snapped port access, mesh padding, and which passages remain connected.
|
- **No corridor reported.** Inspect `run.topology` from an explicit guide or seed run. Check snapped port access, mesh padding, and which passages remain connected.
|
||||||
- **A corridor exists but seed search stalls.** Check terminal headings and the turn room around each chosen portal.
|
- **A corridor exists but seed search stalls.** Check terminal headings and the turn room around each chosen portal.
|
||||||
- **Seeds reach their targets and the final routes overlap.** Inspect lane order and congestion before adding seed nodes. [Mesh and lane allocation](../inire/router/_topology.py) · [Trace guide](routing-diagnostics.md#traces)
|
- **Seeds reach their targets and the final routes overlap.** Inspect lane order and congestion before adding seed nodes. To locate each overlapping component, capture a [conflict trace](routing-diagnostics.md#traces).
|
||||||
|
|
||||||
For the design background on routing through shared triangle edges and on constraints specific to photonic waveguides, see the earlier detailed-routing work. [Curvilinear detailed routing](https://websrv.cecs.uci.edu/~papers/compendium94-03/papers/1998/aspdac98/pdffiles/06c_3.pdf) · [LiDAR 2.0](https://scopex-asu.github.io/files/publications/PD_TCAD2025_LiDARv2.pdf)
|
To investigate how passages and lane order are chosen, start with the [corridor planner](../inire/router/_topology.py).
|
||||||
|
|
||||||
## Moved benchmark sections
|
## Design background
|
||||||
|
|
||||||
- <a id="benchmark-corpus"></a>[Choose a benchmark case](benchmarks.md#choose-a-case)
|
- For the use of shared triangle edges in detailed routing, see [Curvilinear detailed routing](https://websrv.cecs.uci.edu/~papers/compendium94-03/papers/1998/aspdac98/pdffiles/06c_3.pdf).
|
||||||
- <a id="reproduce-a-comparison"></a>[Compare routing modes](benchmarks.md#compare-routing-modes)
|
- For constraints specific to photonic waveguides, see [LiDAR 2.0](https://scopex-asu.github.io/files/publications/PD_TCAD2025_LiDARv2.pdf).
|
||||||
- <a id="probe-budget-and-coverage"></a>[Probe and retry measurements](benchmark-results.md#near-port-probe-and-retry-experiments)
|
|
||||||
- <a id="retry-experiments"></a>[Early and late retries](benchmark-results.md#early-and-late-retries)
|
<a id="moved-benchmark-sections"></a>
|
||||||
- <a id="automatic-nine-net-terminal-bench-routing"></a>[Reproduce Terminal-Bench routing](benchmark-fixtures.md#automatic-nine-net-terminal-bench-routing)
|
|
||||||
- <a id="imported-fixtures"></a>[Sources and regeneration](benchmark-fixtures.md#imported-fixtures)
|
## Reproduce a routing comparison
|
||||||
- <a id="experiment-archive"></a>[Find the archived measurements and scripts](benchmark-results.md#experiment-archive)
|
|
||||||
|
- <a id="benchmark-corpus"></a>To select a board that exercises the behavior you are studying, use the [benchmark case guide](benchmarks.md#choose-a-case).
|
||||||
|
- <a id="reproduce-a-comparison"></a>To compare off, guide, and seed on offset gates, run the [matched-budget example](benchmarks.md#compare-routing-modes).
|
||||||
|
- <a id="probe-budget-and-coverage"></a><a id="retry-experiments"></a>To check a change to probe limits or retry order, see the [prior experiments](benchmark-results.md#near-port-probe-and-retry-experiments).
|
||||||
|
- <a id="automatic-nine-net-terminal-bench-routing"></a><a id="imported-fixtures"></a>To reproduce an upstream workload, see the [Terminal-Bench and imported fixtures](benchmark-fixtures.md).
|
||||||
|
- <a id="experiment-archive"></a>To recover prior measurements and their commands, consult the [experiment archive](benchmark-results.md#experiment-archive).
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ Omitting `options` uses `RoutingOptions()`. To observe live congestion iteration
|
||||||
|
|
||||||
## Path seeds
|
## Path seeds
|
||||||
|
|
||||||
`PathSeed(segments)` holds an ordered tuple of `StraightSeed(length)`, `Bend90Seed(radius, direction)`, and `SBendSeed(offset, radius)` moves. Bend directions are `"CW"` and `"CCW"`. A seed is materialized from the net's current start port using its width and the run's geometry options. [Seed and lock workflows](route-a-layout.md#reuse-an-existing-route)
|
`PathSeed(segments)` holds an ordered tuple of `StraightSeed(length)`, `Bend90Seed(radius, direction)`, and `SBendSeed(offset, radius)` moves. Bend directions are `"CW"` and `"CCW"`. A seed is materialized from the net's current start port using its width and the run's geometry options. For a workflow that starts from an existing route, see [Reuse an existing route](route-a-layout.md#reuse-an-existing-route).
|
||||||
|
|
||||||
## Results
|
## Results
|
||||||
|
|
||||||
|
|
@ -41,7 +41,7 @@ Omitting `options` uses `RoutingOptions()`. To observe live congestion iteration
|
||||||
| `RoutingRunResult.automatic` | In automatic mode, the selected planner, verified IDs, stage history, and any capacity or port-conflict bound. `None` for explicit modes. |
|
| `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. |
|
| `RoutingRunResult.topology` and `metrics` | Corridor counts and seed work when reported by the selected worker, plus work counters across the run. |
|
||||||
|
|
||||||
See [how to read the result](tune-and-troubleshoot.md#read-the-result) for export checks and [developer diagnostics](../routing-diagnostics.md) for reports and traces.
|
Before using a route's physical polygons in your layout, follow the [export checks](tune-and-troubleshoot.md#read-the-result).
|
||||||
|
|
||||||
## Options and defaults
|
## Options and defaults
|
||||||
|
|
||||||
|
|
@ -121,4 +121,14 @@ Increase the iteration limit when later reroutes might resolve conflicts. Adjust
|
||||||
|
|
||||||
### DiagnosticsOptions
|
### DiagnosticsOptions
|
||||||
|
|
||||||
The flags default to `False`. Use `capture_expanded` to plot explored states or `capture_iteration_trace` to attribute search work per net and iteration. For clearance conflicts, `capture_conflict_trace` reports overlapping pairs, `capture_frontier_trace` examines prunes near final hotspots, and `capture_pre_pair_frontier_trace` examines the state before pair-local repair. [Trace fields and examples](../routing-diagnostics.md#traces)
|
The flags default to `False`.
|
||||||
|
|
||||||
|
| Flag | Use it to |
|
||||||
|
| --- | --- |
|
||||||
|
| `capture_expanded` | Plot the states explored by search. |
|
||||||
|
| `capture_iteration_trace` | Attribute search work to individual nets and iterations. |
|
||||||
|
| `capture_conflict_trace` | Find overlapping pairs of routes. |
|
||||||
|
| `capture_frontier_trace` | Examine pruning near a final overlap. |
|
||||||
|
| `capture_pre_pair_frontier_trace` | Inspect the routing state before pair-local repair. |
|
||||||
|
|
||||||
|
For the corresponding result fields and a worked trace, see the [developer diagnostics](../routing-diagnostics.md#traces).
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,10 @@ Start with the [first route](../../README.md#route-a-net), then replace the exam
|
||||||
1. **Choose a coordinate unit.** Inire snaps port coordinates to an integer grid. Choose a unit fine enough to preserve narrow gaps, and use it for widths, radii, clearance, and bounds too.
|
1. **Choose a coordinate unit.** Inire snaps port coordinates to an integer grid. Choose a unit fine enough to preserve narrow gaps, and use it for widths, radii, clearance, and bounds too.
|
||||||
2. **Set source and target headings.** Heading 0 points east and 90 points north. The source heading points along the launch. The target heading points along the arrival. If your device library labels the target port with its outward heading, reverse it by 180 degrees.
|
2. **Set source and target headings.** Heading 0 points east and 90 points north. The source heading points along the launch. The target heading points along the arrival. If your device library labels the target port with its outward heading, reverse it by 180 degrees.
|
||||||
3. **Add a net for each connection.** Give each `NetSpec` a unique ID and the guide width. Set your process limits through `SearchOptions` and choose the required clearance on `RoutingProblem`.
|
3. **Add a net for each connection.** Give each `NetSpec` a unique ID and the guide width. Set your process limits through `SearchOptions` and choose the required clearance on `RoutingProblem`.
|
||||||
4. **Add keepouts.** Supply Shapely polygons in `static_obstacles` and use `bounds` for the board rectangle. Leave enough access at the ports for the guide and its permitted bends. [Input fields](api-reference.md#layout-inputs)
|
4. **Add keepouts.** Supply Shapely polygons in `static_obstacles` and use `bounds` for the board rectangle. Leave enough access at the ports for the guide and its permitted bends.
|
||||||
5. **Run and check.** Call `route(problem, options=options)` and check each `result.is_valid`. Start with automatic mode for general layouts. [Read the result](tune-and-troubleshoot.md#read-the-result)
|
5. **Run and check.** Call `route(problem, options=options)`. Start with automatic mode for general layouts and [check each net before export](tune-and-troubleshoot.md#read-the-result).
|
||||||
|
|
||||||
|
For the constructor signatures and field defaults, see the [layout input reference](api-reference.md#layout-inputs).
|
||||||
|
|
||||||
<a id="connect-a-preplaced-crossing"></a>
|
<a id="connect-a-preplaced-crossing"></a>
|
||||||
|
|
||||||
|
|
@ -67,7 +69,7 @@ Before export, check the port joins and clearance against the actual placed-cell
|
||||||
|
|
||||||
## Reuse an existing route
|
## Reuse an existing route
|
||||||
|
|
||||||
- **Give the router a route it can move.** Put `result.as_seed()` in `initial_paths` under the net's ID. A seed uses the current start port, width, and geometry settings. A partial seed can suggest an approach.
|
- **Give the router a route it can move.** Put `result.as_seed()` in `initial_paths` under the net's ID. A seed uses the current start port, width, and geometry settings. A partial seed can suggest an approach. To build a hint from turns and straights, see the [path seed reference](api-reference.md#path-seeds).
|
||||||
- **Hold a route fixed.** Add `result.locked_geometry` to `static_obstacles` while routing other nets. The next run applies its own clearance.
|
- **Hold a route fixed.** Add `result.locked_geometry` to `static_obstacles` while routing other nets. The next run applies its own clearance.
|
||||||
|
|
||||||
To reuse the verified routes from a first problem as fixed obstacles, add them to a second problem that contains the remaining nets.
|
To reuse the verified routes from a first problem as fixed obstacles, add them to a second problem that contains the remaining nets.
|
||||||
|
|
@ -93,4 +95,4 @@ second = route(replace(
|
||||||
))
|
))
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [locked-path example](../../examples/README.md#route-around-fixed-geometry) for the resulting detour and the [seed reference](api-reference.md#path-seeds) for building a hint by hand.
|
To see the second route detour around a fixed path, run the [locked-path example](../../examples/README.md#route-around-fixed-geometry).
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ Check whether the layout can fit the connection before spending more search time
|
||||||
| `partial` | Inspect where the path ends. Check the next turn, available radius, and search limit. |
|
| `partial` | Inspect where the path ends. Check the next turn, available radius, and search limit. |
|
||||||
| `unroutable` | No path was returned. Check the launch heading and room for the first straight or bend. |
|
| `unroutable` | No path was returned. 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. [Result fields](api-reference.md#results)
|
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.
|
||||||
|
|
||||||
## Why a net stopped short
|
## Why a net stopped short
|
||||||
|
|
||||||
|
|
@ -21,7 +21,7 @@ Check `is_valid` before exporting. With explicit `off`, `guide`, or `seed` mode,
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Both runs use the best-effort example's ports, obstacles, radii, and iteration settings. At three nodes per search, the dashed path stops before the obstacles. At 500, the solid path reaches the westbound target. [Runnable best-effort example](../../examples/09_unroutable_best_effort.py)
|
The dashed route stops short at three nodes per search. To reproduce both outcomes, try 3 and 500 with the same layout and options in the [best-effort example](../../examples/09_unroutable_best_effort.py).
|
||||||
|
|
||||||
## Choose a routing mode
|
## Choose a routing mode
|
||||||
|
|
||||||
|
|
@ -37,7 +37,7 @@ Set `TopologyOptions(mode=...)` and pass it as `topology` in `RoutingOptions`.
|
||||||
|
|
||||||
- Guide and seed modes require constrained triangulation from Shapely 2.1 with GEOS 3.10 or newer. Caller-supplied seeds take precedence, and nets without a corridor can use ordinary lattice search.
|
- Guide and seed modes require constrained triangulation from Shapely 2.1 with GEOS 3.10 or newer. Caller-supplied seeds take precedence, and nets without a corridor can use ordinary lattice search.
|
||||||
- Enable `infer_terminal_headings` for point terminals with flexible headings. Preserve fixed headings when a device requires a specific arrival direction.
|
- Enable `infer_terminal_headings` for point terminals with flexible headings. Preserve fixed headings when a device requires a specific arrival direction.
|
||||||
- In automatic mode, smaller initial budgets make the first attempts cheaper. If coverage remains below the bound, a lattice fallback can use your configured ceiling. Automatic also uses lattice for custom bend geometry or when constrained triangulation is unavailable. [Automatic stage order](../architecture.md#automatic-routing)
|
- In automatic mode, smaller initial budgets make the first attempts cheaper. If coverage remains below the bound, a lattice fallback can use your configured ceiling. Automatic also uses lattice for custom bend geometry or when constrained triangulation is unavailable.
|
||||||
|
|
||||||
## Choose the next setting
|
## Choose the next setting
|
||||||
|
|
||||||
|
|
@ -63,4 +63,4 @@ faster_refinement = replace(
|
||||||
run = route(problem, options=faster_refinement)
|
run = route(problem, options=faster_refinement)
|
||||||
```
|
```
|
||||||
|
|
||||||
[Option defaults](api-reference.md#options-and-defaults) · [Deeper diagnostics](../routing-diagnostics.md)
|
For accepted values and defaults, use the [option reference](api-reference.md#options-and-defaults).
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,13 @@ python examples/01_simple_route.py
|
||||||
|
|
||||||
## Start with a connection
|
## Start with a connection
|
||||||
|
|
||||||
- [Simple route](01_simple_route.py) connects one pair of ports and checks validity. For copyable code and its plot, use the [README quick start](../README.md#route-a-net).
|
Use the [quick start](../README.md#route-a-net) to connect two ports with copyable code. For perpendicular and opposing headings, compare the [port orientations example](05_orientation_stress.py) with its [route plot](05_orientation_stress.png).
|
||||||
- [Port orientations](05_orientation_stress.py) explores routes with perpendicular or opposing headings. [Plot](05_orientation_stress.png)
|
|
||||||
|
|
||||||
## Route around fixed geometry
|
## Route around fixed geometry
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
The first route runs straight. The second must turn around its left end to reach the other side. Run the [locked-path example](03_locked_paths.py), or use the [public API workflow](../docs/user/route-a-layout.md#reuse-an-existing-route) to pass fixed polygons into another run.
|
The straight route is fixed, so the second route loops around its left end. Run the [locked-path example](03_locked_paths.py) to reproduce the detour. To pass a fixed route into your own layout, follow the [route reuse workflow](../docs/user/route-a-layout.md#reuse-an-existing-route).
|
||||||
|
|
||||||
## Fit bends to available room
|
## Fit bends to available room
|
||||||
|
|
||||||
|
|
@ -23,13 +22,17 @@ The first route runs straight. The second must turn around its left end to reach
|
||||||
|
|
||||||
The short path fits a small offset with an S-bend. The longer path has room for a pair of right-angle bends. Run [S-bends and radii](04_sbends_and_radii.py) to see both geometries.
|
The short path fits a small offset with an S-bend. The longer path has room for a pair of right-angle bends. Run [S-bends and radii](04_sbends_and_radii.py) to see both geometries.
|
||||||
|
|
||||||
- [Bend proxies](06_bend_collision_models.py) compares an arc, a box proxy for an arc, and a custom physical bend. [Plot](06_bend_collision_models.png)
|
| Example | What to look for | Preview |
|
||||||
- [Custom bends](08_custom_bend_geometry.py) provides separate physical and proxy polygons. [Plot](08_custom_bend_geometry.png)
|
| --- | --- | --- |
|
||||||
|
| [Bend proxies](06_bend_collision_models.py) | How an arc, a box proxy for an arc, and a custom physical bend affect the route. | [Bend model comparison](06_bend_collision_models.png) |
|
||||||
|
| [Custom bends](08_custom_bend_geometry.py) | A route whose search proxy and physical bend use different polygons. | [Custom bend overlay](08_custom_bend_geometry.png) |
|
||||||
|
|
||||||
## Diagnose congestion or an incomplete route
|
## Diagnose congestion or an incomplete route
|
||||||
|
|
||||||
- [Congestion resolution](02_congestion_resolution.py) separates nets that compete for the same space. [Plot](02_congestion_resolution.png)
|
| Example | What to look for | Preview |
|
||||||
- [Best-effort result](09_unroutable_best_effort.py) stops after a tiny search budget. Try `node_limit=500` and compare the two outcomes on the [troubleshooting page](../docs/user/tune-and-troubleshoot.md#why-a-net-stopped-short).
|
| --- | --- | --- |
|
||||||
- [Fan-out](07_large_scale_routing.py) overlays search states around a bottleneck. This advanced example adjusts the heuristic between iterations through the internal worker. [Plot](07_large_scale_routing.png)
|
| [Congestion resolution](02_congestion_resolution.py) | How rerouting separates nets competing for the same space. | [Separated routes](02_congestion_resolution.png) |
|
||||||
|
| [Best-effort result](09_unroutable_best_effort.py) | Where a path stops with a small node budget. Try `node_limit=500` to complete it. | [Budget comparison](../docs/user/tune-and-troubleshoot.md#why-a-net-stopped-short) |
|
||||||
|
| [Fan-out](07_large_scale_routing.py) | How search states cluster around a bottleneck. The example adjusts the heuristic between iterations through the internal worker. | [Fan-out search overlay](07_large_scale_routing.png) |
|
||||||
|
|
||||||
In plots with a physical overlay, dashed outlines show search proxies and solid outlines show physical geometry. Use the physical outlines to inspect clearance and `result.outcome` to interpret red paths. [Result guide](../docs/user/tune-and-troubleshoot.md#read-the-result)
|
In physical overlays, dashed outlines show search proxies and solid outlines show physical geometry. Inspect clearance using the solid outlines. For red paths, look up `result.outcome` in the [result guide](../docs/user/tune-and-troubleshoot.md#read-the-result).
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue