Complete feasible stress layouts with verified routing fallbacks

This commit is contained in:
Jan Petykiewicz 2026-11-26 15:23:24 -08:00
commit a2dfb73c33

View file

@ -273,12 +273,56 @@ The experiments below use `2f2add9` as the baseline. The matched-budget profile
Both changes together reproduced the exact path seeds, verified net IDs, per-net costs, and geometric bounds on all 57 boards in both profiles. Each profile verified 384 of 388 nets and completed 55 boards. On the full public-default sweep, refinement polygon builds dropped from 22,400 to 10,529. This is the strongest general-purpose result.
**Constructive S-bend placement.** A nine-position scan routed all 273 nets on the 16 grids whose links admitted a single exact-span S-bend. The tests included three radii, offsets from 2 to 36, mixed widths, and a blocked midpoint. The sum of public-default board medians from three repeats fell from 41.79 to 2.50 seconds. Weighted cost matched on 14 boards and improved on two. The native objective improved on all 16. At the matched budget, one mixed-radius board incurred 2.84 additional native cost units at the same weighted cost. Trying 17 positions added time and produced no additional fully routed boards. The off-lattice offsets and the crossing with a turning exit used the regular router.
**Constructive S-bend placement.** A nine-position scan routed all 273 nets on the 16 grids whose links admitted a single exact-span S-bend. The tests included three radii, offsets from 2 to 36, mixed widths, and a blocked midpoint. The sum of public-default board medians from three repeats fell from 41.79 to 2.50 seconds. Weighted cost matched on 14 boards and improved on two. The native objective improved on all 16. At the matched budget, one mixed-radius board incurred 2.84 additional native cost units while saving 155.10 weighted units. Trying 17 positions added time and produced no additional fully routed boards. The off-lattice offsets and the crossing with a turning exit used the regular router.
**Hybrid S-bend seeding.** In a separate sweep capped at 500 search nodes, seeding 12 local links on a board with an independent long detour cut the public-objective median from 5.57 to 2.63 seconds. Both runs verified 13/13 nets and the hybrid improved both costs. On the board where the long route interacts with nearby links, the attempted hybrid added 7.21 seconds before returning the same 12/13-net fallback. Independent routing regions are a better target for partial seeding.
**Joint portal-lane allocation.** A bounded search assigned distinct lanes to up to four nets using the same portal. A length and turn-cost objective reduced A* expansions from 3,488 to 2,942 on a four-track passage with a verified feasibility witness. All four nets routed at the same costs. The three-run median fell from 2.66 to 2.19 seconds. The timed runs started without the witness paths. An objective that also penalized guide overlap gave 2.68 seconds. In the twelve-board sweep under public defaults, both joint objectives increased coverage from 2/6 to 3/6 on the sole dual-passage fixture. On a single-passage fixture with the same three verified nets, weighted cost improved by 12.66 units and native cost rose by 2.33 units. The sum of public-default board medians moved by less than 1% for either objective. Joint selection among the existing alternate corridors yielded the same final paths in seven matched-budget cases and reduced total expansions by about 0.5%.
Automatic routing now uses the refinement changes and the verified `local-sbend` fast path for whole layouts. The joint-lane policy runs as a single residual retry with incumbents locked. In the integrated run it verified a third net on the dual-passage fixture while retaining the two incumbent routes. Both full-corpus profiles still reach the bounds on all 57 boards. Path seeds and costs matched the baseline on the 56 boards outside the staggered grid. On the grid, `local-sbend` routed all 24 nets with zero A* expansions and the same weighted cost.
In three paired public-default runs against `9ddef65`, the fixed-heading Terminal-Bench median fell from 5.55 to 2.96 seconds and the staggered-grid median fell from 2.92 to 0.26 seconds.
### Corpus regression check and follow-up sweeps
The default test suite runs all 67 boards in the matched-budget profile at 500 search and seed nodes and three congestion iterations. The check asserts the expected number of verified nets and the routing bound for each board. The original 57 cases took 27 seconds in isolation and verified 384/388 nets. The timing comparisons use separate benchmark runs.
Prioritizing refinement windows that begin and end at bends moved the two-unit improvement on `net_05` from window 24 to window 4. The four-window prototype matched verified net IDs, bounds, and both per-net costs on all 57 boards in both profiles. Fixed-heading Terminal-Bench used different geometry at the same scores. In three paired public-default runs, the sum of the four bundle-board medians fell from 15.11 to 4.75 seconds.
On the external splitter tree, starting at 500 nodes reduced the public-default median from 6.99 to 4.82 seconds with the same six verified paths. Trying the residual first lost two nets at the matched budget. A 500-node first pass applied broadly also increased costs on the obstructed crossing approach. A targeted prototype tried it after constructive planning fell short on forward, same-heading layouts whose lateral shifts exceed the reach of one S-bend and which include a short forward span. That guard activated on the splitter tree within the 57-board corpus. A reversed net order, a rotated layout, and a larger board margin also retained all six exact paths and ran faster in both profiles.
Together the four-window order and the guarded first pass matched verified coverage, bounds, and both per-net costs on the full corpus in both profiles.
The joint-lane retry added no verified nets on six witness-backed shared-passage layouts. At the matched budget it ran on four of them, adding 4.2 to 12.8 seconds to their median runtimes. On the earlier dual-passage fixture under public defaults, it increased coverage from 2/6 to 3/6 and median runtime from 29.62 to 33.77 seconds. Capping the retry at 250 nodes yielded 2/6.
### Stress layouts
Ten layouts add 49 nets to the benchmark corpus. Every layout has a complete reference path set. The default suite checks those paths against the fixed headings, board boundaries, obstacles, and inter-net clearance. Automatic routing starts with empty initial paths for the benchmark. Select `--case stress` for these ten boards or `--case corpus` for all 67.
| Layout | Behavior under test | Verified before | Verified with new fallbacks |
| --- | --- | ---: | ---: |
| `stress-refine-alternating-doglegs` | Overlapping refinement windows on six-bend routes with alternating edge walls, mixed widths, and two radii. | 0/3 | 3/3 |
| `stress-refine-return-shelf` | A folded return can shorten its shelf detour while clearing its own arms and a neighboring route. | 4/4 | 4/4 |
| `stress-retry-straight-decoy` | A legal straight trunk disconnects two perpendicular branches when locked. The trunk has a tight lower bypass. | 3/4 | 4/4 |
| `stress-retry-compact-shift-bank` | A 66-unit forward span leaves little turn room for a large lateral shift, while longer links face blocked approaches. | 4/4 | 4/4 |
| `stress-retry-mixed-port-bank` | Opposing short shifts, a perpendicular exit, and a return share one board. This exercises the boundary of the proposed 500-node first-pass guard. | 5/5 | 5/5 |
| `stress-passage-width-key` | A 14-unit slit fits a narrow guide. Five peers share a wider aperture and its approach banks. | 2/6 | 6/6 |
| `stress-passage-split-merge` | Two offset apertures feed a common passage with mixed widths and opposing travel. | 0/6 | 6/6 |
| `stress-sbend-competing-slots` | The centered choices for two opposed S-bends leave less than the required clearance. Two perpendicular links serve a fixed crossing. | 4/4 | 4/4 |
| `stress-crossing-off-lattice-slot` | An odd offset rules out an exact-span S-bend while a different leg must turn in a short launch pocket. | 4/4 | 4/4 |
| `stress-crossings-shared-outside-detour` | Two placed crossings have simple local links while a long route must go around their south approach bank. | 9/9 | 9/9 |
```sh
python -m scripts.compare_topological_routing --case stress --mode automatic \
--nodes 500 --seed-nodes 500 --iterations 3 --json /tmp/inire-stress.json
```
At the matched budget, the original stress run verified 35/49 nets and took about 91 seconds in aggregate over the ten boards. The new `column-jogs` planner completes the alternating doglegs and the two shared-passage layouts by assigning aperture lanes and staggering the turns between columns. The `residual-dogleg` planner routes the straight decoy's trunk while retaining the three other verified paths. With both fallbacks, the ten boards route 49/49 nets and take about 25 seconds in aggregate at the matched budget.
With public defaults, the earlier runs on the alternating doglegs, width-key passage, and split-merge passage exceeded the 150-second per-run limit. The three boards now complete in 2.08, 2.45, and 3.33 seconds, respectively, in a single sweep. Each profile verifies 433/437 nets across all 67 boards and reaches the geometric bound on both partial boards. The other 63 boards reproduce their previous paths and per-net costs in both profiles.
Before the new fallbacks, the proposed four-window refinement order and guarded 500-node first pass matched the original stress baseline at the matched budget. On the seeded return-shelf diagnostic, bend-first ordering found the same cost improvement on its first window that the prior order found on its second, with different geometry.
### External and fallback benchmarks
`--case external` runs six fixed-placement problems from two public sources. The fixtures preserve net IDs and device locations, with optical ports snapped to a 0.1 µm lattice and expressed relative to the imported board. Device boxes become obstacles with outward access cutouts at the selected ports. The timed runs start from empty initial paths. The converted inputs are checked into the repo so benchmark runs work offline. [Fixture data](../inire/tests/data/external_routing_benchmarks.json)