inire/docs/topological-routing.md

47 lines
4.8 KiB
Markdown

<a id="topological-routing-and-benchmarks"></a>
# Topological routing
Guide mode suggests where a path can pass through free space and lets detailed search choose the actual turns. Seed mode tries to build a valid starting path through that passage before detailed search starts.
## Corridor planning and realization
![Three views of the offset-gates fixture. The first highlights proposed triangle edges to cross, the second connects chosen crossing points, and the third shows the solid verified path beside the dashed suggestion.](figures/corridor-realization.png)
In the offset-gates example, the two openings are at different heights. The top panel highlights the proposed sequence of triangle edges to cross. In the middle panel, the dashed line joins suggested crossing points. In the bottom panel, the solid route uses an S-bend to change height between the openings.
1. **Find connected space for centerlines.** Inset the board by half the widest guide's width and expand obstacles by that half-width plus clearance. To connect a port to the mesh, try a short straight along its departure or arrival heading, or use the port position itself. If the shared mesh finds no passage for a narrower net, retry with padding for its width.
<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 a sequence of portals by distance and how many other nets want to use the same edges. A lane is a suggested position along an edge where a net can cross into the next triangle. Rank those positions by turn room and the lanes reserved for other nets. A joint retry can change the lane positions for several nets at the same opening. To see how the positions are scored, 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, `run.topology.corridor_counts` shows how many passages the planner found per net. In seed mode, `run.topology.seeded_net_ids` shows which nets received a generated starting path.
- **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 fail clearance checks.** Use the [conflict trace](routing-diagnostics.md#find-components-in-conflict) to identify the pair and locate the components. If they share an opening, check which lanes the routes used and where they turned. A turn inside the opening may leave too little room for the neighboring route.
<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="imported-fixtures"></a>For pinned inputs and regeneration commands, see the [benchmark 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).