inire/docs/topological-routing.md

47 lines
4.7 KiB
Markdown

<a id="topological-routing-and-benchmarks"></a>
# Topological routing
Guide mode helps detailed search choose a passage through free space. Seed mode also tries to build a physical path through the passage before detailed search starts.
## Corridor planning and realization
![Three views of the offset-gates fixture. The first highlights crossed triangle edges. The second links sampled lanes. The third shows the solid physical route deviating from the dashed lane sketch.](figures/corridor-realization.png)
In offset gates, a route must change height between two openings. Read the panels from top to bottom. The highlighted triangle edges show the chosen portals, the dashed line joins the suggested crossing points, and the solid S-bend shows where detailed search fits a physical turn.
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. A short lead tries to attach each terminal to the constrained Delaunay mesh along its heading. The common padding can exclude passages that a narrower net can still use in lattice search.
<a id="design-background"></a>
A portal is an edge shared by adjacent free-space triangles. For an earlier representation of a route by its crossings of triangle edges, see Section III-A and Figure 1 of [Hama and Etoh's curvilinear detailed-routing paper](https://www.cecs.uci.edu/~papers/compendium94-03/papers/1998/aspdac98/pdffiles/06c_3.pdf).
2. **Choose a passage and a lane.** Rank portal sequences by distance, occupancy, and estimated overflow. Along each chosen portal, sample crossing points and rank them by turn room and access reserved for other nets. A joint retry can move nets to different lanes through the same opening to make room for a turn. To change how candidate points are ranked, inspect [`assign_lanes()`](../inire/router/_topology.py#L214).
3. **Turn the sketch into a path.** Guide mode uses the corridor to suggest moves and add a soft cost, so search can leave it to make a turn. Seed mode first searches inside a corridor and checks any seed against obstacles and earlier seeds. With alternatives, the first corridor gets at least half the per-net seed budget. Later detailed iterations can move an incumbent or use another guide. Final verification checks the installed geometry.
A passage can be connected in the mesh and leave too little room to bend onto the target port's heading. For the bend-radius and port-alignment rules that constrain the physical route, see Section II-B of [LiDAR 2.0](https://arxiv.org/html/2505.17239v1#S2.SS2).
<a id="when-a-corridor-does-not-lead-to-a-route"></a>
## Diagnose a missing or colliding route
In an explicit guide or seed run, check `run.topology.corridor_counts` and `seeded_net_ids` when the worker returns a topology report.
- **No corridor is reported for the net.** Check that the snapped port can launch into free space along its heading. Inspect the keepouts and the padding at the suspected opening to see whether that passage is connected in the mesh.
- **A corridor exists and the path stops short.** Look at the next turn from the end of the partial path. Compare the available space with the allowed radii and arrival heading. If the geometry fits, vary the [per-net seed budget](user/api-reference.md#topologyoptions) and compare whether seed mode reaches the target.
- **The paths reach their ports and overlap.** Use the [conflict trace](routing-diagnostics.md#find-overlapping-components) to identify the nets and the overlapping components. Locate those components on the board. If both nets compete for the same opening, inspect their lane order and available turn room before increasing the seed budget.
<a id="moved-benchmark-sections"></a>
## Reproduce a routing comparison
<a id="reproduce-a-comparison"></a>
On offset gates, guide and seed can finish at the same cost. To see whether the seed saves search work at a shared node budget, compare expansions and seeded IDs in the [matched-budget example](benchmarks.md#compare-routing-modes).
### Benchmark fixtures and prior runs
- <a id="benchmark-corpus"></a>To repeat the comparison on a different geometry, pick a layout from the [benchmark case guide](benchmarks.md#choose-a-case).
- <a id="automatic-nine-net-terminal-bench-routing"></a><a id="imported-fixtures"></a>For pinned inputs and regeneration commands, see the [Terminal-Bench and imported fixtures](benchmark-fixtures.md).
- <a id="probe-budget-and-coverage"></a><a id="retry-experiments"></a><a id="experiment-archive"></a>For measured changes to probe limits or retry order and the commands that produced them, see the [prior experiments](benchmark-results.md#near-port-probe-and-retry-experiments).