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
8 changed files with 374 additions and 17204 deletions
|
|
@ -46,4 +46,4 @@ Holding the straight trunk fixed in `stress-retry-straight-decoy` blocks both ve
|
|||
| Pair-local repair | Coverage and conflict edges before repair, plus the final installed geometry. | [Pair-local search](../inire/router/_pair_local.py), [pair repair trace](routing-diagnostics.md#follow-a-late-conflict-into-pair-local-repair) |
|
||||
| Cost or refinement | Per-net costs on equal verified ID sets and validity after the final check. | [Path refinement](../inire/router/refiner.py), [refinement handoff](../inire/router/_automatic.py#L610) |
|
||||
|
||||
Use [benchmark profiles](benchmarks.md#choose-a-profile) for policy comparisons and [exact parity](routing-diagnostics.md#reproduce-and-compare) for behavior-preserving changes.
|
||||
Use [benchmark profiles](benchmarks.md#choose-a-profile) for policy comparisons and [route results and traces](routing-diagnostics.md#reproduce-and-compare) for behavior-preserving changes.
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
## Micron-scale routing cases
|
||||
|
||||
The `expanded` group adds 75 deterministic, unseeded boards with independently constructed reference routes. The authored grid units are 10, 100, 250, 500, and 1000 nm. Bend radii span 10–100 µm and trace widths span 1–20 µm. The comparison script records `grid_nm` for these boards and the imported fixtures. Convert benchmark-weighted lengths to microns by multiplying by `grid_nm / 1000`.
|
||||
The `expanded` group adds 75 deterministic, unseeded boards with independently constructed reference routes. The authored grid units are 10, 100, 250, 500, and 1000 nm. Bend radii span 10–100 µm and trace widths span 1–20 µm. The fixtures include `grid_nm` for these boards and the imported layouts. Convert benchmark-weighted lengths to microns by multiplying by `grid_nm / 1000`.
|
||||
|
||||
| Group | Boards | Coverage |
|
||||
| --- | ---: | --- |
|
||||
|
|
@ -14,9 +14,7 @@ The `expanded` group adds 75 deterministic, unseeded boards with independently c
|
|||
| `search-challenges` | 11 | Alternating comb walls and other tight passages that require repeated turns or exercise search-budget exhaustion. |
|
||||
| `scaling` | 8 | Banks and crossing arrays of up to 256 nets, obstacle fields with up to 320 keepouts, and a 240-net board with 240 keepouts and four blocked approaches. |
|
||||
|
||||
Pytest verifies the 75 reference layouts and checks that unseeded routing reaches the known bound on every board. Use `--case search-challenges` or `--case scaling` with an explicit budget to compare routing policies on the harder boards. For scaling comparisons, use the same grid, mode, and budget and collect repeated timings with `--repeat`.
|
||||
|
||||
To exercise the low-budget fallbacks on tight geometry, run `--case geometry-corners --profile corpus-regression --mode automatic --nodes 1 --seed-nodes 1 --iterations 1`.
|
||||
Pytest verifies the 75 reference layouts and checks that unseeded routing reaches the known bound on every board. For a scaling comparison, use the same grid, mode, and budget across repeated runs.
|
||||
|
||||
- [Fixture definitions](../inire/tests/routing_expanded_benchmarks.py)
|
||||
|
||||
|
|
@ -24,18 +22,11 @@ To exercise the low-budget fallbacks on tight geometry, run `--case geometry-cor
|
|||
|
||||
Use `complex-routing-example-1` to test fixed eastbound arrival and `complex-routing-example-1-point-terminals` to test heading inference.
|
||||
|
||||
Export the bundle planner's verified waypoints for the point-terminal board.
|
||||
|
||||
```sh
|
||||
python -m scripts.route_complex_routing_example --output /tmp/inire-complex-routing-example-1.json
|
||||
```
|
||||
|
||||
Expect nine verified routes. The unseeded export met the original checker's cost and geometry requirements.
|
||||
The Terminal-Bench tests verify the unseeded point-terminal bundle and replay both reference lane plans.
|
||||
|
||||
- [Example gallery](../examples/advanced.md#complex-routing-example-1)
|
||||
- [Complex-routing walkthrough](complex-routing-example-1.md)
|
||||
|
||||
To replay a known layout, pass `--reference-lane-plan` for the shared bottom passage or `--single-bottom-track` for the one-track version. Use the unseeded command above for planner coverage and timing.
|
||||
- [Terminal-Bench tests](../inire/tests/test_terminal_bench.py)
|
||||
|
||||
## Preplaced crossings
|
||||
|
||||
|
|
@ -57,33 +48,14 @@ The layout tests use process dimensions to exercise routing and placement replay
|
|||
| Coplanar waveguide | Route the conductor and gap envelope from the same seed. With a 29.5 µm envelope and 3 µm clearance, 28 and 32 µm pitches fail and 36 µm passes. |
|
||||
|
||||
- [Layout regression tests](../inire/tests/test_layout.py)
|
||||
- [Fabrication study](../plans/full-project-review.md#31-preserve-authored-lengths-when-rerouting-phase-sensitive-connections--medium)
|
||||
|
||||
### Phase-sensitive routes
|
||||
|
||||
In the Raymond fabrication study, the authored arms of `MZI9` measured 286.770 µm and 183.637 µm. A geometrically valid replacement for the longer arm measured 127.208 µm. It passed the EBeam design-rule check and changed the signed arm-length difference from +103.133 µm to −56.429 µm. Replaying a separate Bézier-based waveguide with circular bends changed its reported length from 156.137 µm to 154.948 µm. Compare the reported lengths against the circuit's tolerance before replacing a phase-sensitive route. [Raymond fabrication layout](https://github.com/SiEPIC/openEBL-2025-02/blob/a887476a301db2a014be007717cd1821e111f58e/submissions/EBeam_hannahraymond_MZIv21.gds) · [EBeam bend definitions](https://github.com/SiEPIC/SiEPIC_EBeam_PDK/blob/363fbb52eefa8669100499ab531d3fe7befc4867/klayout/EBeam/WAVEGUIDES.xml#L3-L15) · [Reported lengths](user/api-reference.md#results)
|
||||
|
||||
## Imported fixtures
|
||||
|
||||
The importer cuts port openings in device keepouts and snaps optical ports to a 0.1 µm grid. One layout unit is 0.1 µm.
|
||||
The converted fixtures have port openings cut into device keepouts and use a 0.1 µm grid. The test suite reads the checked-in layouts.
|
||||
|
||||
- [Converted fixture geometry](../inire/tests/data/external_routing_benchmarks.json)
|
||||
|
||||
| Cases | Pinned source | License |
|
||||
| --- | --- | --- |
|
||||
| Splitter tree, ring modulator, and MZM | [FLYR PIC Routing Benchmark archive](https://huggingface.co/datasets/FLYR/pic-benchmark/resolve/0c1f445792926d97fae01893c89e96b8a9393800/pic-benchmark.zip) | FLYR's bundled `LICENSE` specifies [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). |
|
||||
| Toy layout and subsets of the Clements and MRR weight-bank layouts | [LiDAR benchmark inputs](https://github.com/ScopeX-ASU/LiDAR/tree/4e7004d32b0b80d959553797fb30f0737513de0c/src/picroute/benchmarks) | [ScopeX@ASU's MIT license](../inire/tests/data/LiDAR-LICENSE.txt). |
|
||||
|
||||
### Regenerate the converted inputs
|
||||
|
||||
The importer checks both archive hashes before converting geometry. It uses PyYAML to read the layout files. Generate a scratch copy and compare it with the checked-in fixture data.
|
||||
|
||||
```sh
|
||||
mkdir -p /tmp/inire-external-routing
|
||||
curl -fL 'https://huggingface.co/datasets/FLYR/pic-benchmark/resolve/0c1f445792926d97fae01893c89e96b8a9393800/pic-benchmark.zip' \
|
||||
-o /tmp/inire-external-routing/pic-benchmark.zip
|
||||
curl -fL 'https://codeload.github.com/ScopeX-ASU/LiDAR/tar.gz/4e7004d32b0b80d959553797fb30f0737513de0c' \
|
||||
-o /tmp/inire-external-routing/lidar.tar.gz
|
||||
uv run --with 'pyyaml==6.0.3' python -m scripts.import_external_routing_benchmarks \
|
||||
--pic-archive /tmp/inire-external-routing/pic-benchmark.zip \
|
||||
--lidar-archive /tmp/inire-external-routing/lidar.tar.gz \
|
||||
--output /tmp/inire-external-routing/fixtures.json
|
||||
cmp inire/tests/data/external_routing_benchmarks.json \
|
||||
/tmp/inire-external-routing/fixtures.json
|
||||
```
|
||||
- [Converted geometry](../inire/tests/data/external_routing_benchmarks.json)
|
||||
- [Fixture sources and licenses](../inire/tests/data/README.md)
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
# Benchmark results
|
||||
|
||||
Use these comparisons to choose a probe budget or retry order.
|
||||
|
||||
- [Benchmark commands and profiles](benchmarks.md)
|
||||
|
||||
## Near-port probe and retry experiments
|
||||
|
||||
On November 26, 2026, a two-iteration cap cut public-default corpus expansions by 23% against the full probe budget. Verified paths and costs matched on the corpus and holdouts under both tested profiles (`public-defaults` and `corpus-regression`).
|
||||
|
||||
- The splitter tree still verified all six nets and used fewer expansions after shortening the probe.
|
||||
- The mixed port bank used more expansions because the last net moved from the short probe to the larger retry.
|
||||
- A one-iteration cap increased the cost of a crossing approach. The clipped-proxy case needed the full probe to find its cheaper route. The two-iteration cap applies to the arc proxy in the [automatic stage sequence](architecture.md#automatic-routing).
|
||||
|
||||
```sh
|
||||
python -m scripts.benchmark_retry_order --case corpus --case retry-holdout \
|
||||
--policy baseline --policy probe-full-budget --jobs 6 --json /tmp/inire-probe.json
|
||||
```
|
||||
|
||||
### Early and late retries
|
||||
|
||||
The November 26, 2026 retry experiments used the pre-cap baseline. Failed early retries added work before the ordinary fallback. In one holdout, early incumbent recovery selected a higher-cost path at the same coverage. When comparing a change to retry order, measure the cost of failed attempts as well as the successful recoveries. For the trigger conditions and older driver, see the [archived retry measurements](../archive/routing/README.md#reproduce-probe-and-retry-experiments).
|
||||
|
||||
In the `public-defaults` holdout sweep, `late-residual-3000` recovered the last net on two crossing boards and a return shelf while preserving the previously verified paths. It requires room in the caller's budget and connected ports with the incumbents locked. Use the current comparison below to measure the cost of that extra attempt.
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
## Experiment archive
|
||||
|
||||
- [Archived expansion counts, revisions, and commands](../archive/routing/README.md#reproduce-probe-and-retry-experiments)
|
||||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -50,13 +50,7 @@ Compare the solid and dashed approaches of `net_07` near the top edge.
|
|||
|
||||
## 5. Inspect the result
|
||||
|
||||
Find the two stages under `runs[0].samples[0].stages` in the benchmark JSON. Both report zero A* expansions.
|
||||
|
||||
```sh
|
||||
python -m scripts.compare_topological_routing \
|
||||
--case complex-routing-example-1 --profile public-defaults --mode automatic \
|
||||
--json /tmp/inire-complex-routing-example-1-stages.json
|
||||
```
|
||||
Inspect `run.automatic.stages` and `run.automatic.selected_stage` after routing the fixed-heading board under the public defaults. Both stages report zero A* expansions.
|
||||
|
||||
| Stage | Planner | Operation | Verified nets |
|
||||
| --- | --- | --- | --- |
|
||||
|
|
@ -66,7 +60,6 @@ python -m scripts.compare_topological_routing \
|
|||
The point-terminal variant accepts a westbound arrival for `net_08`, so the original bundle needs no turnaround. Rerun the gallery command with `--case complex-routing-example-1-point-terminals` to see the result.
|
||||
|
||||
- [Example gallery](../examples/advanced.md#complex-routing-example-1)
|
||||
- [Waypoint export](benchmark-fixtures.md#complex-routing-example-1)
|
||||
|
||||
## Compare all routing modes
|
||||
|
||||
|
|
@ -104,7 +97,7 @@ To see the corridor model on the same board, run `net_08` on its own in guide mo
|
|||
Left, the mesh, green corridor cells, and dashed guide. Right, purple expanded positions and the red partial path at the 12-node limit.
|
||||
|
||||
```sh
|
||||
python -m scripts.render_complex_routing_example --output-dir /tmp/inire-complex-routing-example-1
|
||||
python -m scripts.render_documentation_figures --output-dir /tmp/inire-complex-routing-example-1
|
||||
```
|
||||
|
||||
- [Corridor planning](topological-routing.md#corridor-planning-and-realization)
|
||||
|
|
@ -117,4 +110,4 @@ python -m scripts.render_complex_routing_example --output-dir /tmp/inire-complex
|
|||
| Lanes and seeds | [Lane assignment](../inire/router/_bundle.py#L114), [waypoint compiler](../inire/router/_waypoints.py#L33) |
|
||||
| Eastbound arrival | [Turnaround candidates](../inire/router/_perimeter.py#L103) |
|
||||
| Verification and refinement | [Seeded worker](../inire/router/_automatic.py#L173), [physical verification](../inire/geometry/collision.py#L687), [refinement handoff](../inire/router/_automatic.py#L610) |
|
||||
| Figures and mode comparison | [Figure generator](../scripts/render_complex_routing_example.py) |
|
||||
| Figures and mode comparison | [Figure generator](../scripts/render_documentation_figures.py) |
|
||||
|
|
|
|||
|
|
@ -10,32 +10,21 @@
|
|||
- [Routing diagnostics](routing-diagnostics.md)
|
||||
- [Benchmarks](benchmarks.md)
|
||||
- [Benchmark fixtures](benchmark-fixtures.md)
|
||||
- [Benchmark results](benchmark-results.md)
|
||||
- [Public API](user/api-reference.md)
|
||||
|
||||
## Check a change
|
||||
|
||||
1. From the repository root, run `uv sync` to install development dependencies. Activate `.venv` or prefix commands with `uv run`.
|
||||
2. Run `python -m pytest` for the correctness suite and `ruff check inire scripts` for lint. Use `python -m pytest -m "not routing_corpus"` for a shorter local check.
|
||||
3. For a cleanup that should preserve paths, capture both revisions and run an [exact parity comparison](routing-diagnostics.md#reproduce-and-compare). Include callbacks or traces if the change affects them.
|
||||
3. For a cleanup that should preserve paths, use the same fixtures and options in both revisions. Compare the relevant [route results and traces](routing-diagnostics.md#reproduce-and-compare).
|
||||
4. For a policy or budget change, start with a case that exhibits the behavior. Compare verified IDs, cost, and work under the same [benchmark profile](benchmarks.md#choose-a-profile). Check the corpus and related holdouts before adopting the change.
|
||||
|
||||
Build release archives with `uv build`. The wheel contains the runtime. The source archive also includes tests and fixtures. Smoke-test the wheel outside the checkout on Python 3.11 with Shapely 2.1.0 and GEOS 3.10 or newer, once with NumPy 1.26 and once with NumPy 2.x.
|
||||
|
||||
### Check a documentation figure
|
||||
### Regenerate documentation figures
|
||||
|
||||
Run `python -m scripts.render_documentation_figures --output-dir /tmp/inire-figures` to preview the guides' figures. Check the port directions, keepouts, and route against the runnable example before writing its caption. Omit `--output-dir` to write the guide figures to `docs/figures`. The basic example scripts save their own plots in `examples/`.
|
||||
Run `python -m scripts.render_documentation_figures` to regenerate the guides, the complex-routing walkthrough, and the advanced example gallery in `docs/figures`. Pass `--output-dir /tmp/inire-figures` to preview them in a separate directory.
|
||||
|
||||
### Refresh the advanced example gallery
|
||||
The gallery and walkthrough use the checked-in [layout data](../examples/advanced-layouts.json). The [numbered examples](../examples/README.md) save their own plots in `examples/`.
|
||||
|
||||
After changing a stress fixture or the nine-net board, export the inputs again and regenerate the [advanced example figures](../examples/advanced.md). The exporter checks that the saved data reproduces the benchmark geometry and public-default options. Regenerate the intermediate views when the [complex-routing walkthrough](complex-routing-example-1.md) changes.
|
||||
|
||||
```sh
|
||||
python -m scripts.export_advanced_examples
|
||||
python examples/advanced_layouts.py --output-dir docs/figures
|
||||
python -m scripts.render_complex_routing_example
|
||||
```
|
||||
|
||||
## Development history
|
||||
|
||||
- [Routing development archive](../archive/routing/README.md)
|
||||
When editing a guide, state which inputs or earlier example a reader needs to follow a linked section. Run affected examples, check the links and figures, and preserve existing heading anchors.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -42,10 +42,25 @@ In an explicit guide or seed run, `run.topology.corridor_counts` shows how many
|
|||
|
||||
Compare expansions and seeded IDs on offset gates at the same search budget.
|
||||
|
||||
- [Matched-budget command](benchmarks.md#compare-routing-modes)
|
||||
- [Compare routing modes](benchmarks.md#compare-routing-modes)
|
||||
|
||||
### Benchmark fixtures and prior runs
|
||||
<a id="benchmark-fixtures-and-prior-runs"></a>
|
||||
|
||||
### Benchmark fixtures
|
||||
|
||||
- <a id="benchmark-corpus"></a>[Benchmark cases](benchmarks.md#choose-a-case)
|
||||
- <a id="imported-fixtures"></a>[Fixture sources and regeneration](benchmark-fixtures.md)
|
||||
- <a id="probe-budget-and-coverage"></a><a id="retry-experiments"></a><a id="experiment-archive"></a>[Probe and retry experiments](benchmark-results.md#near-port-probe-and-retry-experiments)
|
||||
- <a id="imported-fixtures"></a>[Fixture sources](benchmark-fixtures.md)
|
||||
|
||||
<a id="probe-budget-and-coverage"></a>
|
||||
<a id="retry-experiments"></a>
|
||||
<a id="experiment-archive"></a>
|
||||
|
||||
### Near-port probe and retry experiments
|
||||
|
||||
In the November 26, 2026 experiments, a two-iteration cap reduced public-default corpus expansions by 23% against the full probe budget. Verified paths and costs matched on the corpus and holdouts under `public-defaults` and `corpus-regression`. The splitter tree still verified all six nets with less work. The mixed port bank used more expansions because the last net moved to a larger retry.
|
||||
|
||||
A one-iteration cap increased the cost of a crossing approach. The clipped-proxy case needed the full probe to find its cheaper route. The current two-iteration cap applies to the arc proxy. [Automatic stage sequence](architecture.md#automatic-routing)
|
||||
|
||||
The pre-cap trials showed that failed early retries added work before fallback. Early incumbent recovery chose a higher-cost route at the same coverage on one holdout. In the public-default holdout sweep, the experimental `late-residual-3000` policy recovered the last net on two crossing boards and a return shelf while preserving the verified paths. It required room in the caller's budget and connected residual ports with those paths locked. When changing retry order, measure failed attempts as well as recoveries.
|
||||
|
||||
The original probe tables are in `git show 2b02c6e:docs/topological-routing.md`. The earlier retry triggers, sweeps, and lane comparisons are in `git show ea5cfe7:docs/topological-routing.md`.
|
||||
|
|
|
|||
Loading…
Reference in a new issue