Show stress and Terminal-Bench layouts in the examples gallery

This commit is contained in:
Jan Petykiewicz 2026-11-27 10:16:12 -08:00
commit 4a91df39da

107
examples/advanced.md Normal file
View file

@ -0,0 +1,107 @@
# Advanced routing examples
These layouts exercise the same geometry as the stress tests and the nine-net Terminal-Bench cases. Each run starts with the board, keepouts, and ports. Inire computes all the plotted paths from those inputs.
- [Competing passages](#competing-passages) for mixed widths and opposing headings.
- [Bend and return room](#bend-and-return-room) for alternating detours, short shifts, and branches.
- [Placed crossings](#placed-crossings) for access slots and external detours.
- [Nine-net Terminal-Bench board](#nine-net-terminal-bench-board) for fixed and inferred headings on the same input.
## Run a layout
Select a case by its name below. Repeat `--case` to draw several layouts, or omit it to draw all twelve.
```sh
python examples/advanced_layouts.py \
--case stress-crossings-shared-outside-detour \
--case terminal-bench \
--output-dir /tmp/inire-advanced-routes
```
The [input file](advanced-layouts.json) gives each board's bounds, polygon keepouts in WKT, clearance, and allowed bend and S-bend radii. Each net row contains its ID, source port, target port, and width. Ports are `[x, y, heading_in_degrees]`. The [example script](advanced_layouts.py) builds the `RoutingProblem` and calls `route()` in automatic mode.
In the figures, gray shapes are keepouts. Open circles mark sources and filled squares mark targets. Arrows indicate the direction of travel at those ports. The result panel draws the physical waveguides and reports the number of nets that passed verification.
## Competing passages
### Mixed widths at a slit
In `stress-passage-width-key`, the 2-unit-wide lane uses the lower slit with 5 units of clearance. The other five routes share the upper opening, including nets travelling in the opposite direction.
![Six verified routes through a wall. One thin route uses a low slit while five routes share the upper opening.](../docs/figures/example-stress-passage-width-key.png)
### Staggered openings and one shared passage
In `stress-passage-split-merge`, the first wall offers two openings for three tracks each. The routes turn between the walls to enter the second opening as a six-track bank.
![Six ports on each side of two staggered walls. Three routes use each first opening, then all six pass through the second opening.](../docs/figures/example-stress-passage-split-merge.png)
## Bend and return room
### Alternating doglegs
In `stress-refine-alternating-doglegs`, three eastbound nets pass above a wall rising from the bottom and then below a wall hanging from the top. The staggered turns preserve clearance for three different guide widths.
![Three nested waveguides turn above the first wall and below the second wall.](../docs/figures/example-stress-refine-alternating-doglegs.png)
### Folded return near a shelf
In `stress-refine-return-shelf`, the folded net's target lies west of its source and requires eastbound arrival. Follow its loop below the two neighboring routes in the result panel.
![Four verified paths including an east-facing source that loops below two neighboring paths to reach its east-facing target.](../docs/figures/example-stress-refine-return-shelf.png)
### Trunk that detours around branches
In `stress-retry-straight-decoy`, the straight line between the trunk's ports would cut across both perpendicular branches. The router sends the trunk below the branch ports and above the lower rail.
![Two vertical branches route across the direct line between the trunk ports. A four-turn trunk detour leaves both branches room.](../docs/figures/example-stress-retry-straight-decoy.png)
### Short shifts on separate rows
In `stress-retry-compact-shift-bank`, walls divide the board into four rows. The lowest net has only 66 units of forward travel for an 85-unit lateral shift. Its turns fit beside the keepout on that row.
![Four verified routes on separate rows. The lowest net shifts up sharply over a small forward span.](../docs/figures/example-stress-retry-compact-shift-bank.png)
### Mixed port bank
In `stress-retry-mixed-port-bank`, two compact shifts launch in opposite directions around different keepouts. The lower middle net turns from northbound to eastbound, and the top link runs west.
![Five verified routes around six keepouts, including a westbound link, a perpendicular turn, and compact shifts in opposing directions.](../docs/figures/example-stress-retry-mixed-port-bank.png)
## Placed crossings
The crossing cells are already placed. The board supplies keepouts with slots at their ports, and each routed net represents an external connection. To set up the keepouts for your own devices, follow the [placed crossing walkthrough](../docs/user/route-a-layout.md#route-between-placed-crossings).
### Opposed S-bends beside a crossing
In `stress-sbend-competing-slots`, two links make 20-unit lateral shifts while travelling in opposite directions. Their S-bends fit on opposite sides of the small central keepout while two separate links reach the crossing's north and south ports.
![Two opposed S-bends share the left half of the board. Two more waveguides access a preplaced crossing on the right.](../docs/figures/example-stress-sbend-competing-slots.png)
### Odd offset and a short launch pocket
In `stress-crossing-off-lattice-slot`, the west approach must shift by 17 units and land on a recessed port. It uses a pair of 90-degree bends. The north link turns in a short pocket beside a keepout before straightening toward its target.
![Four routes connect to a crossing. The west link steps up near its launch, and the north link turns around an adjacent keepout.](../docs/figures/example-stress-crossing-off-lattice-slot.png)
### Two crossings with an outside detour
In `stress-crossings-shared-outside-detour`, a straight external link joins the two devices. The long lower route bends around the entire south approach bank, leaving both short vertical links in place.
![Nine verified paths around two crossings. A straight route joins the devices, and a long lower detour passes beneath both approaches.](../docs/figures/example-stress-crossings-shared-outside-detour.png)
## Nine-net Terminal-Bench board
The board has seven keepouts and nine connections out of a tight west-side launch bank. Both examples use 2-unit-wide waveguides, clearance 6, and radius 50 for bends and S-bends. For the upstream board pin and the waypoint export command, see the [Terminal-Bench fixture guide](../docs/benchmark-fixtures.md#automatic-nine-net-terminal-bench-routing).
### Fixed eastbound headings
In `terminal-bench`, both headings on every net are fixed eastbound. Follow `net_08` from the low end of the launch bank around the board. It makes a final turnaround to arrive eastbound at its target near the top edge.
![All nine fixed-heading nets verified. The outer return comes back around and makes an eastbound approach to its top target.](../docs/figures/example-terminal-bench.png)
### Point terminals
In `terminal-bench-point-terminals`, heading inference can change the initial zero headings supplied to `Port`. The setup shows the terminal positions, and the result shows the inferred headings. `net_08` arrives westbound from the east and saves the final turnaround.
![The same nine positions with no headings specified in the setup. All routes verify, and the outer return arrives westbound.](../docs/figures/example-terminal-bench-point-terminals.png)