Refactor routing internals and archive retry benchmarks
This commit is contained in:
parent
a8720ac8c9
commit
ea5cfe7f31
1 changed files with 3481 additions and 2583 deletions
|
|
@ -239,6 +239,8 @@ python -m scripts.compare_topological_routing --profile public-defaults \
|
|||
|
||||
`--profile matched-budget` is the default CLI profile. It uses the configured common budget and iteration count and retains the benchmark weights for automatic candidate selection. Use it for controlled mode and policy comparisons. Automatic rows print median elapsed time by operation, with individual timings and the planner, mode, and retry policy in JSON. [Report fields](../DOCS.md#automatic-routing)
|
||||
|
||||
Use `--profile corpus-regression --case corpus` to reproduce the pytest configuration with 500 search nodes, 500 seed nodes, and three congestion iterations. The comparison reports both benchmark-weighted length (`valid_costs` in JSON) and the native objective (`native_valid_costs`) for verified nets. The native objective uses the run's length, bend, and danger weights. The profile also controls which cost automatic routing uses to rank candidates. [Exact parity command](routing-refactor-plan.md#verification)
|
||||
|
||||
One full-corpus run per profile verified 384/388 nets and completed 55/57 boards. Both profiles matched the baseline net IDs and geometric bounds on every board. In the matched-budget run at 500 nodes and three congestion iterations, fixed-heading Terminal-Bench spent 10.42 of 10.60 seconds in refinement and used zero A* expansions. The staggered crossing grid spent 10.00 of 10.08 seconds in search.
|
||||
|
||||
### Refinement and early guide experiments
|
||||
|
|
@ -327,6 +329,8 @@ Four bend-first windows are now the default. A full comparison against the 24-wi
|
|||
|
||||
Trying column jogs before the near-port probe reproduced exact paths and costs on all 67 boards in both profiles. On the alternating doglegs, width-key passage, and split-merge passage, the new order reduced A* expansions from 3,300, 7,200, and 7,200 to zero under public defaults. The earlier constructive planners still run first.
|
||||
|
||||
Trying the residual dogleg as soon as the near-port probe left one net unfinished reproduced exact paths, costs, and routing bounds on all 67 boards in both profiles. For the straight decoy, public-default search fell from 13,200 to 1,200 A* expansions and elapsed time fell from 5.47 to 0.67 seconds in the corpus sweeps. At the matched budget, expansions fell from 5,500 to 500 and elapsed time fell from 3.69 to 0.41 seconds.
|
||||
|
||||
### 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)
|
||||
|
|
@ -382,6 +386,99 @@ python -m scripts.compare_topological_routing --case all --case broad --mode aut
|
|||
--nodes 173 --seed-nodes 173 --iterations 3 --json /tmp/inire-budget-173.json
|
||||
```
|
||||
|
||||
### Earlier lattice and incumbent retries
|
||||
|
||||
The opt-in `lattice-1500` policy tries lattice routing before seed recovery when the near-port and lookahead searches stop at the same verified set, one net short. It requires a configured ceiling of at least 1,500 nodes. On the return shelf, early caps of 500, 750, and 1,000 spent extra work before the usual fallback completed the board. The 1,500- and 2,000-node retries both completed it with the same paths and expansion count.
|
||||
|
||||
The opt-in `recover-near-port` policy tries locked incumbent recovery before the second direct search when the first has verified at least two thirds of the nets and leaves at most two unresolved. The recovery uses at most 500 nodes per search and two congestion iterations. The direct retry is skipped once recovery verifies the complete layout. The `recover-lookahead` variant applies the same idea one net short during the wider split-budget attempt. Both worked on the crossing detour, with near-port recovery completing earlier. [Retry benchmark driver](../scripts/benchmark_retry_order.py)
|
||||
|
||||
The full sweep ran the baseline and four experimental policies over all 67 boards under public defaults and corpus-regression settings, with three interleaved repeats per case and policy. All policies preserved the same verified net IDs, path seeds, and per-net benchmark and native costs. Each reached every board's bound and verified 433/437 nets in both profiles. The combined policy changed search stages only on the return shelf and crossing detour. The splitter tree kept the same stages and expansion count.
|
||||
|
||||
| Case and profile | Baseline median | Combined median | Baseline to combined expansions |
|
||||
| --- | ---: | ---: | ---: |
|
||||
| Return shelf, public defaults | 10.04 s | 4.34 s | 21,199 → 8,399 |
|
||||
| Crossing detour, public defaults | 5.67 s | 0.86 s | 11,373 → 1,370 |
|
||||
| Crossing detour, corpus regression | 5.12 s | 0.85 s | 5,959 → 839 |
|
||||
|
||||
| Profile | Baseline to combined median | Baseline to combined p95 | Baseline to combined sum of medians |
|
||||
| --- | ---: | ---: | ---: |
|
||||
| Public defaults | 0.370 → 0.369 s | 3.94 → 2.33 s | 55.13 → 44.57 s |
|
||||
| Corpus regression | 0.181 → 0.180 s | 2.49 → 2.26 s | 36.00 → 31.74 s |
|
||||
|
||||
The corpus percentile and sum are calculated over the 67 board medians.
|
||||
|
||||
```sh
|
||||
python -m scripts.benchmark_retry_order --case corpus \
|
||||
--policy baseline --policy lattice-1500 --policy recover-lookahead \
|
||||
--policy recover-near-port --policy lattice-1500-and-recover-near-port \
|
||||
--repeat 3 --jobs 6 --json /tmp/inire-retry-order.json
|
||||
```
|
||||
|
||||
#### Retry holdouts
|
||||
|
||||
The `retry-holdout` group contains ten unseeded layouts with 63 nets across three families. The return shelves vary the wall and return bay. The crossing detours vary the floor keepout, outer bypass, and port headings. The competing trunks test straight locks against perpendicular branches. Separate waypoint witnesses establish that all ten layouts are feasible. The 67-board regression corpus keeps its original membership. [Holdout fixtures](../inire/tests/retry_holdout_benchmarks.py)
|
||||
|
||||
The baseline verified 60/63 nets under public defaults and 59/63 under the 500-node corpus-regression profile. Both retry policies verified exactly the same net IDs in both profiles. Each row aggregates three interleaved repeats into per-board medians. The p95 equals the slowest board median in this ten-board sample. Failed retry time is the sum of time spent inside the unsuccessful retries, with one median per affected board.
|
||||
|
||||
| Profile and policy | Median / p95 across boards | Sum of board medians | Completed / failed early retries | Time / expansions spent on failed retries |
|
||||
| --- | ---: | ---: | ---: | ---: |
|
||||
| Public defaults, baseline | 7.00 / 33.37 s | 92.50 s | — | — |
|
||||
| Public defaults, `lattice-1500` | 4.61 / 33.40 s | 91.54 s | 1 / 4 | 9.79 s / 5,398 |
|
||||
| Public defaults, `recover-near-port` | 5.74 / 30.58 s | 86.11 s | 2 / 1 | 1.51 s / 2,000 |
|
||||
| Corpus regression, baseline | 4.88 / 12.97 s | 50.54 s | — | — |
|
||||
| Corpus regression, `recover-near-port` | 4.86 / 12.44 s | 49.56 s | 1 / 2 | 3.48 s / 4,338 |
|
||||
|
||||
Keep both experiments opt-in. `lattice-1500` cut the stepped-roof median from 11.00 s to 3.88 s with identical paths. It failed on four of the five boards where it ran. The corpus-regression ceiling of 500 nodes prevented it from running in that profile. Near-port recovery cut the public floor-pocket median from 4.67 s to 0.77 s with identical paths. On stretched crossings it cut the median from 1.46 s to 0.71 s and increased the cost of `outside_lower` from 1,097.65 to 1,107.65 by the weighted benchmark and from 1,432.12 to 1,437.77 by the native objective. All other per-net costs matched.
|
||||
|
||||
```sh
|
||||
python -m scripts.benchmark_retry_order --case retry-holdout \
|
||||
--policy baseline --policy lattice-1500 --policy recover-near-port \
|
||||
--repeat 3 --jobs 6 --json /tmp/inire-retry-holdout.json
|
||||
```
|
||||
|
||||
#### Splitter tree probe budget
|
||||
|
||||
The public near-port probe spent its last seven congestion iterations retrying the same four unresolved nets at 16 expansions each and stayed at 2/6. The lookahead retry spent another 475 expansions on negotiated iterations, reached 4/6, and supplied the paths that let ordinary incumbent recovery complete the layout.
|
||||
|
||||
| Profile | Baseline | One probe iteration | Two probe iterations |
|
||||
| --- | ---: | ---: | ---: |
|
||||
| Public defaults | 5.76 s / 5,764 expansions | 5.08 s / 4,436 | 5.38 s / 4,875 |
|
||||
| Corpus regression | 4.16 s / 4,689 expansions | 3.78 s / 4,057 | 4.00 s / 4,389 |
|
||||
|
||||
The splitter tree verified all six nets with identical paths and costs in three interleaved repeats of each policy. The one-iteration cap also verified the same net IDs across all 67 regression boards in both profiles. On `crossing-obstructed-approaches` under public defaults, it increased the weighted cost of `x0.e->south-east` by 872.96 and its native cost by 478.21.
|
||||
|
||||
The two-iteration cap preserved exact paths on all 77 boards in both profiles. The 67-board sweep reduced public-default expansions from 59,695 to 46,066 (23%) and corpus-regression expansions from 30,093 to 27,743 (8%). The ten holdouts ran twice per policy. Expansions fell from 121,941 to 109,549 (10%) under public defaults and from 71,761 to 69,511 (3%) under corpus regression. This comparison applies to the initial probe only. The lookahead and incumbent stages retain their existing budgets.
|
||||
|
||||
```sh
|
||||
python -m scripts.benchmark_retry_order --case pic-splitter-tree-1x8-ew \
|
||||
--policy baseline --policy probe-iterations-1 --policy probe-iterations-2 --policy probe-iterations-3 \
|
||||
--repeat 3 --jobs 2 --json /tmp/inire-splitter-probe.json
|
||||
```
|
||||
|
||||
#### Wider search for one unresolved net
|
||||
|
||||
The three public-default holdouts that stopped one net short still had connected residuals with the verified paths locked. Raising the residual search and corridor seed limits let the router finish with those exact paths. The experiment freezes the incumbents, uses at most two congestion iterations for the remaining net, and verifies the merged layout before it can win. Timed runs start with no supplied paths.
|
||||
|
||||
| When the residual budget rises | Verified nets | Fully routed boards | Sum of public-default board times |
|
||||
| --- | ---: | ---: | ---: |
|
||||
| Baseline for the early sweep | 60/63 | 7/10 | 100.12 s |
|
||||
| Before the remaining fallbacks, 1,500 nodes | 62/63 | 9/10 | 104.75 s |
|
||||
| Before the remaining fallbacks, 3,000 nodes | 63/63 | 10/10 | 75.02 s |
|
||||
| Baseline for the late sweep | 60/63 | 7/10 | 87.57 s |
|
||||
| After the ordinary fallbacks, 3,000 nodes | 63/63 | 10/10 | 90.55 s |
|
||||
|
||||
The early sweeps used medians of three repeats. Early 3,000-node recovery changed `fold` on deep roof by +6.44 weighted cost and −226.61 native cost. It also spent 11,000 expansions on a failed stepped-roof attempt. On the 67-board public-default corpus it added 10,025 expansions to the original return shelf and the existing fallback supplied the same result.
|
||||
|
||||
The late sweep ran once across all ten holdouts. Its three retries added 3,881 expansions and preserved every baseline path. The two crossing boards also completed 9/9 in two additional runs each. The seven already complete holdouts kept their exact search stages and expansion counts. Across the original corpus, all 134 case/profile results matched the baseline and the late retry never ran. Keep the escalation opt-in while testing more one-net misses. The existing residual search and verification functions were enough to run this experiment.
|
||||
|
||||
```sh
|
||||
python -m scripts.benchmark_retry_order --case retry-holdout --profile public-defaults \
|
||||
--policy baseline --policy residual-1500 --policy residual-3000 \
|
||||
--repeat 3 --jobs 6 --json /tmp/inire-wider-residual.json
|
||||
python -m scripts.benchmark_retry_order --case retry-holdout --profile public-defaults \
|
||||
--policy baseline --policy late-residual-3000 --jobs 5 --json /tmp/inire-late-residual.json
|
||||
```
|
||||
|
||||
### Selective column scoring
|
||||
|
||||
All three column policies verified the same 335 net IDs across three repeats at 200 nodes per attempt. The cost totals sum one run across all 53 boards. Runtime statistics pool the three runs per board. The column-board median uses the 21 boards where span scoring produced a column candidate.
|
||||
|
|
|
|||
Loading…
Reference in a new issue