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:
parent
5c4d32cc3e
commit
a05980e8af
1 changed files with 374 additions and 17204 deletions
|
|
@ -2,95 +2,42 @@
|
|||
|
||||
## Run a benchmark
|
||||
|
||||
From the repository root, run the overloaded-gate fixture with the regression profile.
|
||||
From the repository root, run the overloaded-gate fixture.
|
||||
|
||||
```sh
|
||||
python -m scripts.compare_topological_routing \
|
||||
--case overloaded-gate \
|
||||
--profile corpus-regression \
|
||||
--mode automatic
|
||||
python -m pytest -m routing_corpus -k overloaded-gate
|
||||
```
|
||||
|
||||
Expect `3/4 valid`. All four nets need to cross a vertical cut where the openings have room for three tracks. Run the same command with `--case lidar-clements-8x8` to see `3/6 valid` with a bound set by port spacing.
|
||||
|
||||
## Choose a case
|
||||
|
||||
| If you are changing | Use `--case` |
|
||||
| --- | --- |
|
||||
| Overall coverage | `corpus` runs all benchmark boards, including the search and scaling workloads. |
|
||||
| Ordered tracks, shared gates, and barrier layouts | `all` includes the fixed-heading complex-routing example 1. Use `corpus` for the full regression suite. |
|
||||
| Seeds, custom bend geometry, and fallback behavior | `broad` includes caller seeds, custom bends, imported layouts, and held-out boards. |
|
||||
| Ports on placed devices | `crossings` exercises external legs to preplaced crossing cells. |
|
||||
| Lock ordering, tight turns, and competing passages | `stress` runs known-feasible folded returns, competing locks, and shared passages. |
|
||||
| Tight geometry, complex layouts, search limits, or scaling | `expanded` runs 75 additional boards. Use `geometry-corners`, `complex-layouts`, `search-challenges`, or `scaling` to focus on one group. |
|
||||
| A retry tuned on the regression corpus | `retry-holdout` tests related but separate return shelves, bypasses, and competing trunks. |
|
||||
|
||||
List cases with `python -m scripts.compare_topological_routing --list`. Start with the smallest case that exhibits the behavior.
|
||||
|
||||
`pytest -m routing_corpus` runs regression coverage checks for the corpus and the retry holdouts. Use `pytest -m retry_holdout` to run just the holdout coverage checks.
|
||||
|
||||
`pytest -m routing_corpus -k search-low-length-cost` also checks the three low-length-cost boards with their original 80- or 130-node lattice budgets. The `low-length-cost` case group selects these boards for comparisons under the standard benchmark profiles.
|
||||
|
||||
- [Fixture sources and regeneration](benchmark-fixtures.md)
|
||||
|
||||
## Choose a profile
|
||||
|
||||
| Profile | Use it to |
|
||||
| --- | --- |
|
||||
| `public-defaults` | Measure the public policy and objective on the fixture geometry. |
|
||||
| `corpus-regression` | Reproduce the routing regression settings. The profile sets a 500-node search limit, a 500-node seed budget per net, and up to three congestion iterations per attempt. |
|
||||
| `matched-budget` | Compare modes with the same configured search and iteration limits. Defaults to 500 nodes per search and up to two congestion iterations per attempt. |
|
||||
|
||||
Both budget profiles use benchmark weights when selecting an automatic candidate. A stage can use a smaller budget, and a net can be searched more than once. Match the profile, options, and worker count when measuring a change.
|
||||
|
||||
Benchmark JSON records the configured options for each strategy. Each sample's `attempt_options` lists the effective options passed to routing workers in execution order, including rejected bundle attempts and any fallback workers. `requested_mode` is null for policies that choose their own mode for each attempt.
|
||||
|
||||
For explicit `guide` and `seed` runs, `selected_attempt` is the zero-based index into `attempt_options` of the worker whose routes were returned.
|
||||
The test checks that three of the four nets verify. All four nets need to cross a vertical cut with room for three tracks. Use `-k lidar-clements-8x8` to check an imported board with a bound of three out of six set by port spacing.
|
||||
|
||||
### Run the full benchmark corpus
|
||||
|
||||
```sh
|
||||
python -m scripts.compare_topological_routing \
|
||||
--case corpus \
|
||||
--profile corpus-regression \
|
||||
--mode automatic --repeat 3 \
|
||||
--json /tmp/inire-corpus.json
|
||||
python -m pytest -m routing_corpus
|
||||
```
|
||||
|
||||
The default test suite includes the corpus. Run `python -m pytest -m retry_holdout` to focus on the holdouts.
|
||||
|
||||
## Choose a case
|
||||
|
||||
Use `pytest --collect-only -q -m routing_corpus` to list the case IDs. Start with a board that exhibits the behavior and select it with `-k`.
|
||||
|
||||
- For tight corners and S-bend slots, start with the micron-scale geometry fixtures.
|
||||
- For preplaced devices, choose a case such as `crossing-obstructed-approaches` or `crossing-staggered-grid`.
|
||||
- For a change to retry order, include the held-out return shelves, bypasses, and competing trunks.
|
||||
|
||||
The [fixture guide](benchmark-fixtures.md) describes these layouts and their known bounds. The [corpus registry](../inire/tests/routing_corpus.py) lists the groups and options.
|
||||
|
||||
## Choose a profile
|
||||
|
||||
The corpus uses automatic routing under `corpus-regression`, with a 500-node search limit, a 500-node seed budget per net, and up to three congestion iterations per attempt. On the three `search-low-length-cost` boards it also checks the original 80- or 130-node lattice budget.
|
||||
|
||||
### Compare routing modes
|
||||
|
||||
```sh
|
||||
python -m scripts.compare_topological_routing \
|
||||
--case offset-gates \
|
||||
--profile matched-budget \
|
||||
--mode off --mode guide \
|
||||
--mode seed --nodes 100 \
|
||||
--repeat 3 \
|
||||
--json /tmp/inire-modes.json
|
||||
```
|
||||
|
||||
At 100 nodes per search, `off` verifies no routes. Guide and seed each verify one at the same cost. Guide uses 4 expansions. Seed uses 36 to build its starting path.
|
||||
|
||||
- [Corridor planning and realization](topological-routing.md#corridor-planning-and-realization)
|
||||
|
||||
### Test a retry on holdouts
|
||||
|
||||
```sh
|
||||
python -m scripts.benchmark_retry_order \
|
||||
--case retry-holdout \
|
||||
--profile public-defaults \
|
||||
--policy baseline \
|
||||
--policy late-residual-3000 \
|
||||
--repeat 3 --jobs 6 \
|
||||
--json /tmp/inire-residual.json
|
||||
```
|
||||
|
||||
Omit `--json` for a console summary. The optional JSON includes effective ports and polygon hashes for verified nets, so you can compare incumbent placement as well as coverage and time spent on failed attempts.
|
||||
|
||||
- [Earlier retry results](benchmark-results.md#early-and-late-retries)
|
||||
For a mode comparison, use the same problem and options in each call to `route()`. Change the topology mode and compare verified IDs, route cost on matching net sets, and work counters. The [complex-routing walkthrough](complex-routing-example-1.md#compare-all-routing-modes) shows this comparison with a 100-node search budget.
|
||||
|
||||
## Compare the results
|
||||
|
||||
1. **Coverage and bounds.** Check which nets verified and whether their count reached the reported bound. A reference path shows that its exact route is feasible. Check it separately from an unseeded timing run.
|
||||
2. **Cost on matching net sets.** Benchmark-weighted length weights physical straights, 90-degree bends, and S-bends by 1, 4, and 13. Native objective cost uses the run's configured objective. Compare costs on identical verified IDs, and report coverage changes separately.
|
||||
3. **Search and time.** Compare expansions and repeated wall times at the same settings. Constructive stages can spend time planning and verifying even with zero expansions. To locate work that moved to a different stage, use the [automatic reports](routing-diagnostics.md#automatic-reports).
|
||||
1. **Coverage and bounds.** Check which nets verified and whether their count reached the expected bound. The tests also verify known reference routes where available.
|
||||
2. **Cost on matching net sets.** Benchmark-weighted length weights physical straights, 90-degree bends, and S-bends by 1, 4, and 13. Native objective cost uses the run's configured objective.
|
||||
3. **Search and time.** Compare expansions and repeated wall times at the same settings. Constructive stages can spend time planning and verifying even with zero expansions. Inspect the [automatic reports](routing-diagnostics.md#automatic-reports) to find which stage performed the work.
|
||||
|
|
|
|||
Loading…
Reference in a new issue