Retire routing archives and consolidate documentation tooling

Generate the guide, walkthrough, and gallery figures from one command. Keep benchmark fixtures and attribution with the tests and fold the durable findings from completed plans into the guides.
This commit is contained in:
Jan Petykiewicz 2026-12-02 20:33:19 -08:00
commit a05980e8af

View file

@ -62,41 +62,29 @@ An earlier entry such as `restored_best` indexes the paths at that stage. Use th
Capture the conflict trace for fan-out with warm starts disabled. The best congestion iteration leaves two disjoint pairs of nets competing for space.
```sh
python -m scripts.record_conflict_trace \
--scenario example_07_large_scale_routing_no_warm_start \
--output-dir /tmp/inire-trace
The [fan-out regression](../inire/tests/test_example_regressions.py) enables these traces and checks the restored and final layouts. To inspect its result from a checkout, run this Python snippet.
```python
from inire.tests.example_scenarios import trace_example_07_no_warm_start
run = trace_example_07_no_warm_start()
for entry in run.conflict_trace:
if entry.stage in ("restored_best", "final"):
print(entry.stage, entry.completed_net_ids, entry.conflict_edges)
```
1. In `conflict_trace.json`, find `restored_best`. Six nets verify. The conflicts are `net_02`–`net_03` and `net_06`–`net_07`.
2. Compare with `final`. All ten nets pass verification after repair, and the list of conflict edges is empty.
3. Substitute `scripts.record_iteration_trace` for expansion and congestion counts, or `scripts.record_pre_pair_frontier_trace` for reroute order and per-net work before repair.
- [Saved conflict trace](../archive/routing/conflict_trace.md#example_07_large_scale_routing_no_warm_start)
- [Saved pre-pair trace](../archive/routing/pre_pair_frontier_trace.md)
1. At `restored_best`, six nets verify. The conflicts are `net_02`–`net_03` and `net_06`–`net_07`.
2. At `final`, all ten nets pass verification after repair and the list of conflict edges is empty.
3. Inspect `run.iteration_trace` for expansion and congestion counts and `run.pre_pair_frontier_trace` for reroute order and per-net work before repair.
Use the returned result to count final successes. For live progress during routing, pass an [`iteration_callback`](user/api-reference.md#route-a-problem).
## Reproduce and compare
1. Start with a fixture that shows the symptom. Capture the same options at both revisions. For a behavior-preserving change, exact parity checks move sequences, effective ports, physical polygon hashes, scores, stage metadata, stable counters, and coverage. Add `--callbacks` and `--diagnostics` to both captures when changing callback or trace behavior.
2. For a policy change, check verified IDs, paths, and per-net costs first. Advance to the full corpus and relevant holdouts once the focused case behaves as intended. Use interleaved repeats for timing and name the boards that get slower. Time inside failed retries can explain a tail regression that the median obscures.
3. If the run gets slower without more expansions, check the operation timings and use the counters above to pick a narrower trace or profile.
```sh
# Run this from the baseline checkout.
python -m scripts.routing_benchmark_parity capture /tmp/routing-before.json --case stress
# Run these from the changed checkout.
python -m scripts.routing_benchmark_parity capture /tmp/routing-after.json --case stress
python -m scripts.routing_benchmark_parity compare /tmp/routing-before.json /tmp/routing-after.json
```
Use capture scripts with the same snapshot schema on both revisions. Version 1 snapshots still compare with each other. Version 2 adds effective port and polygon data.
Select a built-in trace case by name with `--scenario`. Use `--output-dir` to write the capture in a scratch directory.
1. Start with the same fixture and options in both revisions. Run the relevant [regression tests](benchmarks.md#run-a-benchmark).
2. For a change intended to preserve routes, compare the verified IDs, move sequences, effective ports, and physical geometry in the returned results. Include stage records, callbacks, or traces when the change touches them.
3. For a change to routing policy, compare verified IDs, paths, and per-net costs first. Then run the corpus and relevant holdouts. Use interleaved repeats for timing, and inspect operation timings when runtime changes without a corresponding change in expansions.
### Check timing and counters
- Run the isolated timing gates with `INIRE_RUN_PERFORMANCE=1 python -m pytest -q inire/tests/test_example_performance.py`.
- Record a snapshot with `python -m scripts.record_performance_baseline --output-dir /tmp/inire-baseline`. For the resulting coverage, timing, and counter summary, see the [example baseline](../archive/routing/performance.md).
- Compare a fresh run with `python -m scripts.diff_performance_baseline`. Use `--metric` to focus on specific work or `--baseline` to override the [default baseline JSON](../archive/routing/performance_baseline.json).
Run the timing gates with `INIRE_RUN_PERFORMANCE=1 python -m pytest -q inire/tests/test_example_performance.py`. Use the work counters above to investigate a slower case.