Use this guide to decide whether a routing problem needs better corridors, better detailed moves, or a different retry order. If you are choosing an option for your own layout, start with the [routing modes](../DOCS.md#topological-routing).
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.
3.**Turn the sketch into a path.** Guide mode adds soft costs and move suggestions, so detailed search can leave an awkward corridor. Seed mode first tries to find a physical path inside a corridor and verifies it against obstacles and earlier seeds. It gives the first corridor at least half the per-net budget when there are alternatives. Later detailed iterations can move an incumbent or try another guide. Final verification checks the actual routed geometry.
When debugging `guide` or `seed`, use the explicit mode so you can inspect that worker's `run.topology`. If a net has no corridor, check port access, mesh padding, and which passages remain connected. If it has a corridor and seed realization uses the budget without finishing, check the port headings and the space to turn at each portal. When seeds reach their targets and the final paths still overlap, inspect lane order and congestion before adding seed nodes. [Mesh and lane allocation](../inire/router/_topology.py) · [Trace guide](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)
| Overall routing coverage | `corpus` combines these four groups. The correctness suite checks expected coverage and bounds with `corpus-regression`. |
| A retry tuned on the regression corpus | `retry-holdout` adds related but previously unseen layouts, including return shelves and crossing bypasses. It can expose a trigger that works on one fixture and wastes time on a close variant. |
Use a verified witness to establish feasibility without supplying its paths to the timed run. For intentionally overconstrained layouts, compare against the proven bound. The overloaded gate tests limited passage capacity, while the imported LiDAR Clements layout tests disjoint conflicts between fixed ports. More search cannot exceed either bound at the same geometry. [Fixture groups](../inire/tests/routing_corpus.py)
Choose `public-defaults` to measure the behavior users get from the public policy with the fixture geometry. Choose `corpus-regression` to reproduce the test budget of 500 search nodes, 500 seed nodes, and three configured congestion iterations. Use `matched-budget` to isolate routing-mode differences with the same configured budget. It defaults to 500 search nodes and two configured iterations and accepts overrides. The two budget profiles use benchmark weights for automatic candidate selection.
`offset-gates` is a small check for whether a corridor helps detailed search. At the reduced budget below, `guide` completes the net with no corridor seed. `seed` also completes it at the same cost. That comparison shows that guidance alone is enough on this fixture. Use it to check a change to corridor hints before spending time tuning seed allocation.
Check verified IDs and bounds first. A lower total cost can result from dropping a net. Compare the benchmark-weighted score when judging length by component type and native cost when judging the run's configured objective. The benchmark weights physical lengths of straight, 90-degree bend, and S-bend segments by 1, 4, and 13. Compare paired timings under the same profile and worker count. [Metrics and parity tools](routing-diagnostics.md)
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)
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)
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 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)
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 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)
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. [Original goal](routing-policy-goal.md) · [Refactor plan](routing-refactor-plan.md)