87 lines
4.1 KiB
Markdown
87 lines
4.1 KiB
Markdown
|
|
# Routing benchmarks
|
||
|
|
|
||
|
|
## Run a benchmark
|
||
|
|
|
||
|
|
From the repository root, run the overloaded-gate fixture with the regression profile.
|
||
|
|
|
||
|
|
```sh
|
||
|
|
python -m \
|
||
|
|
scripts.compare_topological_routing \
|
||
|
|
--case overloaded-gate \
|
||
|
|
--profile corpus-regression \
|
||
|
|
--mode automatic
|
||
|
|
```
|
||
|
|
|
||
|
|
- **Coverage.** Expect `3/4 valid`. The capacity report gives three tracks across the cut. This run reached the geometric bound.
|
||
|
|
- **Path quality.** Compare the verified net IDs before comparing weighted length or native objective cost.
|
||
|
|
- **Work.** Read A* expansions and median time together. The report can show work spent planning and verifying even when it reports zero expansions.
|
||
|
|
|
||
|
|
## Choose a case
|
||
|
|
|
||
|
|
| If you are changing | Use `--case` |
|
||
|
|
| --- | --- |
|
||
|
|
| Overall coverage | `corpus` runs the regression suite. |
|
||
|
|
| Ordered tracks, shared gates, and barrier layouts | `all` selects the original fixture group. |
|
||
|
|
| Seeds, custom bend geometry, and fallback behavior | `broad` includes caller seeds, custom bends, imported layouts, and the first holdout set. |
|
||
|
|
| 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. |
|
||
|
|
| A retry tuned on the regression corpus | `retry-holdout` tests related but separate return shelves, bypasses, and competing trunks. |
|
||
|
|
|
||
|
|
Run `python -m scripts.compare_topological_routing --list` to find individual case names. Select a fixture that exhibits the behavior under study, then use the corpus and relevant holdouts to check generalization. [Fixture sources and reproduction](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 test budget of 500 search nodes, 500 seed nodes, and three configured congestion iterations. |
|
||
|
|
| `matched-budget` | Compare modes with shared budgets. It defaults to 500 search nodes and two configured iterations. Use CLI overrides to test a smaller budget. |
|
||
|
|
|
||
|
|
The two budget profiles use benchmark weights for automatic candidate selection. Match the profile, options, and worker count when measuring a change.
|
||
|
|
|
||
|
|
### Run the full regression corpus
|
||
|
|
|
||
|
|
```sh
|
||
|
|
python -m \
|
||
|
|
scripts.compare_topological_routing \
|
||
|
|
--case corpus \
|
||
|
|
--profile corpus-regression \
|
||
|
|
--mode automatic --repeat 3 \
|
||
|
|
--json /tmp/inire-corpus.json
|
||
|
|
```
|
||
|
|
|
||
|
|
### 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 this budget, guide mode completes the offset net with no corridor seed. Seed mode also completes it at the same cost. Use this comparison to check corridor hints before tuning seed allocation. [How corridors are built](topological-routing.md)
|
||
|
|
|
||
|
|
### 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
|
||
|
|
```
|
||
|
|
|
||
|
|
Inspect verified IDs, paths, and time spent inside failed attempts. [Prior retry decisions and measurements](benchmark-results.md)
|
||
|
|
|
||
|
|
## Compare the results
|
||
|
|
|
||
|
|
1. **Coverage and bounds.** Check verified IDs, requested nets, and any bound. The overloaded gate exercises passage capacity. The imported LiDAR Clements layout exercises fixed-port conflicts. Verify any feasibility witness separately from the timed 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. Inspect individual slow cases and unsuccessful attempts. Use the stage and trace information to explain where the work moved. [Diagnostics and exact parity](routing-diagnostics.md)
|