inire/archive/routing/simplification-results.md

66 lines
9.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Routing simplification results
These checks compare the November 27, 2026 implementation with `6608e18`. The [routing simplification plan](../../plans/routing-simplification.md) defines the implementation batches and the questions each prototype tested.
## Changes implemented
| Plan items | Decision and verification |
| --- | --- |
| 1 | Reuse the live index when the last completed iteration is also the best. Timeout, an earlier winner, and a callback that edits results each exercised restoration. The change alone avoided 9,201 insertions and 9,201 removals on the public-default corpus. |
| 2–3 | Share the layout rank and stable Manhattan net order. Tests cover each ranking criterion, an empty first review, the pair-length tolerance, mixed headings, equal distances, and alternate lock order. |
| 4–6 | Represent pair targets directly and roll back only rejected installed candidates. Candidate selection uses net-level conflicts. Rejected local searches, reversed attempts, disjoint targets, and the two-pair limit were checked. |
| 7–8 | Share incumbent guidance in frontier replay and remove the unused visibility wrapper. Individual trace flags reproduced the same samples and component indices on the explicit worker runs. Exact and tangent visibility tests passed. |
| 10 | Replace only the pair under repair. The 27 explicit-worker comparisons avoided 740 insertions and 740 removals, from runs that include both fan-out seeds under five diagnostics settings. They matched paths and trace payloads through multiple repairs. |
| 11 | Reuse the best iteration's review when its geometry is still installed and no restored trace needs a capture. The earlier-winner test still performs the restored review. Final verification still supplies partial-path reports and frontier overlap details. The corpus saved 1,589 report calls, 15,582 static buffers, 32,877 dynamic candidate nets, and 13,352 dynamic exact pair checks. |
| 12 | Check for four bends before taking a path out of the index for refinement. Straight and S-bend tests confirm the installed paths stay in place. Bend-heavy fixtures kept their candidate counts and paths. Across both corpus profiles, this saved 416 refinement calls and 2,510 insertions and removals each. |
| 14 | Sample obstacle boundaries only when an enabled objective uses proximity. Bounds checks stay available. The mixed-weight test uses zero search danger and nonzero refinement danger. Pair workers use their search objective and the active greedy weight. Both profiles and the custom-bend cases matched exactly. |
| 17–20 | Reuse the prepared joint-lane problem and the common perimeter residual worker. Joint-lane lock order, skipped IDs, corridor counts, seeded IDs, and stage records matched. The forced perimeter check matched 61 stage records, including 22 residual searches and a verified two-net result on Terminal-Bench Pair. The shared objective constructor preserves each world's obstacle inputs. The containment check accepts flush ports and rejects a custom physical protrusion even when its proxy fits. The trace fixtures use the same result assembly as production. |
| 21–23 | Derive the ordinary scenario runs from the snapshot registry. Repeated selectors preserve registry order across recording and comparison, including a performance-only scenario against an older baseline. The public locked-path example matches both original path reports and the generated plot pixel for pixel. Fixture semantics stayed stable. |
## Prototypes kept out of production
| Item | Trial | Result and decision |
| --- | --- | --- |
| 9 | Explicit no-warm-start fan-out with 8 nets at seeds 41 and 44 and 10 nets at seed 43, plus mutable callbacks, caller seeds, and partial paths. | Three capped incumbents saved 15 insertions and removals each. No capped fallback ran in the two automatic corpus profiles. The hot path keeps its existing sequence. |
| 13 | Seeded alternating doglegs, return shelf, and detour under both corpus profiles, with 108 proposals near the improvement threshold. | Choices, costs, and built and accepted candidates matched. The prototype saved 1,330 component scores in six runs. Across 11 interleaved public-default repeats, the median changed from 431.2 to 430.3 ms on the doglegs, 35.1 to 34.1 ms on the return shelf, and 11.3 to 11.3 ms on the detour. Keep the simpler scoring loop. |
| 15 | A cold, bounded cache of 512 physical clearance buffers, keyed by polygon and clearance. Five interleaved public-default runs per case. | The buffer counts fell on all four cases. The largest retained geometry payload was 474 kB in WKB, before object and native memory overhead. The additional cache state has a modest end-to-end payoff. Keep the direct verification path. |
| 16 | Bypass each congestion precheck separately on offset gates, obstructed crossings, the splitter tree, and ten-net fan-out at seed 42. Five interleaved runs per case. | Skipping the grid presence check changed the fan-out expansion sequence. Skipping the candidate check added 37 congestion checks there and left the exact pair count at 5,860. The splitter tree and fan-out median gains were about 1–2%. Keep both filters. |
### Static verification measurements
| Public-default fixture | Buffer calls before → cache | Median before → cache | Retained input and buffer WKB |
| --- | ---: | ---: | ---: |
| PIC splitter tree | 1,255 → 145 | 5,258 → 5,167 ms | 474 kB |
| Alternating doglegs | 1,695 → 873 | 464 → 438 ms | 437 kB |
| Obstructed crossing approaches | 158 → 20 | 392 → 386 ms | 20 kB |
| Custom physical bend | 36 → 9 | 32.2 → 31.5 ms | 1.9 kB |
The cache trial preserved the mitred-corner distance check. The clearance and collision suites passed with the cache active, including boundary touching.
### Congestion precheck measurements
| Fixture | Grid presence rejections | Candidate rejections after presence | Mean presence / candidate query time |
| --- | ---: | ---: | ---: |
| Offset gates | 0 | 0 | No congestion queries |
| Obstructed crossing approaches | 425 | 0 | 1.42 / 2.54 µs |
| PIC splitter tree | 2,101 | 0 | 2.78 / 11.37 µs |
| Fan-out at seed 42 | 460 | 37 | 2.34 / 14.66 µs |
Query timings include cache hits and misses. In the fan-out run the envelope lookup averaged 11.28 µs and the grid-net lookup averaged 3.22 µs, inclusive of their own checks. Removing the presence filter moved work into the candidate filter and increased full congestion checks from 3,411 to 3,530. Exact tests still distinguish frozen conflicts, soft overlap, and boundary contact.
## Triggers for broader changes
**24. Residual routing.** The direct probe uses locked physical geometry and emits placeholders for disconnected IDs. A connected incumbent retry uses the same prepared residual for ordinary seeding and joint-lane recovery. The joint trial needs a seeded layout check before it can win. A disconnected incumbent instead passes movable seeds on the whole original problem. Perimeter recovery holds one local route, adds it back to the result, and verifies the whole candidate when complete. Residual dogleg generation also holds the incumbents, then checks a whole seeded layout. These flows now share preparation where their inputs match. A broader interface can wait for a recovery case that duplicates the seed merge or the whole-layout check.
**25. Collision queries.** The candidate lookup and exact overlap are already distinct steps. Candidate collection feeds both soft counts and frozen blocking, while final verification checks physical geometry and optionally records component pairs. The precheck measurements show an expansion-order dependency, and the buffer measurements show a limited benefit from adding state. Keep the current lookup boundary around `DynamicPathIndex`. Revisit it when profiling shows that the exact-test work or cache invalidation can be isolated without changing reroute work.
**26. Public options.** Keep the five routing modes and the six option groups. Constructors, benchmark profiles, and option serialization depend on the four bend geometry fields. A legacy polygon can define both proxy and physical geometry, and an explicit custom proxy keeps the standard arc unless a physical geometry is provided. The geometry overrides and the serialized benchmark cases are covered by tests. Revisit grouping with a caller-facing change that can document those cases and migrate existing constructors and fixture presets.
## Combined verification
- Both profiles verified 433 of 437 nets across 67 boards and reached each board's bound. Overloaded Gate verified 3/4 across a three-track cut. LiDAR Clements verified 3/6 with three disjoint fixed-port conflicts. The unseeded Terminal-Bench export verified 9/9 and passed the pinned upstream geometry and cost checker.
- The 134 corpus, 20 retry-holdout, and 20 focused callback and diagnostic comparisons matched their recorded paths, verified IDs, costs, stages, bounds, and trace payloads. The 27 explicit-worker comparisons also matched, including guide and seed reports and both fan-out seeds.
- The expected stable counter differences were `dynamic_path_objects_added`, `dynamic_path_objects_removed`, `verify_path_report_calls`, `verify_static_buffer_ops`, `verify_dynamic_candidate_nets`, `verify_dynamic_exact_pair_checks`, and `refine_path_calls`. The public-default corpus avoided 11,461 insertions and removals each across the combined changes.
- The complete correctness suite passed 385 tests. The separate opt-in run passed all 11 example performance tests.
The parity capture command and counter allowance syntax are in the [verification section of the plan](../../plans/routing-simplification.md#verification-and-sequencing).