Compare commits

..
Author SHA1 Message Date
4a91df39da Show stress and Terminal-Bench layouts in the examples gallery 2026-11-27 10:16:12 -08:00
2c7a7ea90a Tie routing documentation to user and developer workflows 2026-11-27 10:15:54 -08:00
2d77877fff Record routing simplification results and prototype decisions 2026-11-27 00:55:47 -08:00
926b2645b5 Reuse residual routing for perimeter recovery 2026-11-27 00:53:58 -08:00
15c2714f1f Sample proximity only for objectives that use it 2026-11-27 00:48:37 -08:00
a4c76f3a68 Skip refinement setup for paths with too few bends 2026-11-27 00:45:28 -08:00
16145714a8 Reuse the verified review of the installed best iteration 2026-11-27 00:42:27 -08:00
0319274163 Keep unrelated paths installed during pair repair 2026-11-27 00:40:44 -08:00
e9ed72d0dc Demonstrate locked routes with two public routing calls 2026-11-27 00:38:00 -08:00
0c059cc7d6 Share worker setup, residual preparation, and scenario capture 2026-11-27 00:38:00 -08:00
591560949c Reuse replay guidance and remove an unused visibility wrapper 2026-11-27 00:34:49 -08:00
d95eab6963 Simplify pair repair targets and avoid redundant index restores 2026-11-27 00:34:49 -08:00
5120ef52e2 Share stable net ordering across routing planners 2026-11-27 00:30:40 -08:00
083f4365b4 Share the layout ranking used during congestion and repair 2026-11-27 00:28:32 -08:00
1cad709c63 Reuse installed geometry for the best final iteration 2026-11-27 00:27:16 -08:00
6608e18ef5 Build traces on demand and share routing fixture setup 2026-11-26 23:00:23 -08:00
a029791f33 Tie documentation links to reader workflows 2026-11-26 22:03:08 -08:00
ec2768853e Simplify routing verification and isolate benchmark policies 2026-11-26 21:55:34 -08:00
75 changed files with 3627 additions and 2082 deletions

53
DOCS.md
View file

@ -2,41 +2,46 @@
# User guide
Get a [first route running](README.md#route-a-net), then use these guides for your own layout.
If you're new to Inire, start with the [single-net quick start](README.md#route-a-net).
<a id="incremental-routing-with-locked-geometry"></a>
<a id="initial-paths-with-pathseed"></a>
## Describe a layout
- [Route a layout](docs/user/route-a-layout.md) covers units, port headings, widths, and keepouts.
- [Route between placed crossings](docs/user/route-a-layout.md#route-between-placed-crossings) uses the cell footprints, port access, and external connections from your layout.
- [Reuse an existing route](docs/user/route-a-layout.md#reuse-an-existing-route) explains fixed routes and movable seeds.
## Read the result
- [Interpret the result](docs/user/tune-and-troubleshoot.md#read-the-result) before exporting physical paths.
- [Diagnose an unfinished net](docs/user/tune-and-troubleshoot.md#why-a-net-stopped-short) and decide whether to change the layout or try another search.
- [Set units, port headings, and keepouts](docs/user/route-a-layout.md#define-the-inputs) before routing.
- [Route between placed crossings](docs/user/route-a-layout.md#route-between-placed-crossings) using the cell footprints and local port openings.
- [Reuse an existing route](docs/user/route-a-layout.md#reuse-an-existing-route) when a later net must avoid it or when search could benefit from a movable seed.
<a id="read-the-result"></a>
<a id="topological-routing"></a>
<a id="choose-a-routing-mode"></a>
<a id="automatic-routing"></a>
<a id="tune-a-run"></a>
## Choose a routing mode
## Check and improve a route
[Compare routing modes](docs/user/tune-and-troubleshoot.md#choose-a-routing-mode) for automatic selection, lattice search, guide, seed, or ordered bundles.
- [Check the result](docs/user/tune-and-troubleshoot.md#read-the-result) to see whether each net reached its port and cleared obstacles.
- [Export verified geometry](docs/user/route-a-layout.md#export-verified-geometry) to use the physical polygons in your layout.
- [Diagnose an unfinished net](docs/user/tune-and-troubleshoot.md#why-a-net-stopped-short) to decide whether to change the layout or spend more search time.
- [Choose a routing mode](docs/user/tune-and-troubleshoot.md#choose-a-routing-mode) when your layout calls for a specific planner.
- [Adjust a setting](docs/user/tune-and-troubleshoot.md#choose-the-next-setting) if routes collide, take too long, or use too many bends.
## Tune a run
[Choose a setting to try](docs/user/tune-and-troubleshoot.md#choose-the-next-setting) when a route is unfinished, too expensive, or slow.
<a id="moved-reference-sections"></a>
<a id="searchoptions"></a>
<a id="objectiveweights"></a>
<a id="congestionoptions"></a>
<a id="refinementoptions"></a>
<a id="topologyoptions"></a>
<a id="diagnosticsoptions"></a>
## API reference
[Look up public signatures, result fields, and option defaults](docs/user/api-reference.md).
- Look up the call and progress callback in the [`route()` signature](docs/user/api-reference.md#route-a-problem).
- Find the fields that describe arrival, collisions, and physical geometry in the [result reference](docs/user/api-reference.md#results).
- Check accepted values and defaults in the [option tables](docs/user/api-reference.md#options-and-defaults).
## Examples
[Browse the visual examples](examples/README.md) for locked paths, bend geometry, congestion, and partial results.
## Moved reference sections
- <a id="incremental-routing-with-locked-geometry"></a><a id="initial-paths-with-pathseed"></a>[Fixed routes and path seeds](docs/user/route-a-layout.md#reuse-an-existing-route)
- <a id="automatic-routing"></a>[Automatic routing and other modes](docs/user/tune-and-troubleshoot.md#choose-a-routing-mode)
- <a id="searchoptions"></a>[SearchOptions](docs/user/api-reference.md#searchoptions) and <a id="objectiveweights"></a>[ObjectiveWeights](docs/user/api-reference.md#objectiveweights)
- <a id="congestionoptions"></a>[CongestionOptions](docs/user/api-reference.md#congestionoptions) and <a id="refinementoptions"></a>[RefinementOptions](docs/user/api-reference.md#refinementoptions)
- <a id="topologyoptions"></a>[TopologyOptions](docs/user/api-reference.md#topologyoptions) and <a id="diagnosticsoptions"></a>[DiagnosticsOptions](docs/user/api-reference.md#diagnosticsoptions)
- See how bends, locks, and congestion affect individual routes in the [basic examples](examples/README.md).
- Compare the boards, ports, and verified results for multi-net layouts in the [advanced examples](examples/advanced.md).

View file

@ -2,13 +2,9 @@
Use Inire to connect fixed ports on a photonic or RF layout with straight segments, 90-degree bends, and S-bends. Supply the device placement, keepouts, and allowed bend radii. The router checks the finished geometry for clearance and returns partial paths to help you diagnose unfinished nets.
<a id="develop-inire"></a>
[User guide](DOCS.md) · [Developer guide](docs/development.md) · [Benchmarks](docs/benchmarks.md)
## Install
From a checkout with Python 3.11 or newer, run `pip install .`. For development, `uv sync` also installs the test and lint tools.
From a checkout with Python 3.11 or newer, run `pip install .`.
## Route a net
@ -37,14 +33,19 @@ else:
![A short solid waveguide connects the start at (50, 100) and target at (250, 100). Both port arrows point east.](docs/figures/first-route.png)
The example prints `200.0` in the layout's coordinate unit. Both ports have heading 0 because the path travels east at departure and arrival. The plot shows the area around the first route. [Read the result](docs/user/tune-and-troubleshoot.md#read-the-result)
The example prints `200.0` in the layout's coordinate unit. Both ports use heading 0 because the path leaves the source and enters the target travelling east. Use this result to try [exporting the physical path](docs/user/route-a-layout.md#export-verified-geometry).
## Route your own layout
- [Define your ports and keepouts](docs/user/route-a-layout.md), including access to preplaced crossing cells.
- [Choose what to try after a partial route](docs/user/tune-and-troubleshoot.md#why-a-net-stopped-short).
- [Browse visual examples](examples/README.md) of multi-net routing, locked paths, and bend geometry.
- For your own ports and keepouts, follow the [layout workflow](docs/user/route-a-layout.md#define-the-inputs).
- If a path stops short, work through the [partial route checks](docs/user/tune-and-troubleshoot.md#why-a-net-stopped-short).
- To find examples and look up fields as you work, use the [user guide](DOCS.md).
## Develop Inire
- To set up the development environment and find the relevant routing code, use the [developer guide](docs/development.md).
- To measure routing coverage, cost, or runtime, run the [routing benchmarks](docs/benchmarks.md).
## License
GNU Affero General Public License v3. [License text](LICENSE.md)
Inire is distributed under the [GNU Affero General Public License v3](LICENSE.md).

View file

@ -1,9 +1,29 @@
# Routing development archive
Historical plans, run captures, and raw measurements live here. For current workflows, start with the [developer guide](../../docs/development.md) or [benchmarks](../../docs/benchmarks.md).
Use these records to recover the rationale for a routing decision or compare a fresh capture with an earlier run.
- **Plans.** [Original routing goal](routing-policy-goal.md), [routing refactor plan](routing-refactor-plan.md), and [documentation improvement plan](documentation-improvement-plan.md).
- **Performance records.** [Example baseline](performance.md) and its [JSON](performance_baseline.json), [optimization log](optimization_pass_01_log.md), and [pair-local characterization](pair_local_characterization.md).
- **Recorded diagnostics.** [Iteration](iteration_trace.md), [conflict](conflict_trace.md), [frontier](frontier_trace.md), and [pre-pair](pre_pair_frontier_trace.md) traces. Each report has a companion JSON file with the raw data.
## Recover earlier decisions
The baseline comparison tool reads `archive/routing/performance_baseline.json` by default. Capture tools write here by default and replace files with the same name. Pass `--output-dir` for a scratch capture. [Capture and comparison commands](../../docs/routing-diagnostics.md#reproduce-and-compare)
- For the original coverage target and retry priorities, read the [routing policy goal](routing-policy-goal.md).
- For the reason a responsibility lives in a particular module, consult the [routing refactor plan](routing-refactor-plan.md).
- For the original audience and page split, see the [first documentation reorganization plan](documentation-improvement-plan.md).
## Reproduce probe and retry experiments
- To recover the measured probe and holdout tables from November 26, 2026, run `git show 2b02c6e:docs/topological-routing.md`.
- For the original retry triggers, budget sweeps, and authored Terminal-Bench lane comparisons, run `git show ea5cfe7:docs/topological-routing.md`. To rerun a retired policy, use that revision's driver in a separate worktree.
- To see how these experiments inform the current probe and retry policy, read the [measurement summary](../../docs/benchmark-results.md).
## Compare performance or diagnose a trace
| What to recover | Archive record |
| --- | --- |
| Example coverage and timings | [Baseline report](performance.md) with a [machine-readable snapshot](performance_baseline.json) for comparisons. |
| Work measured during the earlier optimization pass | [Optimization log](optimization_pass_01_log.md). |
| Conditions under which repair succeeds in the fan-out fixture | [Pair-local characterization](pair_local_characterization.md) with [per-case measurements](pair_local_characterization.json). |
| Work by net and iteration | [Iteration trace](iteration_trace.md). |
| Overlapping components before and after repair | [Conflict trace](conflict_trace.md). |
| Sampled prune reasons near remaining overlaps | [Frontier trace](frontier_trace.md). |
| Reroute order and work immediately before repair | [Pre-pair frontier trace](pre_pair_frontier_trace.md). |
Each trace report has a companion JSON file with the same basename. The baseline comparison tool reads `performance_baseline.json` from this directory by default. Capture tools also write here by default and replace files with the same name. To preserve an earlier record while running a fresh capture, follow the [scratch output commands](../../docs/routing-diagnostics.md#reproduce-and-compare).

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
# Conflict Trace
Generated at 2026-04-02T14:24:39-07:00 by `scripts/record_conflict_trace.py`.
Generated at 2026-11-26T21:47:32-08:00 by `scripts/record_conflict_trace.py`.
## example_07_large_scale_routing_no_warm_start
@ -10,8 +10,8 @@ Results: 10 valid / 10 reached / 10 total.
| :-- | --: | --: | --: | --: |
| iteration | 0 | 9 | 16 | 1 |
| iteration | 1 | 8 | 12 | 2 |
| iteration | 2 | 6 | 5 | 4 |
| iteration | 3 | 4 | 2 | 6 |
| iteration | 2 | 5 | 4 | 5 |
| iteration | 3 | 8 | 4 | 2 |
| iteration | 4 | 4 | 2 | 6 |
| iteration | 5 | 4 | 2 | 6 |
| restored_best | | 4 | 2 | 6 |
@ -21,37 +21,37 @@ Top nets by traced dynamic-collision stages:
- `net_06`: 7
- `net_07`: 7
- `net_01`: 6
- `net_00`: 5
- `net_02`: 5
- `net_03`: 4
- `net_08`: 2
- `net_09`: 2
- `net_02`: 7
- `net_03`: 6
- `net_00`: 4
- `net_01`: 4
- `net_08`: 3
- `net_09`: 3
- `net_05`: 1
Top net pairs by frequency:
- `net_06` <-> `net_07`: 7
- `net_00` <-> `net_01`: 5
- `net_01` <-> `net_02`: 4
- `net_02` <-> `net_03`: 6
- `net_00` <-> `net_01`: 4
- `net_00` <-> `net_02`: 3
- `net_00` <-> `net_03`: 3
- `net_02` <-> `net_03`: 3
- `net_01` <-> `net_02`: 3
- `net_08` <-> `net_09`: 3
- `net_00` <-> `net_03`: 2
- `net_01` <-> `net_03`: 2
- `net_06` <-> `net_08`: 2
- `net_06` <-> `net_09`: 2
- `net_07` <-> `net_08`: 2
Top component pairs by frequency:
- `net_06[2]` <-> `net_07[2]`: 6
- `net_06[3]` <-> `net_07[2]`: 6
- `net_06[2]` <-> `net_07[2]`: 6
- `net_06[1]` <-> `net_07[1]`: 6
- `net_02[2]` <-> `net_03[3]`: 5
- `net_02[1]` <-> `net_03[1]`: 5
- `net_02[2]` <-> `net_03[2]`: 5
- `net_06[2]` <-> `net_07[1]`: 5
- `net_00[2]` <-> `net_01[3]`: 4
- `net_02[1]` <-> `net_03[2]`: 4
- `net_01[2]` <-> `net_02[2]`: 3
- `net_01[2]` <-> `net_02[3]`: 3
- `net_00[2]` <-> `net_01[2]`: 3
- `net_07[3]` <-> `net_08[2]`: 2
- `net_02[1]` <-> `net_03[1]`: 2

View file

@ -1,79 +1,81 @@
{
"generated_at": "2026-04-02T14:24:39-07:00",
"generated_at": "2026-11-26T21:47:35-08:00",
"generator": "scripts/record_frontier_trace.py",
"scenarios": [
{
"frontier_trace": [],
"metrics": {
"congestion_cache_hits": 31,
"congestion_cache_misses": 4625,
"congestion_candidate_ids": 9924,
"congestion_candidate_nets": 9979,
"congestion_candidate_precheck_hits": 2562,
"congestion_candidate_precheck_misses": 2165,
"congestion_candidate_precheck_skips": 71,
"congestion_check_calls": 4625,
"congestion_exact_pair_checks": 8122,
"congestion_grid_net_cache_hits": 2457,
"congestion_grid_net_cache_misses": 3942,
"congestion_grid_span_cache_hits": 2283,
"congestion_grid_span_cache_misses": 1948,
"congestion_cache_hits": 24,
"congestion_cache_misses": 3411,
"congestion_candidate_ids": 7213,
"congestion_candidate_nets": 7410,
"congestion_candidate_precheck_hits": 1677,
"congestion_candidate_precheck_misses": 1795,
"congestion_candidate_precheck_skips": 37,
"congestion_check_calls": 3411,
"congestion_exact_pair_checks": 5860,
"congestion_grid_net_cache_hits": 1676,
"congestion_grid_net_cache_misses": 3276,
"congestion_grid_span_cache_hits": 1517,
"congestion_grid_span_cache_misses": 1637,
"congestion_lazy_requeues": 0,
"congestion_lazy_resolutions": 0,
"congestion_net_envelope_cache_hits": 2673,
"congestion_net_envelope_cache_misses": 4139,
"congestion_presence_cache_hits": 2858,
"congestion_presence_cache_misses": 2556,
"congestion_presence_skips": 687,
"danger_map_cache_hits": 16878,
"danger_map_cache_misses": 7425,
"danger_map_lookup_calls": 24303,
"danger_map_query_calls": 7425,
"danger_map_total_ns": 212814061,
"congestion_net_envelope_cache_hits": 1801,
"congestion_net_envelope_cache_misses": 3433,
"congestion_presence_cache_hits": 1857,
"congestion_presence_cache_misses": 2075,
"congestion_presence_skips": 460,
"danger_map_cache_hits": 13605,
"danger_map_cache_misses": 6252,
"danger_map_lookup_calls": 19857,
"danger_map_query_calls": 6252,
"danger_map_total_ns": 180793966,
"dynamic_grid_rebuilds": 0,
"dynamic_path_objects_added": 471,
"dynamic_path_objects_removed": 423,
"dynamic_path_objects_added": 430,
"dynamic_path_objects_removed": 384,
"dynamic_tree_rebuilds": 0,
"guidance_bonus_applied": 11000.0,
"guidance_bonus_applied_bend90": 3500.0,
"guidance_bonus_applied_sbend": 625.0,
"guidance_bonus_applied_straight": 6875.0,
"guidance_match_moves": 176,
"guidance_match_moves_bend90": 56,
"guidance_match_moves_sbend": 10,
"guidance_match_moves_straight": 110,
"guidance_bonus_applied": 3275.0,
"guidance_bonus_applied_bend90": 1075.0,
"guidance_bonus_applied_sbend": 200.0,
"guidance_bonus_applied_straight": 2000.0,
"guidance_match_moves": 131,
"guidance_match_moves_bend90": 43,
"guidance_match_moves_sbend": 8,
"guidance_match_moves_straight": 80,
"hard_collision_cache_hits": 0,
"iteration_conflict_edges": 39,
"iteration_conflicting_nets": 36,
"iteration_conflict_edges": 40,
"iteration_conflicting_nets": 39,
"iteration_reverified_nets": 60,
"iteration_reverify_calls": 6,
"move_cache_abs_hits": 2559,
"move_cache_abs_misses": 6494,
"move_cache_rel_hits": 5872,
"move_cache_rel_misses": 622,
"moves_added": 8081,
"moves_generated": 9053,
"nets_carried_forward": 0,
"nets_reached_target": 60,
"nets_routed": 60,
"nodes_expanded": 1764,
"late_phase_capped_fallbacks": 2,
"late_phase_capped_nets": 2,
"move_cache_abs_hits": 1831,
"move_cache_abs_misses": 5516,
"move_cache_rel_hits": 4926,
"move_cache_rel_misses": 590,
"moves_added": 6594,
"moves_generated": 7347,
"nets_carried_forward": 6,
"nets_reached_target": 52,
"nets_routed": 54,
"nodes_expanded": 1408,
"pair_local_search_accepts": 2,
"pair_local_search_attempts": 2,
"pair_local_search_nodes_expanded": 68,
"pair_local_search_attempts": 3,
"pair_local_search_nodes_expanded": 42,
"pair_local_search_pairs_considered": 2,
"path_cost_calls": 0,
"pruned_closed_set": 439,
"pruned_cost": 533,
"pruned_closed_set": 414,
"pruned_cost": 339,
"pruned_hard_collision": 0,
"ray_cast_calls": 5477,
"ray_cast_calls_expand_forward": 1704,
"ray_cast_calls_expand_snap": 46,
"ray_cast_calls": 4577,
"ray_cast_calls_expand_forward": 1356,
"ray_cast_calls_expand_snap": 36,
"ray_cast_calls_other": 0,
"ray_cast_calls_straight_static": 3721,
"ray_cast_calls_straight_static": 3179,
"ray_cast_calls_visibility_build": 0,
"ray_cast_calls_visibility_query": 0,
"ray_cast_calls_visibility_tangent": 6,
"ray_cast_candidate_bounds": 305,
"ray_cast_candidate_bounds": 162,
"ray_cast_exact_geometry_checks": 0,
"refine_path_calls": 10,
"refinement_candidate_side_extents": 0,
@ -84,17 +86,17 @@
"refinement_static_bounds_checked": 0,
"refinement_windows_considered": 0,
"route_iterations": 6,
"score_component_calls": 8634,
"score_component_total_ns": 241025335,
"score_component_calls": 6958,
"score_component_total_ns": 205362623,
"static_net_tree_rebuilds": 1,
"static_raw_tree_rebuilds": 1,
"static_safe_cache_hits": 2482,
"static_safe_cache_hits": 1778,
"static_tree_rebuilds": 1,
"timeout_events": 0,
"verify_dynamic_candidate_nets": 2106,
"verify_dynamic_exact_pair_checks": 558,
"verify_path_report_calls": 190,
"verify_static_buffer_ops": 895,
"verify_dynamic_candidate_nets": 1638,
"verify_dynamic_exact_pair_checks": 507,
"verify_path_report_calls": 152,
"verify_static_buffer_ops": 699,
"visibility_builds": 0,
"visibility_corner_hits_exact": 0,
"visibility_corner_index_builds": 1,
@ -105,7 +107,7 @@
"visibility_point_queries": 0,
"visibility_tangent_candidate_corner_checks": 6,
"visibility_tangent_candidate_ray_tests": 6,
"visibility_tangent_candidate_scans": 1704,
"visibility_tangent_candidate_scans": 1356,
"warm_start_paths_built": 0,
"warm_start_paths_used": 0
},

View file

@ -1,6 +1,6 @@
# Frontier Trace
Generated at 2026-04-02T14:24:39-07:00 by `scripts/record_frontier_trace.py`.
Generated at 2026-11-26T21:47:35-08:00 by `scripts/record_frontier_trace.py`.
## example_07_large_scale_routing_no_warm_start

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
# Iteration Trace
Generated at 2026-04-02T18:51:01-07:00 by `scripts/record_iteration_trace.py`.
Generated at 2026-11-26T21:47:40-08:00 by `scripts/record_iteration_trace.py`.
## example_07_large_scale_routing_no_warm_start
@ -9,36 +9,37 @@ Results: 10 valid / 10 reached / 10 total.
| Iteration | Penalty | Routed Nets | Completed | Conflict Edges | Dynamic Collisions | Nodes | Congestion Checks | Candidate Ids | Exact Pairs |
| --: | --: | --: | --: | --: | --: | --: | --: | --: | --: |
| 0 | 100.0 | 10 | 1 | 16 | 50 | 571 | 0 | 0 | 0 |
| 1 | 140.0 | 10 | 2 | 12 | 54 | 253 | 974 | 2378 | 1998 |
| 2 | 196.0 | 10 | 4 | 5 | 22 | 253 | 993 | 1928 | 1571 |
| 3 | 274.4 | 10 | 6 | 2 | 10 | 100 | 437 | 852 | 698 |
| 4 | 384.2 | 4 | 6 | 2 | 10 | 81 | 332 | 627 | 513 |
| 1 | 140.0 | 10 | 2 | 12 | 54 | 269 | 1074 | 2581 | 2150 |
| 2 | 196.0 | 10 | 5 | 4 | 18 | 244 | 980 | 1868 | 1539 |
| 3 | 274.4 | 10 | 2 | 4 | 20 | 95 | 483 | 977 | 749 |
| 4 | 384.2 | 10 | 6 | 2 | 10 | 196 | 703 | 1370 | 1137 |
| 5 | 537.8 | 4 | 6 | 2 | 10 | 33 | 171 | 417 | 285 |
Top nets by iteration-attributed nodes expanded:
- `net_09`: 242
- `net_00`: 201
- `net_02`: 157
- `net_06`: 155
- `net_01`: 147
- `net_08`: 144
- `net_03`: 141
- `net_07`: 45
- `net_04`: 13
- `net_05`: 13
- `net_09`: 249
- `net_03`: 217
- `net_00`: 213
- `net_08`: 159
- `net_02`: 158
- `net_06`: 151
- `net_01`: 129
- `net_07`: 91
- `net_04`: 21
- `net_05`: 20
Top nets by iteration-attributed congestion checks:
- `net_06`: 569
- `net_02`: 514
- `net_01`: 468
- `net_03`: 425
- `net_00`: 203
- `net_08`: 170
- `net_07`: 143
- `net_09`: 124
- `net_04`: 60
- `net_05`: 60
- `net_03`: 687
- `net_06`: 545
- `net_02`: 538
- `net_01`: 433
- `net_07`: 358
- `net_08`: 254
- `net_00`: 219
- `net_09`: 165
- `net_04`: 108
- `net_05`: 104
## example_07_large_scale_routing_no_warm_start_seed43
@ -47,35 +48,35 @@ Results: 10 valid / 10 reached / 10 total.
| Iteration | Penalty | Routed Nets | Completed | Conflict Edges | Dynamic Collisions | Nodes | Congestion Checks | Candidate Ids | Exact Pairs |
| --: | --: | --: | --: | --: | --: | --: | --: | --: | --: |
| 0 | 100.0 | 10 | 1 | 16 | 50 | 571 | 0 | 0 | 0 |
| 1 | 140.0 | 10 | 1 | 13 | 53 | 269 | 961 | 2562 | 2032 |
| 2 | 196.0 | 10 | 4 | 3 | 15 | 140 | 643 | 1610 | 1224 |
| 3 | 274.4 | 6 | 4 | 3 | 15 | 54 | 250 | 557 | 428 |
| 4 | 384.2 | 6 | 6 | 2 | 10 | 136 | 505 | 1025 | 829 |
| 1 | 140.0 | 10 | 1 | 13 | 53 | 281 | 1037 | 2807 | 2205 |
| 2 | 196.0 | 10 | 4 | 3 | 15 | 157 | 697 | 1678 | 1289 |
| 3 | 274.4 | 6 | 4 | 3 | 15 | 59 | 277 | 610 | 455 |
| 4 | 384.2 | 6 | 6 | 2 | 10 | 167 | 584 | 1201 | 958 |
| 5 | 537.8 | 4 | 6 | 2 | 10 | 33 | 171 | 419 | 287 |
Top nets by iteration-attributed nodes expanded:
- `net_09`: 250
- `net_03`: 199
- `net_00`: 177
- `net_08`: 166
- `net_09`: 248
- `net_03`: 219
- `net_00`: 176
- `net_08`: 168
- `net_07`: 140
- `net_06`: 105
- `net_02`: 79
- `net_06`: 130
- `net_02`: 97
- `net_01`: 65
- `net_05`: 12
- `net_04`: 10
- `net_05`: 13
- `net_04`: 12
Top nets by iteration-attributed congestion checks:
- `net_03`: 639
- `net_03`: 695
- `net_07`: 454
- `net_06`: 382
- `net_02`: 290
- `net_08`: 283
- `net_06`: 449
- `net_02`: 368
- `net_08`: 302
- `net_09`: 178
- `net_01`: 135
- `net_00`: 82
- `net_05`: 47
- `net_04`: 40
- `net_01`: 136
- `net_00`: 75
- `net_05`: 55
- `net_04`: 54

View file

@ -1,23 +1,21 @@
# Performance Baseline
Generated on 2026-04-02 by `scripts/record_performance_baseline.py`.
Generated on 2026-11-26 by `scripts/record_performance_baseline.py`.
The full machine-readable snapshot is in [performance_baseline.json](performance_baseline.json).
Use `scripts/diff_performance_baseline.py` to compare a fresh run against that snapshot.
The default table below intentionally excludes the heavier performance-only no-warm `example_07` canaries. Use `scripts/record_iteration_trace.py` and `scripts/record_pre_pair_frontier_trace.py` to inspect the late negotiated-congestion basin and pair-local handoff behavior for those scenarios.
| Scenario | Duration (s) | Total | Valid | Reached | Iter | Nets Routed | Nodes | Ray Casts | Moves Gen | Moves Added | Dyn Tree | Visibility Builds | Congestion Checks | Verify Calls |
| :-- | --: | --: | --: | --: | --: | --: | --: | --: | --: | --: | --: | --: | --: | --: |
| example_01_simple_route | 0.0037 | 1 | 1 | 1 | 1 | 1 | 2 | 10 | 11 | 7 | 0 | 0 | 0 | 5 |
| example_02_congestion_resolution | 0.3361 | 3 | 3 | 3 | 1 | 3 | 366 | 1164 | 1413 | 668 | 0 | 0 | 0 | 41 |
| example_03_locked_paths | 0.1877 | 2 | 2 | 2 | 2 | 2 | 191 | 657 | 904 | 307 | 0 | 0 | 0 | 18 |
| example_04_sbends_and_radii | 0.0269 | 2 | 2 | 2 | 1 | 2 | 15 | 70 | 123 | 65 | 0 | 0 | 0 | 10 |
| example_05_orientation_stress | 0.2311 | 3 | 3 | 3 | 2 | 5 | 297 | 1274 | 1680 | 689 | 0 | 0 | 146 | 20 |
| example_06_bend_collision_models | 0.1988 | 3 | 3 | 3 | 3 | 3 | 240 | 682 | 1026 | 629 | 0 | 0 | 0 | 15 |
| example_07_large_scale_routing | 0.2088 | 10 | 10 | 10 | 1 | 10 | 78 | 383 | 372 | 227 | 0 | 0 | 0 | 50 |
| example_08_custom_bend_geometry | 0.0177 | 2 | 2 | 2 | 2 | 2 | 18 | 56 | 78 | 56 | 0 | 0 | 0 | 10 |
| example_09_unroutable_best_effort | 0.0057 | 1 | 0 | 0 | 1 | 1 | 3 | 13 | 16 | 10 | 0 | 0 | 0 | 1 |
| example_01_simple_route | 0.0043 | 1 | 1 | 1 | 1 | 1 | 2 | 10 | 11 | 7 | 0 | 0 | 0 | 4 |
| example_02_congestion_resolution | 0.2541 | 3 | 3 | 3 | 1 | 3 | 366 | 1164 | 1413 | 668 | 0 | 0 | 0 | 16 |
| example_03_locked_paths | 0.1476 | 2 | 2 | 2 | 2 | 2 | 191 | 657 | 904 | 307 | 0 | 0 | 0 | 10 |
| example_04_sbends_and_radii | 0.0222 | 2 | 2 | 2 | 1 | 2 | 15 | 70 | 123 | 65 | 0 | 0 | 0 | 8 |
| example_05_orientation_stress | 0.1878 | 3 | 3 | 3 | 2 | 5 | 284 | 1237 | 1617 | 673 | 0 | 0 | 151 | 17 |
| example_06_bend_collision_models | 0.1732 | 3 | 3 | 3 | 3 | 3 | 240 | 682 | 1026 | 629 | 0 | 0 | 0 | 12 |
| example_07_large_scale_routing | 0.1869 | 10 | 10 | 10 | 1 | 10 | 78 | 383 | 372 | 227 | 0 | 0 | 0 | 40 |
| example_08_custom_bend_geometry | 0.0154 | 2 | 2 | 2 | 2 | 2 | 18 | 56 | 78 | 56 | 0 | 0 | 0 | 8 |
| example_09_unroutable_best_effort | 0.0053 | 1 | 0 | 0 | 1 | 1 | 3 | 13 | 16 | 10 | 0 | 0 | 0 | 1 |
## Full Counter Set

View file

@ -1,9 +1,9 @@
{
"generated_on": "2026-04-02",
"generated_on": "2026-11-26",
"generator": "scripts/record_performance_baseline.py",
"scenarios": [
{
"duration_s": 0.003715757979080081,
"duration_s": 0.004303620080463588,
"metrics": {
"congestion_cache_hits": 0,
"congestion_cache_misses": 0,
@ -87,7 +87,7 @@
"refinement_windows_considered": 0,
"route_iterations": 1,
"score_component_calls": 11,
"score_component_total_ns": 16864,
"score_component_total_ns": 16362,
"static_net_tree_rebuilds": 1,
"static_raw_tree_rebuilds": 0,
"static_safe_cache_hits": 1,
@ -95,7 +95,7 @@
"timeout_events": 0,
"verify_dynamic_candidate_nets": 0,
"verify_dynamic_exact_pair_checks": 0,
"verify_path_report_calls": 5,
"verify_path_report_calls": 4,
"verify_static_buffer_ops": 0,
"visibility_builds": 0,
"visibility_corner_hits_exact": 0,
@ -117,7 +117,7 @@
"valid_results": 1
},
{
"duration_s": 0.33605348505079746,
"duration_s": 0.2540899380110204,
"metrics": {
"congestion_cache_hits": 0,
"congestion_cache_misses": 0,
@ -177,7 +177,7 @@
"pair_local_search_attempts": 0,
"pair_local_search_nodes_expanded": 0,
"pair_local_search_pairs_considered": 0,
"path_cost_calls": 14,
"path_cost_calls": 30,
"pruned_closed_set": 157,
"pruned_cost": 208,
"pruned_hard_collision": 380,
@ -194,22 +194,22 @@
"refine_path_calls": 3,
"refinement_candidate_side_extents": 26,
"refinement_candidates_accepted": 2,
"refinement_candidates_built": 26,
"refinement_candidates_verified": 26,
"refinement_candidates_built": 2,
"refinement_candidates_verified": 2,
"refinement_dynamic_bounds_checked": 20,
"refinement_static_bounds_checked": 0,
"refinement_windows_considered": 10,
"refinement_windows_considered": 4,
"route_iterations": 1,
"score_component_calls": 976,
"score_component_total_ns": 1109505,
"score_component_calls": 1088,
"score_component_total_ns": 1136950,
"static_net_tree_rebuilds": 3,
"static_raw_tree_rebuilds": 0,
"static_safe_cache_hits": 1,
"static_tree_rebuilds": 2,
"timeout_events": 0,
"verify_dynamic_candidate_nets": 92,
"verify_dynamic_exact_pair_checks": 90,
"verify_path_report_calls": 41,
"verify_dynamic_candidate_nets": 14,
"verify_dynamic_exact_pair_checks": 12,
"verify_path_report_calls": 16,
"verify_static_buffer_ops": 0,
"visibility_builds": 0,
"visibility_corner_hits_exact": 0,
@ -231,7 +231,7 @@
"valid_results": 3
},
{
"duration_s": 0.18771230895072222,
"duration_s": 0.14755904604680836,
"metrics": {
"congestion_cache_hits": 0,
"congestion_cache_misses": 0,
@ -291,7 +291,7 @@
"pair_local_search_attempts": 0,
"pair_local_search_nodes_expanded": 0,
"pair_local_search_pairs_considered": 0,
"path_cost_calls": 9,
"path_cost_calls": 10,
"pruned_closed_set": 97,
"pruned_cost": 140,
"pruned_hard_collision": 181,
@ -308,23 +308,23 @@
"refine_path_calls": 2,
"refinement_candidate_side_extents": 8,
"refinement_candidates_accepted": 1,
"refinement_candidates_built": 8,
"refinement_candidates_verified": 8,
"refinement_dynamic_bounds_checked": 2,
"refinement_candidates_built": 1,
"refinement_candidates_verified": 1,
"refinement_dynamic_bounds_checked": 0,
"refinement_static_bounds_checked": 2,
"refinement_windows_considered": 2,
"route_iterations": 2,
"score_component_calls": 504,
"score_component_total_ns": 546567,
"score_component_calls": 510,
"score_component_total_ns": 550707,
"static_net_tree_rebuilds": 2,
"static_raw_tree_rebuilds": 1,
"static_safe_cache_hits": 1,
"static_tree_rebuilds": 1,
"timeout_events": 0,
"verify_dynamic_candidate_nets": 10,
"verify_dynamic_exact_pair_checks": 10,
"verify_path_report_calls": 18,
"verify_static_buffer_ops": 90,
"verify_dynamic_candidate_nets": 0,
"verify_dynamic_exact_pair_checks": 0,
"verify_path_report_calls": 10,
"verify_static_buffer_ops": 48,
"visibility_builds": 0,
"visibility_corner_hits_exact": 0,
"visibility_corner_index_builds": 2,
@ -345,7 +345,7 @@
"valid_results": 2
},
{
"duration_s": 0.026945222169160843,
"duration_s": 0.022167235030792654,
"metrics": {
"congestion_cache_hits": 0,
"congestion_cache_misses": 0,
@ -429,15 +429,15 @@
"refinement_windows_considered": 0,
"route_iterations": 1,
"score_component_calls": 90,
"score_component_total_ns": 97710,
"score_component_total_ns": 98717,
"static_net_tree_rebuilds": 2,
"static_raw_tree_rebuilds": 0,
"static_safe_cache_hits": 1,
"static_tree_rebuilds": 1,
"timeout_events": 0,
"verify_dynamic_candidate_nets": 12,
"verify_dynamic_candidate_nets": 9,
"verify_dynamic_exact_pair_checks": 0,
"verify_path_report_calls": 10,
"verify_path_report_calls": 8,
"verify_static_buffer_ops": 0,
"visibility_builds": 0,
"visibility_corner_hits_exact": 0,
@ -459,28 +459,28 @@
"valid_results": 2
},
{
"duration_s": 0.23108969815075397,
"duration_s": 0.18780142499599606,
"metrics": {
"congestion_cache_hits": 3,
"congestion_cache_misses": 146,
"congestion_candidate_ids": 32,
"congestion_candidate_nets": 23,
"congestion_candidate_precheck_hits": 129,
"congestion_candidate_precheck_misses": 20,
"congestion_cache_hits": 1,
"congestion_cache_misses": 151,
"congestion_candidate_ids": 19,
"congestion_candidate_nets": 15,
"congestion_candidate_precheck_hits": 133,
"congestion_candidate_precheck_misses": 19,
"congestion_candidate_precheck_skips": 0,
"congestion_check_calls": 146,
"congestion_exact_pair_checks": 30,
"congestion_grid_net_cache_hits": 16,
"congestion_grid_net_cache_misses": 26,
"congestion_grid_span_cache_hits": 15,
"congestion_grid_span_cache_misses": 7,
"congestion_check_calls": 151,
"congestion_exact_pair_checks": 18,
"congestion_grid_net_cache_hits": 12,
"congestion_grid_net_cache_misses": 22,
"congestion_grid_span_cache_hits": 11,
"congestion_grid_span_cache_misses": 4,
"congestion_lazy_requeues": 0,
"congestion_lazy_resolutions": 0,
"congestion_net_envelope_cache_hits": 127,
"congestion_net_envelope_cache_misses": 39,
"congestion_presence_cache_hits": 196,
"congestion_presence_cache_misses": 27,
"congestion_presence_skips": 74,
"congestion_net_envelope_cache_hits": 133,
"congestion_net_envelope_cache_misses": 37,
"congestion_presence_cache_hits": 181,
"congestion_presence_cache_misses": 26,
"congestion_presence_skips": 55,
"danger_map_cache_hits": 0,
"danger_map_cache_misses": 0,
"danger_map_lookup_calls": 0,
@ -490,12 +490,12 @@
"dynamic_path_objects_added": 48,
"dynamic_path_objects_removed": 36,
"dynamic_tree_rebuilds": 0,
"guidance_bonus_applied": 562.5,
"guidance_bonus_applied_bend90": 500.0,
"guidance_bonus_applied": 100.0,
"guidance_bonus_applied_bend90": 87.5,
"guidance_bonus_applied_sbend": 0.0,
"guidance_bonus_applied_straight": 62.5,
"guidance_match_moves": 9,
"guidance_match_moves_bend90": 8,
"guidance_bonus_applied_straight": 12.5,
"guidance_match_moves": 8,
"guidance_match_moves_bend90": 7,
"guidance_match_moves_sbend": 0,
"guidance_match_moves_straight": 1,
"hard_collision_cache_hits": 0,
@ -505,29 +505,29 @@
"iteration_reverify_calls": 2,
"late_phase_capped_fallbacks": 0,
"late_phase_capped_nets": 0,
"move_cache_abs_hits": 374,
"move_cache_abs_misses": 1306,
"move_cache_rel_hits": 1204,
"move_cache_abs_hits": 249,
"move_cache_abs_misses": 1368,
"move_cache_rel_hits": 1266,
"move_cache_rel_misses": 102,
"moves_added": 689,
"moves_generated": 1680,
"moves_added": 673,
"moves_generated": 1617,
"nets_carried_forward": 1,
"nets_reached_target": 5,
"nets_routed": 5,
"nodes_expanded": 297,
"nodes_expanded": 284,
"pair_local_search_accepts": 0,
"pair_local_search_attempts": 0,
"pair_local_search_nodes_expanded": 0,
"pair_local_search_pairs_considered": 0,
"path_cost_calls": 2,
"pruned_closed_set": 159,
"pruned_cost": 533,
"pruned_closed_set": 140,
"pruned_cost": 505,
"pruned_hard_collision": 14,
"ray_cast_calls": 1274,
"ray_cast_calls_expand_forward": 292,
"ray_cast_calls": 1237,
"ray_cast_calls_expand_forward": 279,
"ray_cast_calls_expand_snap": 2,
"ray_cast_calls_other": 0,
"ray_cast_calls_straight_static": 971,
"ray_cast_calls_straight_static": 947,
"ray_cast_calls_visibility_build": 0,
"ray_cast_calls_visibility_query": 0,
"ray_cast_calls_visibility_tangent": 9,
@ -542,16 +542,16 @@
"refinement_static_bounds_checked": 0,
"refinement_windows_considered": 0,
"route_iterations": 2,
"score_component_calls": 1234,
"score_component_total_ns": 1223569,
"score_component_calls": 1190,
"score_component_total_ns": 1157917,
"static_net_tree_rebuilds": 3,
"static_raw_tree_rebuilds": 0,
"static_safe_cache_hits": 8,
"static_safe_cache_hits": 2,
"static_tree_rebuilds": 1,
"timeout_events": 0,
"verify_dynamic_candidate_nets": 8,
"verify_dynamic_exact_pair_checks": 12,
"verify_path_report_calls": 20,
"verify_path_report_calls": 17,
"verify_static_buffer_ops": 0,
"visibility_builds": 0,
"visibility_corner_hits_exact": 0,
@ -563,7 +563,7 @@
"visibility_point_queries": 0,
"visibility_tangent_candidate_corner_checks": 70,
"visibility_tangent_candidate_ray_tests": 9,
"visibility_tangent_candidate_scans": 292,
"visibility_tangent_candidate_scans": 279,
"warm_start_paths_built": 2,
"warm_start_paths_used": 2
},
@ -573,7 +573,7 @@
"valid_results": 3
},
{
"duration_s": 0.19879506202414632,
"duration_s": 0.17324819299392402,
"metrics": {
"congestion_cache_hits": 0,
"congestion_cache_misses": 0,
@ -599,7 +599,7 @@
"danger_map_cache_misses": 731,
"danger_map_lookup_calls": 1914,
"danger_map_query_calls": 731,
"danger_map_total_ns": 19050142,
"danger_map_total_ns": 18539700,
"dynamic_grid_rebuilds": 0,
"dynamic_path_objects_added": 54,
"dynamic_path_objects_removed": 36,
@ -645,7 +645,7 @@
"ray_cast_calls_visibility_build": 0,
"ray_cast_calls_visibility_query": 0,
"ray_cast_calls_visibility_tangent": 34,
"ray_cast_candidate_bounds": 97,
"ray_cast_candidate_bounds": 88,
"ray_cast_exact_geometry_checks": 0,
"refine_path_calls": 3,
"refinement_candidate_side_extents": 0,
@ -657,7 +657,7 @@
"refinement_windows_considered": 0,
"route_iterations": 3,
"score_component_calls": 842,
"score_component_total_ns": 21353240,
"score_component_total_ns": 20771160,
"static_net_tree_rebuilds": 3,
"static_raw_tree_rebuilds": 3,
"static_safe_cache_hits": 141,
@ -665,8 +665,8 @@
"timeout_events": 0,
"verify_dynamic_candidate_nets": 0,
"verify_dynamic_exact_pair_checks": 0,
"verify_path_report_calls": 15,
"verify_static_buffer_ops": 90,
"verify_path_report_calls": 12,
"verify_static_buffer_ops": 72,
"visibility_builds": 0,
"visibility_corner_hits_exact": 0,
"visibility_corner_index_builds": 3,
@ -687,7 +687,7 @@
"valid_results": 3
},
{
"duration_s": 0.20880168909206986,
"duration_s": 0.18685018795076758,
"metrics": {
"congestion_cache_hits": 0,
"congestion_cache_misses": 0,
@ -713,7 +713,7 @@
"danger_map_cache_misses": 448,
"danger_map_lookup_calls": 681,
"danger_map_query_calls": 448,
"danger_map_total_ns": 11025527,
"danger_map_total_ns": 10856837,
"dynamic_grid_rebuilds": 0,
"dynamic_path_objects_added": 132,
"dynamic_path_objects_removed": 88,
@ -771,16 +771,16 @@
"refinement_windows_considered": 0,
"route_iterations": 1,
"score_component_calls": 291,
"score_component_total_ns": 11875928,
"score_component_total_ns": 11698395,
"static_net_tree_rebuilds": 10,
"static_raw_tree_rebuilds": 1,
"static_safe_cache_hits": 6,
"static_tree_rebuilds": 10,
"timeout_events": 0,
"verify_dynamic_candidate_nets": 476,
"verify_dynamic_exact_pair_checks": 72,
"verify_path_report_calls": 50,
"verify_static_buffer_ops": 220,
"verify_dynamic_candidate_nets": 370,
"verify_dynamic_exact_pair_checks": 56,
"verify_path_report_calls": 40,
"verify_static_buffer_ops": 176,
"visibility_builds": 0,
"visibility_corner_hits_exact": 0,
"visibility_corner_index_builds": 10,
@ -801,7 +801,7 @@
"valid_results": 10
},
{
"duration_s": 0.017696003895252943,
"duration_s": 0.0154108009301126,
"metrics": {
"congestion_cache_hits": 0,
"congestion_cache_misses": 0,
@ -885,7 +885,7 @@
"refinement_windows_considered": 0,
"route_iterations": 2,
"score_component_calls": 72,
"score_component_total_ns": 87742,
"score_component_total_ns": 82036,
"static_net_tree_rebuilds": 2,
"static_raw_tree_rebuilds": 0,
"static_safe_cache_hits": 2,
@ -893,7 +893,7 @@
"timeout_events": 0,
"verify_dynamic_candidate_nets": 0,
"verify_dynamic_exact_pair_checks": 0,
"verify_path_report_calls": 10,
"verify_path_report_calls": 8,
"verify_static_buffer_ops": 0,
"visibility_builds": 0,
"visibility_corner_hits_exact": 0,
@ -915,7 +915,7 @@
"valid_results": 2
},
{
"duration_s": 0.005660973023623228,
"duration_s": 0.005300503107719123,
"metrics": {
"congestion_cache_hits": 0,
"congestion_cache_misses": 0,
@ -941,7 +941,7 @@
"danger_map_cache_misses": 20,
"danger_map_lookup_calls": 30,
"danger_map_query_calls": 20,
"danger_map_total_ns": 515133,
"danger_map_total_ns": 510754,
"dynamic_grid_rebuilds": 0,
"dynamic_path_objects_added": 2,
"dynamic_path_objects_removed": 1,
@ -999,7 +999,7 @@
"refinement_windows_considered": 0,
"route_iterations": 1,
"score_component_calls": 14,
"score_component_total_ns": 554809,
"score_component_total_ns": 551521,
"static_net_tree_rebuilds": 1,
"static_raw_tree_rebuilds": 1,
"static_safe_cache_hits": 0,

File diff suppressed because it is too large Load diff

View file

@ -1,25 +1,25 @@
# Pre-Pair Frontier Trace
Generated at 2026-04-02T18:51:01-07:00 by `scripts/record_pre_pair_frontier_trace.py`.
Generated at 2026-11-26T21:47:45-08:00 by `scripts/record_pre_pair_frontier_trace.py`.
## example_07_large_scale_routing_no_warm_start
Results: 10 valid / 10 reached / 10 total.
Captured iteration: `4`
Captured iteration: `5`
Conflict edges: `(('net_01', 'net_02'), ('net_06', 'net_07'))`
Conflict edges: `(('net_02', 'net_03'), ('net_06', 'net_07'))`
| Net | Nodes | Checks | Closed-Set | Cost | Hard Collision | Guidance Seed | Frontier Samples |
| :-- | --: | --: | --: | --: | --: | :--: | --: |
| net_07 | 7 | 30 | 1 | 0 | 0 | yes | 0 |
| net_06 | 46 | 179 | 7 | 15 | 0 | yes | 5 |
| net_00 | 10 | 43 | 1 | 0 | 0 | yes | 0 |
| net_01 | 18 | 80 | 3 | 0 | 0 | yes | 0 |
| net_07 | 16 | 85 | 3 | 0 | 0 | yes | 2 |
| net_02 | 17 | 86 | 4 | 0 | 0 | yes | 3 |
| net_06 | 0 | 0 | 0 | 0 | 0 | yes | 10 |
| net_03 | 0 | 0 | 0 | 0 | 0 | yes | 16 |
Frontier prune totals by reason:
- `closed_set`: 5
- `closed_set`: 31
- `hard_collision`: 0
- `self_collision`: 0
- `cost`: 0
@ -36,12 +36,12 @@ Conflict edges: `(('net_02', 'net_03'), ('net_06', 'net_07'))`
| :-- | --: | --: | --: | --: | --: | :--: | --: |
| net_07 | 16 | 85 | 3 | 0 | 0 | yes | 2 |
| net_02 | 17 | 86 | 4 | 0 | 0 | yes | 3 |
| net_06 | 0 | 0 | 0 | 0 | 0 | yes | 8 |
| net_03 | 0 | 0 | 0 | 0 | 0 | yes | 12 |
| net_06 | 0 | 0 | 0 | 0 | 0 | yes | 10 |
| net_03 | 0 | 0 | 0 | 0 | 0 | yes | 14 |
Frontier prune totals by reason:
- `closed_set`: 25
- `closed_set`: 29
- `hard_collision`: 0
- `self_collision`: 0
- `cost`: 0

View file

@ -0,0 +1,66 @@
# 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).

View file

@ -1,48 +1,52 @@
# Router architecture
Start with the stage that chooses the route, then inspect the worker that produced it. The public `route()` entry point runs one worker for an explicit mode. Automatic mode can run several. Each worker sees the obstacles, locks, and seed hints passed to it. [Public API](user/api-reference.md) · [Worker setup](../inire/router/_stack.py)
An explicit routing mode runs one worker. Automatic routing can run several and compare their results. To follow how the worker gets its obstacles, locks, and seed hints, start at [`route_once()`](../inire/router/_stack.py#L71).
## Automatic routing
![Automatic routing sets a bound, then constructs, probes, widens, and recovers while below it. Verified candidates feed selection. The chosen layout can be refined before it is returned.](figures/automatic-stages.png)
The diagram shows the usual sequence for arc bends. A verified layout can reach the routing target early. When attempts run out, selection keeps the best verified coverage found. Custom physical bends, polygonal proxies, or missing constrained triangulation take a lattice-only path.
Follow the left column down while the run is below its coverage target. Move right to selection when a verified candidate reaches that target or the attempts run out. Custom physical bends, polygonal proxies, and layouts routed without constrained triangulation take a lattice-only path.
1. **Establish a stopping target.** Each disjoint pair of incompatible fixed ports rules out one route. For supported rectangular cuts, the capacity check uses the narrowest guide to bound how many paths fit through each opening. Reaching one of these bounds can justify stopping with partial coverage. Keep those bounds separate from estimates such as corridor occupancy or a failed attempt. [Capacity checks](../inire/router/_capacity.py)
2. **Exploit layout structure before search.** Bundles place ordered tracks through barriers. Column schedules assign tracks to openings and stagger turns between them. Compact planners fit local connections between constrained ports. A schedule supplies seeds to the ordinary verifier. This lets the planner make cheap geometric proposals while the verifier checks the resulting physical paths. [Bundles](../inire/router/_bundle.py) · [Columns](../inire/router/_columns.py) · [Compact planners](../inire/router/_compact.py)
3. **Probe cheaply before spending the wider budget.** Direct trials can lock verified straight links and search for the remaining nets. A change in lock order or a small unlocked probe can free a nearby turn. The near-port stage uses up to 100 nodes per search and two congestion iterations for the arc proxy. Alternate proxies use the configured iteration limit because another shallow iteration can find a path the wider retry misses or finds at higher cost. The wider lookahead uses up to 500 nodes and the configured iteration limit. Both respect smaller caller limits. Guide and column attempts can precede the probe when the geometry makes them promising. [Stage order](../inire/router/_automatic.py) · [Direct trials](../inire/router/_routing_policy.py)
4. **Choose what to keep fixed.** If the remaining ports are still connected with verified paths locked, route the unresolved nets around those paths. If locks disconnect the residual, use movable seed hints so the next search can move an incumbent. A residual with several nets sharing a portal can benefit from a different lane assignment. When those attempts stall, seed and lattice workers can search the whole layout. A final lattice retry can use the caller's ceiling. [Residual routing](../inire/router/_automatic.py) · [Corridors and lanes](topological-routing.md#corridor-planning-and-realization)
5. **Accept a checked layout.** Compare verified coverage first. Cost breaks ties between candidates with identical verified IDs. A complete locked layout or an improving joint retry must pass its required whole-layout check before selection. Refinement is also a candidate replacement and must preserve the verified ID set. [Trial selection](../inire/router/_routing_policy.py)
1. **Set the coverage target.** Each disjoint pair of incompatible fixed ports rules out one route. At supported rectangular cuts, compute how many paths of the narrowest width can fit through the openings. To change which cuts can establish an upper bound, start with [`cut_capacity()`](../inire/router/_capacity.py#L27).
2. **Try constructive planners.** Bundles assign ordered tracks through barriers. Column schedules place turns between openings. Compact planners fit short connections between constrained ports. Each produces seeds whose physical geometry the worker checks.
3. **Start with a small search budget.** Lock verified straight links and search for the remaining nets. A different lock order or a small unlocked probe can free room for a turn. Promising guide and column attempts can run first.
4. **Decide what to keep fixed.** If the remaining ports are connected, route around the locked geometry. If the locks disconnect them, pass the incumbents as movable seeds. A joint retry can assign different lanes through a shared portal. If recovery stalls, seed and lattice attempts can search the whole layout, with a final lattice retry up to the caller's ceiling.
5. **Select a verified layout.** Prefer greater coverage and compare cost on identical verified net sets. A complete locked layout or an improving joint retry must pass its whole-layout check before selection. To see how a refined candidate must preserve the verified net set, follow [the refinement handoff](../inire/router/_automatic.py#L581).
The near-port attempt uses up to 100 nodes per search and two congestion iterations with the arc proxy. Alternate proxies use the configured iteration limit because a later shallow iteration can find a cheaper path. Wider lookahead uses up to 500 nodes per search and the configured iteration limit. Follow the caps and early exits in [the initial search trials](../inire/router/_automatic.py#L480).
### Example of a poor lock
1. A straight trunk in `stress-retry-straight-decoy` fits on its own. Once locked, it divides the board and blocks two perpendicular nets.
2. The probe can keep the branches and lower rail. A four-turn dogleg completes the trunk around them before wider search.
3. If you change lock ordering or acceptance, check that all four nets still verify together. [Fixture](../inire/tests/stress_routing_benchmarks.py) · [Choose a benchmark](benchmarks.md#choose-a-case)
3. If you change lock ordering or acceptance, run the [single-case benchmark command](benchmarks.md#run-a-benchmark) with `--case stress-retry-straight-decoy`. Check that all four nets still verify and compare which stage finishes the trunk.
## Detailed search and congestion
- **Build and admit moves.** Weighted A* searches snapped positions and headings. Rays, visible corners, and corridor waypoints propose straight endpoints. Admission checks clearance, cost, and state dominance. A move-generation change can help a net reach its target at the same node budget. [Moves](../inire/router/_astar_moves.py) · [Admission](../inire/router/_astar_admission.py) · [Search](../inire/router/_search.py)
- **Build and admit moves.** Weighted A* searches snapped positions and headings. Rays, visible corners, and corridor waypoints propose straight endpoints. Admission checks clearance, cost, and state dominance. To understand which endpoints a net can reach within the same node budget, start with [move generation](../inire/router/_astar_moves.py).
- **Recheck the installed set.** The congestion driver replaces paths in routing order and raises the overlap penalty between unresolved iterations. A later route can collide with one completed earlier, so the driver verifies the installed set. It ranks snapshots by completed nets, then by conflicts and dynamic collisions. [Routing loop](../inire/router/_router.py) · [Congestion policy](../inire/router/_congestion_policy.py)
- **Recheck the installed set.** The driver raises the overlap penalty when successive routes collide. After an iteration it verifies the installed paths, since a later route can collide with one completed earlier. It ranks snapshots by completed nets, then by conflicts and dynamic collisions. To see when it reroutes just the conflicting nets, read [`next_reroute_net_ids()`](../inire/router/_congestion_policy.py#L93).
- **Repair a small conflict set.** Late iterations can focus on conflicting nets. The driver restores its best iteration before attempting pair-local repair. It keeps the geometry outside an eligible pair fixed, can try either routing order, and checks the proposed replacement in the live world. [Pair-local search](../inire/router/_pair_local.py) · [Read an iteration trace](routing-diagnostics.md#traces)
- **Repair a small conflict set.** The driver restores its best iteration and verifies it once for diagnostics and target selection. Pair-local search keeps the geometry outside an eligible pair fixed and can try either routing order. The driver checks replacements in the live world. To compare the restored set with the repaired paths, [follow a late conflict](routing-diagnostics.md#follow-a-late-conflict-into-pair-local-repair).
## Geometry and refinement
Search proxies help reject candidates cheaply. Final verification checks physical clearance, self-collisions, and automatic board containment. A mitred obstacle buffer can flag a candidate near a corner even when the physical distance meets clearance. The exact distance check resolves those cases. When changing a broad phase, keep boundary-touching and custom-shape fixtures alongside ordinary rectangle cases. [Collision world](../inire/geometry/collision.py) · [Collision tests](../inire/tests/test_collision.py)
Search proxies help reject candidates cheaply. Final verification checks physical clearance, self-collisions, and automatic board containment. A mitred buffer can flag a candidate near a corner even when physical distance meets clearance. The exact distance check resolves those cases. To test changes to the broad phase, use the boundary-touching and custom-shape cases in the [collision tests](../inire/tests/test_collision.py).
Use timings to decide which geometry work to inspect. Ray counts can point to repeated visibility queries. Congestion candidate counts and exact pair checks can reveal an overly broad dynamic lookup. Compare checks at similar expansion counts before changing the index. [Geometry workload diagnostics](routing-diagnostics.md#route-metrics)
When expansion counts are similar but routing time rises, inspect ray casts for repeated visibility queries and exact pair checks for an overly broad dynamic lookup. The [metrics guide](routing-diagnostics.md#route-metrics) maps those questions to counters.
Refinement looks for cheaper replacements in windows of a completed path. With a finite budget above one window, it prioritizes bend-ended windows so it can try removing expensive turns early. One-window and unlimited runs use longest-first ordering. Candidate scoring precedes polygon construction. A local replacement check relies on the unchanged route and other paths still being valid in the current world. The final check covers the installed result. [Refiner](../inire/router/refiner.py)
Refinement scores replacement windows before constructing their polygons. Finite budgets above one window prioritize bend-ended windows to give expensive turns an early chance to be replaced. One-window and unlimited runs try the longest windows first. Local checks rely on the rest of the route and the other installed paths being valid. Final verification checks the installed result.
## Validate a change
| Change | What to demonstrate |
| --- | --- |
| Stage order, locks, or budgets | Which attempt wins, which net IDs and paths it keeps, and whether skipped work reappears in a later attempt. Include tight passages and preplaced crossings. |
| Collision or cache behavior | Identical clearance and boundary decisions for physical and proxy shapes. Compare candidate counts and exact checks along with time. |
| Congestion, seeds, or pair-local repair | Coverage and conflict evolution at iteration boundaries, plus the final installed geometry after repair. |
| Cost or refinement | Equal verified ID sets before comparing per-net lengths or costs. Check that the improvement survives whole-layout verification. |
| If you change | What to check | Where to start |
| --- | --- | --- |
| Stage order or budgets | Which stage wins and whether work reappears in a later attempt. Include tight passages and preplaced crossings. | [Automatic routing](../inire/router/_automatic.py) |
| Locks or candidate acceptance | The verified IDs and their paths after the complete layout is checked. | [Direct trials and selection](../inire/router/_routing_policy.py) |
| Corridor or seed allocation | Coverage through shared openings and search work when a corridor reaches the wrong lane or leaves too little turn room. | [Corridor planning and realization](topological-routing.md#corridor-planning-and-realization) |
| Collision or caching | Clearance and boundary decisions for both physical and proxy shapes. Compare candidate counts and exact checks along with time. | [Collision world](../inire/geometry/collision.py) |
| Pair-local repair | Coverage and conflict edges before repair, plus the final installed geometry. | [Pair-local search](../inire/router/_pair_local.py) |
| Cost or refinement | Per-net costs on equal verified ID sets and validity after the final check. | [Path refinement](../inire/router/refiner.py) |
Use [benchmark profiles](benchmarks.md#choose-a-profile) for policy comparisons and [exact parity](routing-diagnostics.md#reproduce-and-compare) for behavior-preserving changes.

View file

@ -1,16 +1,20 @@
# Benchmark fixtures
Use the checked-in inputs to repeat a routing comparison offline. The fixture catalogue gives the geometry, options, and expected bound for each case. [Choose a case and profile](benchmarks.md#choose-a-case) · [Fixture catalogue](../inire/tests/routing_corpus.py)
Start with a board that exercises the behavior you want to measure. Use the [case guide](benchmarks.md#choose-a-case) to select it or the [corpus registry](../inire/tests/routing_corpus.py) to find its groups and effective profile settings.
## Automatic nine-net Terminal-Bench routing
Use this as a check on ordered placement and heading inference. The upstream task supplies point terminals, so `bundle` mode can infer headings and reserve room for the outer return and bend tangencies. The export command starts from the unseeded input. Its nine routes passed the pinned checker below the upstream cost limit. Use the fixed-heading `terminal-bench` fixture to check automatic routing when the headings are part of the input. [Bundle planner](../inire/router/_bundle.py) · [Pinned upstream task](https://github.com/harbor-framework/terminal-bench/tree/249d125b59c0a5352d9e132195cfead6d81446be/tasks/photonic-waveguide-routing)
Use `terminal-bench-point-terminals` to test heading inference and ordered tracks through shared openings. The bundle planner reserves room for the outer return and bend tangencies. Use `terminal-bench` to test automatic routing with fixed headings.
To measure the bundle planner on the unseeded point-terminal input, export its routes.
```sh
python -m scripts.route_terminal_bench --output /tmp/inire-terminal-bench.json
```
The export CLI's `--reference-lane-plan` and `--single-bottom-track` flags replay authored layouts for comparison. Use the unseeded export to measure the planner and the reference flags to check feasibility or compare lane assignments. [Reference plan](../inire/tests/terminal_bench_lane_plan.py)
The export should report nine verified routes. The upstream input is board 1 in the [pinned layout specification](https://raw.githubusercontent.com/harbor-framework/terminal-bench/249d125b59c0a5352d9e132195cfead6d81446be/tasks/photonic-waveguide-routing/environment/layout_spec.json). The unseeded export passed the pinned checker's cost and geometry requirements.
To verify a known layout or compare lane assignments, pass `--reference-lane-plan` or `--single-bottom-track` to replay the [authored lane plans](../inire/tests/terminal_bench_lane_plan.py). Use the unseeded command above for planner coverage and timing.
## Preplaced crossings
@ -18,13 +22,20 @@ The export CLI's `--reference-lane-plan` and `--single-bottom-track` flags repla
- `crossing-obstructed-approaches` adds blocked approaches and a turning exit.
- `crossing-aligned-grid` and `crossing-staggered-grid` test multiple cells and short links between device banks.
Use unseeded runs to evaluate routing policy. The fixture witnesses are checked independently for geometry and clearance. [Crossing definitions](../inire/tests/routing_crossing_benchmarks.py)
Use unseeded runs to evaluate routing policy. For a separate check of geometry and clearance, use the reference paths in the [crossing fixtures](../inire/tests/routing_crossing_benchmarks.py).
## Imported fixtures
The six fixed-placement cases run offline from [converted inputs](../inire/tests/data/external_routing_benchmarks.json). Optical ports snap to a 0.1 µm grid. Device outlines become keepouts with access cutouts. PIC Routing Benchmark contributes splitter-tree, ring-modulator, and MZM cases. LiDAR contributes a toy layout and subsets of the Clements and MRR weight-bank layouts. These fixtures exercise waveguide routing between fixed devices. [PIC data and CC BY 4.0 attribution](https://huggingface.co/datasets/FLYR/pic-benchmark/blob/0c1f445792926d97fae01893c89e96b8a9393800/pic-benchmark/README.md) · [LiDAR source](https://github.com/ScopeX-ASU/LiDAR/tree/4e7004d32b0b80d959553797fb30f0737513de0c/src/picroute/benchmarks) · [LiDAR license](../inire/tests/data/LiDAR-LICENSE.txt)
The importer converts placed device outlines to keepouts with port openings and snaps optical ports to a 0.1 µm grid. The six converted layouts exercise routing between fixed devices. To inspect their ports and keepouts, open the [checked-in fixture data](../inire/tests/data/external_routing_benchmarks.json).
The importer checks both pinned archive hashes. It requires PyYAML when regenerating the fixtures.
| 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
@ -34,5 +45,8 @@ curl -fL 'https://codeload.github.com/ScopeX-ASU/LiDAR/tar.gz/4e7004d32b0b80d959
-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
--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
```

View file

@ -1,12 +1,14 @@
# Benchmark results
Use these measurements to understand the current probe policy and choose follow-up retry experiments. [Run a fresh benchmark](benchmarks.md)
Use these measurements when changing the automatic probe budget or retry order. The [benchmark guide](benchmarks.md) explains how to select workloads and compare your results.
## Near-port probe and retry experiments
Results recorded on November 26, 2026. The probe decision compared the two-iteration cap with the full configured probe budget. The retry experiments used the pre-cap policy.
The November 26, 2026 comparison used the regression corpus and retry holdouts under the `public-defaults` and `corpus-regression` profiles. Against the full configured probe budget, a two-iteration cap reduced public-default corpus expansions by 23%. Verified paths and costs matched on both board sets. Check these individual cases before changing the cap again.
The two-iteration probe cuts repeated shallow searches on layouts such as the splitter tree. It reduced public-default expansion counts by 23% on the regression corpus with identical paths there and on the holdouts. The mixed port-bank case did more work because the shorter probe passed the last net to the wider retry. Test both stages when changing the cap. A one-iteration cap increased the cost of a crossing approach, and the clipped-proxy regression required the original probe budget to keep its cheaper route. These are reasons to check path quality and proxy geometry as well as total expansions. [Probe budget in the policy](architecture.md#automatic-routing)
- The splitter tree benefited from fewer repeated shallow searches.
- The mixed port bank did more work because the shorter probe passed its last net to the wider retry.
- A one-iteration cap increased the cost of a crossing approach. The clipped-proxy case needed the original probe budget to find its cheaper route, so the current cap applies to the arc proxy. See the [automatic stage sequence](architecture.md#automatic-routing).
```sh
python -m scripts.benchmark_retry_order --case corpus --case retry-holdout \
@ -15,9 +17,9 @@ python -m scripts.benchmark_retry_order --case corpus --case retry-holdout \
### Early and late retries
Early retries can save time when they replace a more expensive stage. Their failures add work before the ordinary fallback. The holdout runs found both effects and a case where early incumbent recovery selected a higher-cost path at the same coverage. Review failed-retry time and common-net cost when deciding whether an early exit is worth using. The archived experiments include the trigger counts and the original commands. [Experiment archive](#experiment-archive)
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).
The experimental `late-residual-3000` policy tests a different question. Can a wider search recover the last net while keeping the rest fixed? It requires room in the caller's budget and skips attempts whose locks disconnect the remaining ports. In the pre-cap holdout sweep it completed the last net on two crossing boards and a return shelf, with all previously verified paths intact. Use the experiment to measure the cost of completing one more net after the normal policy stalls.
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 \
@ -27,4 +29,4 @@ python -m scripts.benchmark_retry_order --case retry-holdout --profile public-de
## Experiment archive
Use `git show ea5cfe7:docs/topological-routing.md` for the original retry experiments, budget sweeps, and manual Terminal-Bench lane comparisons. Use `git show 2b02c6e:docs/topological-routing.md` for the measured probe and holdout tables. For retired policies, check out `ea5cfe7` in a separate worktree to run the matching driver. [Routing development archive](../archive/routing/README.md)
To recover the recorded expansion counts or rerun an earlier driver, follow the revision and command listed with the [archived probe and retry experiments](../archive/routing/README.md#reproduce-probe-and-retry-experiments).

View file

@ -5,29 +5,26 @@
From the repository root, run the overloaded-gate fixture with the regression profile.
```sh
python -m \
scripts.compare_topological_routing \
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.
Expect `3/4 valid` and a report of three tracks for four nets crossing the cut. The run reached the geometric bound. When trying another setting, check the bound and verified IDs before comparing cost. For a case whose bound comes from fixed ports, use `--case lidar-clements-8x8`.
## 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. |
| Ordered tracks, shared gates, and barrier layouts | `all` exercises the original layouts, including fixed-heading Terminal-Bench. |
| 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. |
| 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)
Run `python -m scripts.compare_topological_routing --list` to find individual case names. Start with a fixture that exhibits the behavior you're changing, then check the rest of the corpus and relevant holdouts. For upstream sources and regeneration commands, see [Benchmark fixtures](benchmark-fixtures.md).
## Choose a profile
@ -42,8 +39,7 @@ The two budget profiles use benchmark weights for automatic candidate selection.
### Run the full regression corpus
```sh
python -m \
scripts.compare_topological_routing \
python -m scripts.compare_topological_routing \
--case corpus \
--profile corpus-regression \
--mode automatic --repeat 3 \
@ -53,8 +49,7 @@ scripts.compare_topological_routing \
### Compare routing modes
```sh
python -m \
scripts.compare_topological_routing \
python -m scripts.compare_topological_routing \
--case offset-gates \
--profile matched-budget \
--mode off --mode guide \
@ -63,13 +58,12 @@ scripts.compare_topological_routing \
--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)
At 100 nodes per search, `off` stops short. Guide and seed both finish the same net at the same cost. Guide takes 4 expansions. Seed takes 37, all in seed search. If seed work increases after a change, inspect how the [corridor is realized as a path](topological-routing.md#corridor-planning-and-realization).
### Test a retry on holdouts
```sh
python -m \
scripts.benchmark_retry_order \
python -m scripts.benchmark_retry_order \
--case retry-holdout \
--profile public-defaults \
--policy baseline \
@ -78,10 +72,10 @@ scripts.benchmark_retry_order \
--json /tmp/inire-residual.json
```
Inspect verified IDs, paths, and time spent inside failed attempts. [Prior retry decisions and measurements](benchmark-results.md)
Check which holdouts gained a verified net, then compare previously verified paths and time spent on failed attempts. To see a case where an earlier retry increased cost at the same coverage, read the [retry results](benchmark-results.md#early-and-late-retries).
## 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)
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).

View file

@ -2,19 +2,31 @@
## Choose a task
- **[Benchmarks](benchmarks.md)** runs a single case, the regression corpus, or a mode comparison.
- **[Architecture](architecture.md)** explains planner selection, locks, search, and verification. Start here to find where a behavior change belongs.
- **[Diagnostics](routing-diagnostics.md)** connects symptoms to stage reports, counters, and traces.
- **[Public API reference](user/api-reference.md)** gives the caller contract for compatibility checks.
- Measure a single case, compare modes, or run the regression corpus with the [benchmark CLI](benchmarks.md).
- Find where to change planner selection, locks, search, or verification in the [architecture guide](architecture.md).
- Investigate coverage, route quality, or runtime using the [routing diagnostics](routing-diagnostics.md).
- Check the caller contract before changing an option or result field in the [public API reference](user/api-reference.md).
## Check a change
1. Run `uv sync` to install development dependencies. Activate `.venv` or prefix the commands with `uv run`.
2. Run `python -m pytest` for the correctness suite. Use `python -m pytest -m "not routing_corpus"` for a shorter local check.
3. For a routing change, use the [benchmark profiles](benchmarks.md#choose-a-profile) or [exact parity instructions](routing-diagnostics.md#reproduce-and-compare) to compare coverage, geometry, and work.
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.
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.
For documentation figures, run `python -m scripts.render_documentation_figures` from the repository root. It writes the route plots and planner diagram under `docs/figures`. Pass `--output-dir` to render a scratch copy for comparison.
### Check a documentation figure
Run `python -m scripts.render_documentation_figures --output-dir /tmp/inire-figures` to preview changes. Compare the port labels, keepouts, path, and caption against the published example. Run the script without `--output-dir` to regenerate the figures in `docs/figures`.
### Refresh the advanced example gallery
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.
```sh
python -m scripts.export_advanced_examples
python examples/advanced_layouts.py --output-dir docs/figures
```
## Development history
See the [routing development archive](../archive/routing/README.md) for old plans, optimization logs, and recorded trace and performance data.
To recover the inputs, metrics, or rationale behind an earlier routing decision, use the [routing development archive](../archive/routing/README.md).

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Some files were not shown because too many files have changed in this diff Show more