diff --git a/DOCS.md b/DOCS.md
index 9d4742b..164c369 100644
--- a/DOCS.md
+++ b/DOCS.md
@@ -7,7 +7,7 @@ Get a [first route running](README.md#route-a-net), then use these guides for yo
## Describe a layout
- [Route a layout](docs/user/route-a-layout.md) covers units, port headings, widths, and keepouts.
-- [Connect a preplaced crossing](docs/user/route-a-layout.md#connect-a-preplaced-crossing) shows where to place the ports and how to split the external nets.
+- [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
@@ -15,13 +15,19 @@ Get a [first route running](README.md#route-a-net), then use these guides for yo
- [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.
-## Topological routing
+
-[Choose a routing mode](docs/user/tune-and-troubleshoot.md#choose-a-routing-mode) for automatic selection, lattice search, guide, seed, or ordered bundles.
+## Choose a routing mode
+
+[Compare routing modes](docs/user/tune-and-troubleshoot.md#choose-a-routing-mode) for automatic selection, lattice search, guide, seed, or ordered bundles.
## Tune a run
-[Choose a setting to try](docs/user/tune-and-troubleshoot.md#choose-the-next-setting), or open the [API reference](docs/user/api-reference.md) for signatures and defaults.
+[Choose a setting to try](docs/user/tune-and-troubleshoot.md#choose-the-next-setting) when a route is unfinished, too expensive, or slow.
+
+## API reference
+
+[Look up public signatures, result fields, and option defaults](docs/user/api-reference.md).
## Examples
diff --git a/archive/routing/README.md b/archive/routing/README.md
new file mode 100644
index 0000000..ddfc121
--- /dev/null
+++ b/archive/routing/README.md
@@ -0,0 +1,9 @@
+# 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).
+
+- **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.
+
+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)
diff --git a/docs/conflict_trace.json b/archive/routing/conflict_trace.json
similarity index 100%
rename from docs/conflict_trace.json
rename to archive/routing/conflict_trace.json
diff --git a/docs/conflict_trace.md b/archive/routing/conflict_trace.md
similarity index 100%
rename from docs/conflict_trace.md
rename to archive/routing/conflict_trace.md
diff --git a/docs/documentation-improvement-plan.md b/archive/routing/documentation-improvement-plan.md
similarity index 98%
rename from docs/documentation-improvement-plan.md
rename to archive/routing/documentation-improvement-plan.md
index 938746d..d3d0f39 100644
--- a/docs/documentation-improvement-plan.md
+++ b/archive/routing/documentation-improvement-plan.md
@@ -42,7 +42,7 @@ Give readers a direct path to their task. A new user should be able to route a l
| Architecture | A small flow diagram of construct, probe, widen, recover, verify, and refine | See where the router stops, retries, or rejects a candidate. |
| Topological routing | A single fixture shown as free space and portals, a chosen lane, and the verified physical route | See where the corridor ends and the detailed router's work begins. |
-Use the existing plots where they read clearly at page width. Regenerate focused figures from the documented inputs with the existing plotting tools. Give each figure a caption that explains what to notice and alt text that conveys the takeaway. Distinguish states with labels or line styles as well as color. Use a checked-in image for diagrams when the repository renderer needs one. [Example plots](../examples/README.md) · [Plotting helpers](../inire/utils/visualization.py)
+Use the existing plots where they read clearly at page width. Regenerate focused figures from the documented inputs with the existing plotting tools. Give each figure a caption that explains what to notice and alt text that conveys the takeaway. Distinguish states with labels or line styles as well as color. Use a checked-in image for diagrams when the repository renderer needs one. [Example plots](../../examples/README.md) · [Plotting helpers](../../inire/utils/visualization.py)
## Order of work
diff --git a/docs/frontier_trace.json b/archive/routing/frontier_trace.json
similarity index 100%
rename from docs/frontier_trace.json
rename to archive/routing/frontier_trace.json
diff --git a/docs/frontier_trace.md b/archive/routing/frontier_trace.md
similarity index 100%
rename from docs/frontier_trace.md
rename to archive/routing/frontier_trace.md
diff --git a/docs/iteration_trace.json b/archive/routing/iteration_trace.json
similarity index 100%
rename from docs/iteration_trace.json
rename to archive/routing/iteration_trace.json
diff --git a/docs/iteration_trace.md b/archive/routing/iteration_trace.md
similarity index 100%
rename from docs/iteration_trace.md
rename to archive/routing/iteration_trace.md
diff --git a/docs/optimization_pass_01_log.md b/archive/routing/optimization_pass_01_log.md
similarity index 99%
rename from docs/optimization_pass_01_log.md
rename to archive/routing/optimization_pass_01_log.md
index 25d2ae7..47e0989 100644
--- a/docs/optimization_pass_01_log.md
+++ b/archive/routing/optimization_pass_01_log.md
@@ -1,6 +1,6 @@
# Optimization Pass 01 Log
-Use this historical log to trace why a visibility, congestion, or pair-local optimization was adopted or dropped. Each section records a discrete code change and its measured effect. For a current investigation, start with the [diagnostics guide](routing-diagnostics.md#route-metrics).
+Use this historical log to trace why a visibility, congestion, or pair-local optimization was adopted or dropped. Paths in the entries reflect the repository at the time of measurement. The [baseline snapshot](performance_baseline.json) now lives alongside the log. [Current diagnostics guide](../../docs/routing-diagnostics.md#route-metrics)
## Step 0 - Pre-optimization baseline
diff --git a/docs/pair_local_characterization.json b/archive/routing/pair_local_characterization.json
similarity index 100%
rename from docs/pair_local_characterization.json
rename to archive/routing/pair_local_characterization.json
diff --git a/docs/pair_local_characterization.md b/archive/routing/pair_local_characterization.md
similarity index 100%
rename from docs/pair_local_characterization.md
rename to archive/routing/pair_local_characterization.md
diff --git a/docs/performance.md b/archive/routing/performance.md
similarity index 95%
rename from docs/performance.md
rename to archive/routing/performance.md
index 13268ca..3a9fb37 100644
--- a/docs/performance.md
+++ b/archive/routing/performance.md
@@ -2,7 +2,7 @@
Generated on 2026-04-02 by `scripts/record_performance_baseline.py`.
-The full machine-readable snapshot lives in `docs/performance_baseline.json`.
+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.
@@ -21,7 +21,7 @@ The default table below intentionally excludes the heavier performance-only no-w
## Full Counter Set
-Each scenario entry in `docs/performance_baseline.json` records the full `RouteMetrics` snapshot, including cache, index, congestion, and verification counters.
+Each scenario entry in the JSON records the full `RouteMetrics` snapshot, including cache, index, congestion, and verification counters.
These counters are currently observational only and are not enforced as CI regression gates.
Tracked metric keys:
diff --git a/docs/performance_baseline.json b/archive/routing/performance_baseline.json
similarity index 100%
rename from docs/performance_baseline.json
rename to archive/routing/performance_baseline.json
diff --git a/docs/pre_pair_frontier_trace.json b/archive/routing/pre_pair_frontier_trace.json
similarity index 100%
rename from docs/pre_pair_frontier_trace.json
rename to archive/routing/pre_pair_frontier_trace.json
diff --git a/docs/pre_pair_frontier_trace.md b/archive/routing/pre_pair_frontier_trace.md
similarity index 100%
rename from docs/pre_pair_frontier_trace.md
rename to archive/routing/pre_pair_frontier_trace.md
diff --git a/docs/routing-policy-goal.md b/archive/routing/routing-policy-goal.md
similarity index 94%
rename from docs/routing-policy-goal.md
rename to archive/routing/routing-policy-goal.md
index 52303ff..4265609 100644
--- a/docs/routing-policy-goal.md
+++ b/archive/routing/routing-policy-goal.md
@@ -1,6 +1,6 @@
# Automatic routing policy and route cost goals
-Use this historical milestone to understand why automatic routing combines constructive planners with search and why the project checks coverage before cost. Use the [current benchmark guide](benchmarks.md) to evaluate a new change.
+Use this historical milestone to understand why automatic routing combines constructive planners with search and why the project checks coverage before cost. Use the [current benchmark guide](../../docs/benchmarks.md) to evaluate a new change.
Run one inire policy across the full benchmark corpus from empty initial paths. The first milestone is to verify **242 of 243 nets and fully route 36 of 37 boards** in one run. The overloaded gate should reach its three-track capacity. Once the policy reproduces that baseline, reduce weighted route cost while preserving coverage.
@@ -12,7 +12,7 @@ Run one inire policy across the full benchmark corpus from empty initial paths.
| Best existing policy per board after targeted retries | 190/243 | 20/37 |
| Best result per board including standalone experiments | 242/243 | 36/37 |
-The clearance-checked column planner completed all 15 serial, split, and bidirectional bypass layouts with zero A* expansions. An experimental bundle turnaround routed all nine nets with the fixed Terminal-Bench headings. An automatic perimeter detour completed the two-net subset. The integrated policy should generate these routes from the input geometry and settings. Keep feasibility witnesses in the test harness for independent coverage and cost checks. [Benchmark corpus and methods](benchmarks.md#choose-a-case)
+The clearance-checked column planner completed all 15 serial, split, and bidirectional bypass layouts with zero A* expansions. An experimental bundle turnaround routed all nine nets with the fixed Terminal-Bench headings. An automatic perimeter detour completed the two-net subset. The integrated policy should generate these routes from the input geometry and settings. Keep feasibility witnesses in the test harness for independent coverage and cost checks. [Benchmark corpus and methods](../../docs/benchmarks.md#choose-a-case)
## Planner selection and verification
@@ -30,4 +30,4 @@ At this milestone, the column planner ranked lateral movement and forward span.
2. Set aside validation layouts with staggered terminal columns, uneven widths, and different obstacle arrangements before tuning. Keep closely related variants together so the validation set tests unfamiliar geometry.
3. Compare weighted transition scoring against the integrated baseline, starting with `bypass-interleaved-directions`, `split-moving-divider`, and `serial-terminal-jogs`. Report complete boards, weighted cost on identical net sets, A* expansions, and median and tail runtime. Use the full corpus and the held-out layouts to evaluate a default-policy change.
-The archived automatic policy validation records the completed corpus and holdout runs and the scoring comparison. [Experiment archive](benchmark-results.md#experiment-archive)
+The archived automatic policy validation records the completed corpus and holdout runs and the scoring comparison. [Experiment archive](../../docs/benchmark-results.md#experiment-archive)
diff --git a/docs/routing-refactor-plan.md b/archive/routing/routing-refactor-plan.md
similarity index 77%
rename from docs/routing-refactor-plan.md
rename to archive/routing/routing-refactor-plan.md
index c5d4639..5764183 100644
--- a/docs/routing-refactor-plan.md
+++ b/archive/routing/routing-refactor-plan.md
@@ -1,50 +1,50 @@
# Routing refactor plan
-Use this record to recover the original refactor scope and the reason for each proposed boundary. The initial refactor landed in `ea5cfe7`. Start with the future-looking items when considering new work, and use the [architecture](architecture.md) and [diagnostics guide](routing-diagnostics.md) for current behavior.
+Use this record to recover the original refactor scope and the reason for each proposed boundary. The initial refactor landed in `ea5cfe7`. Start with the future-looking items when considering new work, and use the [architecture](../../docs/architecture.md) and [diagnostics guide](../../docs/routing-diagnostics.md) for current behavior.
## Planned
### Benchmark reproducibility and router state
-1. **Share the corpus and benchmark profiles.** Give the comparison CLI, pytest, and the performance snapshot tools one source for case groups and named configurations. The CLI's matched-budget defaults currently use two congestion iterations and a 600-node seed budget. The corpus test uses three iterations and a 500-node seed budget. Make those settings explicit and preserve the existing configurations when moving them. Store expected coverage with the fixtures, including the bounds for `overloaded-gate` and `lidar-clements-8x8`. [Benchmark CLI](../scripts/compare_topological_routing.py) · [Corpus tests](../inire/tests/test_routing_benchmarks.py)
+1. **Share the corpus and benchmark profiles.** Give the comparison CLI, pytest, and the performance snapshot tools one source for case groups and named configurations. The CLI's matched-budget defaults currently use two congestion iterations and a 600-node seed budget. The corpus test uses three iterations and a 500-node seed budget. Make those settings explicit and preserve the existing configurations when moving them. Store expected coverage with the fixtures, including the bounds for `overloaded-gate` and `lidar-clements-8x8`. [Benchmark CLI](../../scripts/compare_topological_routing.py) · [Corpus tests](../../inire/tests/test_routing_benchmarks.py)
2. **Make exact parity a reusable benchmark command.** Compare runs by case and effective profile. Check verified net IDs, path seeds, per-net costs, selected stages and stage order, stable counters, and callback payloads. Report the first differing case, stage, or net and compare elapsed time separately. Use the command when checking subsequent behavior-preserving work.
-3. **Scope temporary obstacle reservations.** Greedy warm starts remove temporary obstacles on normal completion, and corridor seeding already uses `finally`. Share the cleanup rule while preserving insertion order and cache invalidation. Test that an interrupted greedy search leaves the routing world reusable. [Warm starts and corridor seeds](../inire/router/_router.py)
-4. **Consolidate routing counter definitions.** Define counter defaults, reset behavior, and snapshot aggregation once. Keep direct attribute increments in the search loop, preserve the distinction between per-search and cumulative counters, and retain the public `RouteMetrics` fields. Check that runs and reports expose the same counter values. [Mutable counters](../inire/router/_astar_types.py) · [Public metrics](../inire/results.py)
+3. **Scope temporary obstacle reservations.** Greedy warm starts remove temporary obstacles on normal completion, and corridor seeding already uses `finally`. Share the cleanup rule while preserving insertion order and cache invalidation. Test that an interrupted greedy search leaves the routing world reusable. [Warm starts and corridor seeds](../../inire/router/_router.py)
+4. **Consolidate routing counter definitions.** Define counter defaults, reset behavior, and snapshot aggregation once. Keep direct attribute increments in the search loop, preserve the distinction between per-search and cumulative counters, and retain the public `RouteMetrics` fields. Check that runs and reports expose the same counter values. [Mutable counters](../../inire/router/_astar_types.py) · [Public metrics](../../inire/results.py)
### Routing decisions and diagnostics
-5. **Extract trace formatting from `PathFinder`.** Start with pure formatters for conflict and iteration entries. Keep trace capture points visible in the routing loop, including the stages around best-iteration restoration and pair-local repair. Compare the serialized traces before and after. [Trace capture](../inire/router/_router.py)
-6. **Extract negotiated-congestion decisions.** Make reroute selection, late search caps, and stop conditions testable against an iteration review and recent search work. Use small tests to exercise those rules independently of A*, with corpus parity to check their integration. [Congestion routing](../inire/router/_router.py)
-7. **Group the per-search congestion caches.** Give the six congestion cache dictionaries one owner for each A* search. Simplify the signatures between the search loop, move expansion, and admission while preserving cache keys and lifetime. Compare stable counters and runtime. [Search loop](../inire/router/_search.py) · [Move admission](../inire/router/_astar_admission.py)
-8. **Consolidate direct-policy settings.** Define each direct policy's connectivity checks, lookahead, budget splitting, and unlocked probe in one internal table. Keep the attempt sequence and early exits explicit and preserve policies exposed by the benchmark CLI. [Direct and residual policies](../inire/router/_routing_policy.py)
-9. **Make automatic trial acceptance explicit.** Distinguish locally feasible candidates, whole-board validity, and eligibility to replace an incumbent. Preserve the rule that cost ranks alternatives with the same verified net IDs. Record when residual results are checked and when unresolved results are merged so stage metadata remains consistent. [Trial selection](../inire/router/_routing_policy.py) · [Automatic orchestration](../inire/router/_automatic.py)
-10. **Make capacity bounds independently testable.** Extract the cut-capacity calculation and the disjoint port-conflict check. State the geometry assumptions beside each bound and test when a bound applies separately from the policy decision to stop. Preserve reported cuts, conflict pairs, and routing targets. [Capacity and port checks](../inire/router/_capacity.py)
-11. **Separate topological planning from corridor construction.** Give endpoint access, mesh paths, lane assignments, and conversion to `Corridor` explicit internal boundaries. That lets lane-allocation tests exercise choices and tie-breaking independently of the lattice router. [Topological corridors](../inire/router/_topology.py)
-12. **Separate column scheduling from seed generation.** Distinguish opening and track assignment, feasible S-bend schedules, and the conversion of a schedule to seeds. Preserve candidate order and full-board verification. Exercise individual transition failures so new passage patterns can be tested in isolation. [Column planning](../inire/router/_columns.py)
-13. **Reuse verification details in final diagnostics.** Share final verification details with conflict and frontier reporting where they cover the same net population and installed geometry. Compare exact routes and trace payloads, then measure the change in verification calls and runtime. [Final verification and frontier capture](../inire/router/_router.py)
+5. **Extract trace formatting from `PathFinder`.** Start with pure formatters for conflict and iteration entries. Keep trace capture points visible in the routing loop, including the stages around best-iteration restoration and pair-local repair. Compare the serialized traces before and after. [Trace capture](../../inire/router/_router.py)
+6. **Extract negotiated-congestion decisions.** Make reroute selection, late search caps, and stop conditions testable against an iteration review and recent search work. Use small tests to exercise those rules independently of A*, with corpus parity to check their integration. [Congestion routing](../../inire/router/_router.py)
+7. **Group the per-search congestion caches.** Give the six congestion cache dictionaries one owner for each A* search. Simplify the signatures between the search loop, move expansion, and admission while preserving cache keys and lifetime. Compare stable counters and runtime. [Search loop](../../inire/router/_search.py) · [Move admission](../../inire/router/_astar_admission.py)
+8. **Consolidate direct-policy settings.** Define each direct policy's connectivity checks, lookahead, budget splitting, and unlocked probe in one internal table. Keep the attempt sequence and early exits explicit and preserve policies exposed by the benchmark CLI. [Direct and residual policies](../../inire/router/_routing_policy.py)
+9. **Make automatic trial acceptance explicit.** Distinguish locally feasible candidates, whole-board validity, and eligibility to replace an incumbent. Preserve the rule that cost ranks alternatives with the same verified net IDs. Record when residual results are checked and when unresolved results are merged so stage metadata remains consistent. [Trial selection](../../inire/router/_routing_policy.py) · [Automatic orchestration](../../inire/router/_automatic.py)
+10. **Make capacity bounds independently testable.** Extract the cut-capacity calculation and the disjoint port-conflict check. State the geometry assumptions beside each bound and test when a bound applies separately from the policy decision to stop. Preserve reported cuts, conflict pairs, and routing targets. [Capacity and port checks](../../inire/router/_capacity.py)
+11. **Separate topological planning from corridor construction.** Give endpoint access, mesh paths, lane assignments, and conversion to `Corridor` explicit internal boundaries. That lets lane-allocation tests exercise choices and tie-breaking independently of the lattice router. [Topological corridors](../../inire/router/_topology.py)
+12. **Separate column scheduling from seed generation.** Distinguish opening and track assignment, feasible S-bend schedules, and the conversion of a schedule to seeds. Preserve candidate order and full-board verification. Exercise individual transition failures so new passage patterns can be tested in isolation. [Column planning](../../inire/router/_columns.py)
+13. **Reuse verification details in final diagnostics.** Share final verification details with conflict and frontier reporting where they cover the same net population and installed geometry. Compare exact routes and trace payloads, then measure the change in verification calls and runtime. [Final verification and frontier capture](../../inire/router/_router.py)
### Geometry and tooling cleanup
-14. **Expose live raw static obstacles through `RoutingWorld`.** Give pair-local search and corridor setup an ordered iterator so both can use current obstacles, including obstacles added after problem creation. Keep index storage details inside the world. [Routing world](../inire/geometry/collision.py) · [Pair-local search](../inire/router/_pair_local.py)
-15. **Centralize cardinal coordinate transforms.** Share forward and lateral projection across the refiner, perimeter planner, and direct-route planner. Cover all four headings and leave snapping at its current points. [Port primitives](../inire/geometry/primitives.py) · [Refiner](../inire/router/refiner.py)
-16. **Move shared geometry helpers out of planner modules.** Give helpers such as exact S-bend spans a neutral home so compact routing can reuse them directly. Preserve exact integer spans for constructive routing and floating-point reach calculations for search. [Compact routing](../inire/router/_compact.py) · [Column planning](../inire/router/_columns.py)
-17. **Share component construction between seed replay and A*.** Reuse the mapping from move parameters to straight, 90-degree bend, and S-bend geometry. Preserve A* cache keys, handling of infeasible moves, and the geometry options applied during seed replay. [Seed materialization](../inire/router/_seed_materialization.py) · [Move admission](../inire/router/_astar_admission.py)
-18. **Name scoring objectives by purpose.** Make search cost, refinement cost, automatic trial ranking, and benchmark-weighted length clear in code and reports. Reuse the weighted-length calculation where it is identical and label native and benchmark costs explicitly. [Automatic scoring](../inire/router/_automatic.py) · [Benchmark reporting](../scripts/compare_topological_routing.py)
-19. **Share trace recorder boilerplate.** Reuse scenario selection, result summaries, command-line arguments, and artifact writing across conflict, frontier, pre-pair, and iteration recorders. Keep each report's renderer and schema in its own script. [Frontier recorder](../scripts/record_frontier_trace.py) · [Iteration recorder](../scripts/record_iteration_trace.py)
-20. **Keep fixtures and routing docs easy to maintain.** Organize large fixture modules by family while preserving stable case names and corpus order. Keep feasibility witnesses separate from timed inputs. Update the architecture map for pair-local search and label the original routing goal as a historical milestone. [Benchmark fixtures](../inire/tests/routing_benchmarks.py) · [Architecture](architecture.md) · [Original routing goal](routing-policy-goal.md)
-21. **Resolve the remaining lint findings.** Review and fix the reported issues in `inire` and `scripts`, including redundant comprehensions and long lines. Review suggested fixes individually where they touch search or benchmark behavior. [Lint configuration](../pyproject.toml)
+14. **Expose live raw static obstacles through `RoutingWorld`.** Give pair-local search and corridor setup an ordered iterator so both can use current obstacles, including obstacles added after problem creation. Keep index storage details inside the world. [Routing world](../../inire/geometry/collision.py) · [Pair-local search](../../inire/router/_pair_local.py)
+15. **Centralize cardinal coordinate transforms.** Share forward and lateral projection across the refiner, perimeter planner, and direct-route planner. Cover all four headings and leave snapping at its current points. [Port primitives](../../inire/geometry/primitives.py) · [Refiner](../../inire/router/refiner.py)
+16. **Move shared geometry helpers out of planner modules.** Give helpers such as exact S-bend spans a neutral home so compact routing can reuse them directly. Preserve exact integer spans for constructive routing and floating-point reach calculations for search. [Compact routing](../../inire/router/_compact.py) · [Column planning](../../inire/router/_columns.py)
+17. **Share component construction between seed replay and A*.** Reuse the mapping from move parameters to straight, 90-degree bend, and S-bend geometry. Preserve A* cache keys, handling of infeasible moves, and the geometry options applied during seed replay. [Seed materialization](../../inire/router/_seed_materialization.py) · [Move admission](../../inire/router/_astar_admission.py)
+18. **Name scoring objectives by purpose.** Make search cost, refinement cost, automatic trial ranking, and benchmark-weighted length clear in code and reports. Reuse the weighted-length calculation where it is identical and label native and benchmark costs explicitly. [Automatic scoring](../../inire/router/_automatic.py) · [Benchmark reporting](../../scripts/compare_topological_routing.py)
+19. **Share trace recorder boilerplate.** Reuse scenario selection, result summaries, command-line arguments, and artifact writing across conflict, frontier, pre-pair, and iteration recorders. Keep each report's renderer and schema in its own script. [Frontier recorder](../../scripts/record_frontier_trace.py) · [Iteration recorder](../../scripts/record_iteration_trace.py)
+20. **Keep fixtures and routing docs easy to maintain.** Organize large fixture modules by family while preserving stable case names and corpus order. Keep feasibility witnesses separate from timed inputs. Update the architecture map for pair-local search and label the original routing goal as a historical milestone. [Benchmark fixtures](../../inire/tests/routing_benchmarks.py) · [Architecture](../../docs/architecture.md) · [Original routing goal](routing-policy-goal.md)
+21. **Resolve the remaining lint findings.** Review and fix the reported issues in `inire` and `scripts`, including redundant comprehensions and long lines. Review suggested fixes individually where they touch search or benchmark behavior. [Lint configuration](../../pyproject.toml)
## Future-looking
-22. **Consider a common residual routing interface when a new recovery strategy needs it.** Identify which operations can be shared across direct locks, incumbent seeding, perimeter recovery, and pair-local search. Preserve their distinct roles for frozen obstacles, seed hints, and merge-time verification. [Residual policies](../inire/router/_routing_policy.py) · [Pair-local search](../inire/router/_pair_local.py)
-23. **Split collision queries further when profiling or geometry work identifies a reason.** Candidate lookup, exact overlap, and ray casting are possible boundaries. Compare clearance, boundary touches, physical and proxy geometry, and cache behavior before adopting a new split. [Collision queries](../inire/geometry/collision.py)
-24. **Revisit public option grouping with a compatibility plan.** Consider grouping planner settings or bend geometry when an API change is warranted. Account for legacy custom bend polygons and separate physical and proxy geometry. Handle changes to defaults, validation, and public names as explicit API decisions. [Public options](../inire/model.py)
+22. **Consider a common residual routing interface when a new recovery strategy needs it.** Identify which operations can be shared across direct locks, incumbent seeding, perimeter recovery, and pair-local search. Preserve their distinct roles for frozen obstacles, seed hints, and merge-time verification. [Residual policies](../../inire/router/_routing_policy.py) · [Pair-local search](../../inire/router/_pair_local.py)
+23. **Split collision queries further when profiling or geometry work identifies a reason.** Candidate lookup, exact overlap, and ray casting are possible boundaries. Compare clearance, boundary touches, physical and proxy geometry, and cache behavior before adopting a new split. [Collision queries](../../inire/geometry/collision.py)
+24. **Revisit public option grouping with a compatibility plan.** Consider grouping planner settings or bend geometry when an API change is warranted. Account for legacy custom bend polygons and separate physical and proxy geometry. Handle changes to defaults, validation, and public names as explicit API decisions. [Public options](../../inire/model.py)
## Verification
-Use the current 67-board corpus as the regression baseline for routing changes. The `corpus-regression` and `public-defaults` profiles reach every board's routing bound and verify 433 of 437 nets each. For behavior-preserving changes, compare exact paths, per-net costs, bounds, planner stage order and metadata, and relevant callback and trace payloads. For changes that intentionally eliminate work, such as item 13, record the expected counter differences while checking route and trace parity. [Corpus reproduction](benchmarks.md#run-the-full-regression-corpus)
+Use the current 67-board corpus as the regression baseline for routing changes. The `corpus-regression` and `public-defaults` profiles reach every board's routing bound and verify 433 of 437 nets each. For behavior-preserving changes, compare exact paths, per-net costs, bounds, planner stage order and metadata, and relevant callback and trace payloads. For changes that intentionally eliminate work, such as item 13, record the expected counter differences while checking route and trace parity. [Corpus reproduction](../../docs/benchmarks.md#run-the-full-regression-corpus)
-Capture the same cases and options at both revisions. The parity command defaults to the `corpus-regression` and `public-defaults` profiles. [Parity commands](routing-diagnostics.md#reproduce-and-compare)
+Capture the same cases and options at both revisions. The parity command defaults to the `corpus-regression` and `public-defaults` profiles. [Parity commands](../../docs/routing-diagnostics.md#reproduce-and-compare)
### Refactor validation
diff --git a/docs/architecture.md b/docs/architecture.md
index 71c852f..6b4d52c 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -26,7 +26,7 @@ The diagram shows the usual sequence for arc bends. A verified layout can reach
- **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)
-- **Repair a small conflict set.** Late iterations can focus on the conflicting nets. Pair-local repair restores the best snapshot, keeps the remaining geometry fixed, and tries two orderings for an eligible pair. It 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.** 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)
## Geometry and refinement
diff --git a/docs/benchmark-fixtures.md b/docs/benchmark-fixtures.md
index 878ea04..bbc5f2f 100644
--- a/docs/benchmark-fixtures.md
+++ b/docs/benchmark-fixtures.md
@@ -18,7 +18,7 @@ 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) · [Illustrated user workflow](user/route-a-layout.md#connect-a-preplaced-crossing)
+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)
## Imported fixtures
diff --git a/docs/benchmark-results.md b/docs/benchmark-results.md
index e2d6286..92815c4 100644
--- a/docs/benchmark-results.md
+++ b/docs/benchmark-results.md
@@ -27,4 +27,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. [Original goal](routing-policy-goal.md) · [Refactor plan](routing-refactor-plan.md)
+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)
diff --git a/docs/benchmarks.md b/docs/benchmarks.md
index 921a884..d028936 100644
--- a/docs/benchmarks.md
+++ b/docs/benchmarks.md
@@ -34,10 +34,10 @@ Run `python -m scripts.compare_topological_routing --list` to find individual ca
| Profile | Use it to |
| --- | --- |
| `public-defaults` | Measure the public policy and objective on the fixture geometry. |
-| `corpus-regression` | Reproduce the test budget of 500 search nodes, 500 seed nodes, and three configured congestion iterations. |
-| `matched-budget` | Compare modes with shared budgets. It defaults to 500 search nodes and two configured iterations. Use CLI overrides to test a smaller budget. |
+| `corpus-regression` | Reproduce the routing regression settings. The profile retains fixture options and sets 500 search nodes, 500 seed nodes, and three configured congestion iterations. |
+| `matched-budget` | Compare modes at shared configured budgets. It defaults to 500 search nodes and two configured iterations. Use CLI overrides to test a smaller budget. |
-The two budget profiles use benchmark weights for automatic candidate selection. Match the profile, options, and worker count when measuring a change.
+The two budget profiles use benchmark weights for automatic candidate selection. Stages can use smaller budgets. Match the profile, options, and worker count when measuring a change.
### Run the full regression corpus
diff --git a/docs/development.md b/docs/development.md
index a84f164..621dbf5 100644
--- a/docs/development.md
+++ b/docs/development.md
@@ -15,9 +15,6 @@
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.
-## Design and experiment records
+## Development history
-- **Design history.** [Original routing goal](routing-policy-goal.md) and [routing refactor plan](routing-refactor-plan.md).
-- **Benchmark evidence.** [Probe and retry results](benchmark-results.md), [fixture sources](benchmark-fixtures.md), and [historical example performance snapshot](performance.md).
-- **Generated diagnostic examples.** [Iteration trace](iteration_trace.md), [conflict trace](conflict_trace.md), [frontier trace](frontier_trace.md), and [pre-pair trace](pre_pair_frontier_trace.md).
-- **Optimization history.** [Pair-local characterization](pair_local_characterization.md) and [optimization log](optimization_pass_01_log.md).
+See the [routing development archive](../archive/routing/README.md) for old plans, optimization logs, and recorded trace and performance data.
diff --git a/docs/figures/placed-crossing.png b/docs/figures/placed-crossing.png
index 1758599..703b7da 100644
Binary files a/docs/figures/placed-crossing.png and b/docs/figures/placed-crossing.png differ
diff --git a/docs/routing-diagnostics.md b/docs/routing-diagnostics.md
index b34af0d..48fc4a2 100644
--- a/docs/routing-diagnostics.md
+++ b/docs/routing-diagnostics.md
@@ -22,7 +22,7 @@ Pair each counter with a question about the work. Use a repeated wall-time compa
| Refinement takes longer | Compare `refinement_windows_considered`, `refinement_candidates_verified`, and `refinement_candidates_accepted`. Check whether the added windows buy a better path before enlarging the default budget. |
| Attempts reach targets while verified coverage stays flat | Compare `iteration_conflict_edges` and `nets_carried_forward`. Inspect pair-local attempts and accepts after congestion stops. `pair_local_search_nodes_expanded` counts searches that returned a locally valid pair, so consult the attempt count to see failed searches. |
-`nets_routed` and `nets_reached_target` count attempts. To count final successes use `result.is_valid` or `verified_net_ids`. Fields ending in `_total_ns` measure durations and can vary between identical runs. Use the counter schema for exact field names and the example snapshot to investigate earlier observations. [Counter schema](../inire/results.py) · [Historical example snapshot](performance.md) · [Snapshot JSON](performance_baseline.json)
+`nets_routed` and `nets_reached_target` count attempts. To count final successes use `result.is_valid` or `verified_net_ids`. Fields ending in `_total_ns` measure durations and can vary between identical runs. Use the counter schema for exact field names and the example snapshot to investigate earlier observations. [Counter schema](../inire/results.py) · [Historical example snapshot](../archive/routing/performance.md) · [Snapshot JSON](../archive/routing/performance_baseline.json)
## Traces
@@ -32,7 +32,7 @@ Enable the `DiagnosticsOptions` flag for the question you want to answer.
| --- | --- |
| Which net consumed an iteration's budget? | `capture_iteration_trace` records `iteration_trace`. Inspect per-net `net_attempts` for expansions, pruning, congestion calls, and seed usage. |
| Which two routes overlap after re-verification? | `capture_conflict_trace` records `conflict_trace`. Use the dynamic conflict edges to find the pair and the component indices to locate the overlap. |
-| Why was a nearby detour rejected? | `capture_frontier_trace` records `frontier_trace` for reached-but-colliding nets. Look at the sampled states and prune reasons near the final overlap. The analysis leaves the selected route fixed. |
+| What pruning occurred near the final overlap? | `capture_frontier_trace` records `frontier_trace` for reached-but-colliding nets. Inspect the states and prune reasons sampled in that area. The diagnostic replay leaves the selected route fixed. |
| What did the last unresolved iteration hand to pair-local repair? | `capture_pre_pair_frontier_trace` records `pre_pair_frontier_trace`. Check reroute order, conflict edges, and per-net attempt work immediately before repair. |
| Where did the router explore? | `capture_expanded` records `expanded_nodes` for plotting. See the [fan-out example](../examples/07_large_scale_routing.py). |
@@ -47,7 +47,7 @@ python -m scripts.record_iteration_trace --scenario example_07_large_scale_routi
1. Open the generated `iteration_trace.md`. Compare the last iteration's completed count and conflict edges with the final result summary. In the recorded example, the last iteration had six completed nets and two conflict edges.
2. Inspect the final result and pair-local counters in `iteration_trace.json`. All ten nets verified after repair in the recorded run. The last congestion iteration alone misses this improvement.
-3. To see which paths overlapped, capture the same scenario with `scripts.record_conflict_trace`. Compare `restored_best` with `final`. Use the pre-pair trace to investigate reroute order and per-net work before repair. [Recorded iteration trace](iteration_trace.md#example_07_large_scale_routing_no_warm_start) · [Conflict trace](conflict_trace.md) · [Pre-pair trace](pre_pair_frontier_trace.md)
+3. To see which paths overlapped, capture the same scenario with `scripts.record_conflict_trace`. Compare `restored_best` with `final`. Use the pre-pair trace to investigate reroute order and per-net work before repair. [Recorded iteration trace](../archive/routing/iteration_trace.md#example_07_large_scale_routing_no_warm_start) · [Conflict trace](../archive/routing/conflict_trace.md) · [Pre-pair trace](../archive/routing/pre_pair_frontier_trace.md)
Use an `iteration_callback` for live progress across automatic attempts and the final result for coverage. [Callback API](user/api-reference.md#route-a-problem)
@@ -66,4 +66,4 @@ python -m scripts.routing_benchmark_parity compare /tmp/routing-before.json /tmp
Use `scripts.record_iteration_trace` and `scripts.record_pre_pair_frontier_trace` to inspect a late conflict. Use `scripts.record_conflict_trace` and `scripts.record_frontier_trace` to locate an overlap and inspect rejected moves near it. Pass `--output-dir /tmp/inire-trace` for a scratch capture. The trace writers support `--scenario` for an individual built-in case and `--include-performance-only` for the heavier cases.
-For isolated timing gates, run `INIRE_RUN_PERFORMANCE=1 python -m pytest -q inire/tests/test_example_performance.py`. Use `scripts.record_performance_baseline` with `--output-dir` to record an example snapshot and `scripts.diff_performance_baseline` with `--baseline` and `--metric` to compare a fresh run. The [pair-local characterization](pair_local_characterization.md) and [optimization log](optimization_pass_01_log.md) preserve earlier experiments.
+For isolated timing gates, run `INIRE_RUN_PERFORMANCE=1 python -m pytest -q inire/tests/test_example_performance.py`. Use `scripts.record_performance_baseline` with `--output-dir` to record a snapshot. Use `scripts.diff_performance_baseline` to compare a fresh run with the archived baseline, or pass `--baseline` to select a different snapshot. Use `--metric` to select counters. [Routing development archive](../archive/routing/README.md)
diff --git a/docs/user/api-reference.md b/docs/user/api-reference.md
index 0254a0d..0001e5c 100644
--- a/docs/user/api-reference.md
+++ b/docs/user/api-reference.md
@@ -35,9 +35,10 @@ Omitting `options` uses `RoutingOptions()`. To observe live congestion iteration
| --- | --- |
| `RoutingRunResult.results_by_net` | A mapping from net ID to `RoutingResult`. |
| `RoutingResult.is_valid` and `outcome` | Final validity and a status of `completed`, `colliding`, `partial`, or `unroutable`. |
+| `RoutingResult.path` | Ordered path components from the source to the last reached state. An unroutable result has an empty path. |
| `RoutingResult.reached_target` and `report` | Arrival status, physical length, and collision details. |
| `RoutingResult.locked_geometry` and `as_seed()` | Physical polygons for export or fixed obstacles, and the move sequence for reuse as a seed. |
-| `RoutingRunResult.automatic` | In automatic mode, the selected planner, the verified IDs, stage history, and any capacity or port-conflict bound. |
+| `RoutingRunResult.automatic` | In automatic mode, the selected planner, verified IDs, stage history, and any capacity or port-conflict bound. `None` for explicit modes. |
| `RoutingRunResult.topology` and `metrics` | Corridor counts and seed work when reported by the selected worker, plus work counters across the run. |
See [how to read the result](tune-and-troubleshoot.md#read-the-result) for export checks and [developer diagnostics](../routing-diagnostics.md) for reports and traces.
@@ -93,7 +94,7 @@ Increase the iteration limit when later reroutes might resolve conflicts. Adjust
| `base_penalty` | `100.0` | Initial penalty for overlapping other routes. |
| `multiplier` | `1.5` | Scale the penalty between unresolved iterations. |
| `use_tiered_strategy` | `True` | Allow a cheaper bend proxy in the first iteration when applicable. |
-| `net_order` | `"user"` | Route in input order or use `"shortest"` or `"longest"`. |
+| `net_order` | `"user"` | Start from input order or sort by terminal Manhattan distance with `"shortest"` or `"longest"`. |
| `warm_start_enabled` | `True` | Build greedy seeds before congestion iterations. |
| `shuffle_nets` | `False` | Shuffle routing order between iterations. |
| `seed` | `None` | Random seed for shuffled ordering. |
diff --git a/docs/user/route-a-layout.md b/docs/user/route-a-layout.md
index fbe4dd9..aeaa6f7 100644
--- a/docs/user/route-a-layout.md
+++ b/docs/user/route-a-layout.md
@@ -10,15 +10,60 @@ Start with the [first route](../../README.md#route-a-net), then replace the exam
4. **Add keepouts.** Supply Shapely polygons in `static_obstacles` and use `bounds` for the board rectangle. Leave enough access at the ports for the guide and its permitted bends. [Input fields](api-reference.md#layout-inputs)
5. **Run and check.** Call `route(problem, options=options)` and check each `result.is_valid`. Start with automatic mode for general layouts. [Read the result](tune-and-troubleshoot.md#read-the-result)
-## Connect a preplaced crossing
+
-- Place the device and reserve its keepout first.
-- Leave openings in the keepout at the physical ports.
-- Define the external legs as separate nets. The placed cell supplies the internal connections.
+## Route between placed crossings
-
+1. **Place the crossing cells.** Keep each cell's physical footprint and internal connections in your layout. Get the port positions and headings in board coordinates after applying placement and rotation.
+2. **Reserve routing keepouts around the cells.** Use the device's routing keepout if supplied. Otherwise, start from its footprint and make local openings at the ports you're connecting. Keep the full physical cell in the exported layout.
+3. **Route the external connections.** Give Inire one net per connection between devices. The example connects A's east port to B's west port. B's arrival heading points east into the cell.
-Each leg meets a port at the end of an access slot. The dashed links show the device's internal connections schematically. The four external paths come from Inire's `crossing-single` fixture. [Crossing fixtures](../benchmark-fixtures.md#preplaced-crossings)
+
+
+Dashed outlines show the complete device footprints. Shading shows the keepouts passed to Inire. The external route connects the two port markers. The arrow at each marker shows the heading.
+
+Inire applies `clearance` around the supplied keepout polygons. A straight approach of width `w` between two keepout edges needs at least `w + 2 * clearance` of open width. Leave room for any turn near the port and check the opening after snapping the port to the grid.
+
+```python
+from shapely.geometry import box
+
+from inire import (
+ NetSpec, Port, RoutingOptions,
+ RoutingProblem, SearchOptions,
+ route,
+)
+
+# Example footprints and access openings in board coordinates.
+a = box(30, 50, 80, 100)
+b = box(260, 90, 310, 140)
+a_access = box(74, 69, 82, 81)
+b_access = box(258, 109, 266, 121)
+a_keepout = a.difference(a_access)
+b_keepout = b.difference(b_access)
+
+net_id = "A_east_to_B_west"
+link = NetSpec(
+ net_id,
+ Port(80, 75, 0),
+ Port(260, 115, 0),
+ width=2,
+)
+problem = RoutingProblem(
+ bounds=(0, 0, 340, 180),
+ nets=(link,),
+ static_obstacles=(a_keepout, b_keepout),
+ clearance=4,
+)
+search = SearchOptions(
+ bend_radii=(25,), sbend_radii=(25,),
+)
+opts = RoutingOptions(search=search)
+run = route(problem, options=opts)
+result = run.results_by_net[net_id]
+assert result.is_valid
+```
+
+Before export, check the port joins and clearance against the actual placed-cell geometry. Inire verifies the external route against the keepouts you supplied.
## Reuse an existing route
diff --git a/docs/user/tune-and-troubleshoot.md b/docs/user/tune-and-troubleshoot.md
index 0d3465a..3013a2c 100644
--- a/docs/user/tune-and-troubleshoot.md
+++ b/docs/user/tune-and-troubleshoot.md
@@ -15,7 +15,7 @@ Check `is_valid` before exporting. With explicit `off`, `guide`, or `seed` mode,
## Why a net stopped short
-1. **Check for a geometric bound.** If the automatic run reaches `max_routed` below the requested count, read `capacity_limit` or `port_conflicts`. Make more room at the reported cut or move conflicting ports.
+1. **Check for a geometric bound.** In an automatic run, `max_routed` is an upper bound. If it is below the requested count, read `capacity_limit` or `port_conflicts` to see where to widen a passage or move a port. A result below the bound can still leave feasible nets unfinished.
2. **Check the port and turn geometry.** For static or self-collisions, inspect physical clearance and bend room. For dynamic collisions, inspect the routes that compete for the same space.
3. **Check the search budget.** If the verified count is below the bound and the geometry looks feasible, try raising a small `search.node_limit`. The limit is per search. A run can try the same net several times.
@@ -33,6 +33,8 @@ Set `TopologyOptions(mode=...)` and pass it as `topology` in `RoutingOptions`.
- **`seed`.** Try to realize a verified starting path inside a corridor before the detailed search.
- **`bundle`.** Route supported ordered rectangular bundles. Use a circular radius enabled for both bends and S-bends. Unsupported layouts and invalid schedules raise `ValueError`.
+### Mode requirements
+
- Guide and seed modes require constrained triangulation from Shapely 2.1 with GEOS 3.10 or newer. Caller-supplied seeds take precedence, and nets without a corridor can use ordinary lattice search.
- Enable `infer_terminal_headings` for point terminals with flexible headings. Preserve fixed headings when a device requires a specific arrival direction.
- In automatic mode, smaller initial budgets make the first attempts cheaper. If coverage remains below the bound, a lattice fallback can use your configured ceiling. Automatic also uses lattice for custom bend geometry or when constrained triangulation is unavailable. [Automatic stage order](../architecture.md#automatic-routing)
diff --git a/inire/tests/trace_recording.py b/inire/tests/trace_recording.py
index 5f826d6..5e86dde 100644
--- a/inire/tests/trace_recording.py
+++ b/inire/tests/trace_recording.py
@@ -44,7 +44,7 @@ def record_trace(
parser = ArgumentParser(description=f"Record {name.replace('_', '-')} artifacts for selected trace scenarios.")
parser.add_argument("--scenario", action="append", help="Trace scenario name. Repeat to select multiple scenarios.")
parser.add_argument("--include-performance-only", action="store_true", help="Accept performance-only scenario names.")
- parser.add_argument("--output-dir", type=Path, help=f"Directory for {name}.json and {name}.md. Defaults to /docs.")
+ parser.add_argument("--output-dir", type=Path, help=f"Directory for {name}.json and {name}.md. Defaults to /archive/routing.")
args = parser.parse_args()
registry = dict(TRACE_SCENARIO_RUNS + TRACE_PERFORMANCE_SCENARIO_RUNS)
@@ -56,8 +56,8 @@ def record_trace(
source_path = Path(source).resolve()
repo_root = source_path.parents[1]
- output_dir = repo_root / "docs" if args.output_dir is None else args.output_dir.resolve()
- output_dir.mkdir(exist_ok=True)
+ output_dir = repo_root / "archive" / "routing" if args.output_dir is None else args.output_dir.resolve()
+ output_dir.mkdir(parents=True, exist_ok=True)
scenarios = []
for scenario in selected:
run = registry[scenario]()
diff --git a/scripts/characterize_pair_local_search.py b/scripts/characterize_pair_local_search.py
index 5b575e3..1a697b5 100644
--- a/scripts/characterize_pair_local_search.py
+++ b/scripts/characterize_pair_local_search.py
@@ -125,13 +125,13 @@ def main() -> None:
"--output-dir",
type=Path,
default=None,
- help="Directory to write pair_local_characterization.json and .md into. Defaults to /docs.",
+ help="Directory to write pair_local_characterization.json and .md into. Defaults to /archive/routing.",
)
args = parser.parse_args()
repo_root = Path(__file__).resolve().parents[1]
- output_dir = repo_root / "docs" if args.output_dir is None else args.output_dir.resolve()
- output_dir.mkdir(exist_ok=True)
+ output_dir = repo_root / "archive" / "routing" if args.output_dir is None else args.output_dir.resolve()
+ output_dir.mkdir(parents=True, exist_ok=True)
num_nets_values = _parse_csv_ints(args.num_nets)
seed_values = _parse_csv_ints(args.seeds)
diff --git a/scripts/diff_performance_baseline.py b/scripts/diff_performance_baseline.py
index 352022b..f2b9cd6 100644
--- a/scripts/diff_performance_baseline.py
+++ b/scripts/diff_performance_baseline.py
@@ -160,8 +160,8 @@ def main() -> None:
parser.add_argument(
"--baseline",
type=Path,
- default=Path("docs/performance_baseline.json"),
- help="Baseline JSON to compare against.",
+ default=Path("archive/routing/performance_baseline.json"),
+ help="Baseline JSON to compare against. Defaults to archive/routing/performance_baseline.json.",
)
parser.add_argument(
"--output",
diff --git a/scripts/record_performance_baseline.py b/scripts/record_performance_baseline.py
index d0b4062..c8cb64a 100644
--- a/scripts/record_performance_baseline.py
+++ b/scripts/record_performance_baseline.py
@@ -55,7 +55,7 @@ def _render_markdown(payload: dict[str, object]) -> str:
"",
f"Generated on {payload['generated_on']} by `{payload['generator']}`.",
"",
- "The full machine-readable snapshot lives in `docs/performance_baseline.json`.",
+ "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.",
"",
"| Scenario | Duration (s) | Total | Valid | Reached | Iter | Nets Routed | Nodes | Ray Casts | "
@@ -88,7 +88,7 @@ def _render_markdown(payload: dict[str, object]) -> str:
"",
"## Full Counter Set",
"",
- "Each scenario entry in `docs/performance_baseline.json` records the full `RouteMetrics` snapshot, "
+ "Each scenario entry in the JSON records the full `RouteMetrics` snapshot, "
"including cache, index, congestion, and verification counters.",
"These counters are currently observational only and are not enforced as CI regression gates.",
"",
@@ -106,7 +106,7 @@ def main() -> None:
"--output-dir",
type=Path,
default=None,
- help="Directory to write performance_baseline.json and performance.md into. Defaults to /docs.",
+ help="Directory to write performance_baseline.json and performance.md into. Defaults to /archive/routing.",
)
parser.add_argument(
"--scenario",
@@ -123,13 +123,13 @@ def main() -> None:
args = parser.parse_args()
repo_root = Path(__file__).resolve().parents[1]
- docs_dir = repo_root / "docs" if args.output_dir is None else args.output_dir.resolve()
- docs_dir.mkdir(exist_ok=True)
+ output_dir = repo_root / "archive" / "routing" if args.output_dir is None else args.output_dir.resolve()
+ output_dir.mkdir(parents=True, exist_ok=True)
selected = tuple(args.scenarios) if args.scenarios else None
payload = _build_payload(selected, include_performance_only=args.include_performance_only)
- json_path = docs_dir / "performance_baseline.json"
- markdown_path = docs_dir / "performance.md"
+ json_path = output_dir / "performance_baseline.json"
+ markdown_path = output_dir / "performance.md"
json_path.write_text(json.dumps(payload, indent=2, sort_keys=True) + "\n")
markdown_path.write_text(_render_markdown(payload))
diff --git a/scripts/render_documentation_figures.py b/scripts/render_documentation_figures.py
index c523726..b4c0c1b 100644
--- a/scripts/render_documentation_figures.py
+++ b/scripts/render_documentation_figures.py
@@ -99,38 +99,37 @@ def _first_route(directory: Path) -> None:
def _placed_crossing(directory: Path) -> None:
- (case,) = CASE_GROUPS["crossing-single"]
- problem = case.problem
- run = route(problem, options=case.options)
- assert len(run.results_by_net) == 4
- assert all(result.is_valid for result in run.results_by_net.values())
+ # Match the placed devices and port access in docs/user/route-a-layout.md.
+ a = box(30, 50, 80, 100)
+ b = box(260, 90, 310, 140)
+ a_keepout = a.difference(box(74, 69, 82, 81))
+ b_keepout = b.difference(box(258, 109, 266, 121))
+ link = NetSpec("A_east_to_B_west", Port(80, 75, 0), Port(260, 115, 0), width=2)
+ problem = RoutingProblem((0, 0, 340, 180), (link,), (a_keepout, b_keepout), clearance=4)
+ options = RoutingOptions(search=SearchOptions(bend_radii=(25,), sbend_radii=(25,)))
+ result = route(problem, options=options).results_by_net[link.net_id]
+ assert result.is_valid
+ assert all(shape.intersection(cell).area == 0 for shape in result.locked_geometry for cell in (a, b))
- fig, ax = plt.subplots(figsize=(6.3, 4.5), layout="constrained")
+ fig, ax = plt.subplots(figsize=(7.1, 3.4), layout="constrained")
_board(ax, problem)
- ax.set(xlim=(81, 239), ylim=(102, 218))
- ax.plot([146, 174], [160, 160], linestyle="--", color=MUTED, linewidth=1, zorder=3)
- ax.plot([160, 160], [146, 174], linestyle="--", color=MUTED, linewidth=1, zorder=3)
+ ax.set(xlim=(14, 326), ylim=(27, 159))
+ for name, cell in (("A", a), ("B", b)):
+ _polygon(ax, cell, fill="none", edge=INK, linestyle="--", linewidth=1.2, zorder=3)
+ ax.text(cell.centroid.x, cell.centroid.y + 12, f"Crossing {name}", color=INK, fontsize=10, ha="center", va="center")
- labels = (
- ("West leg", (104, 167), (137, 153), "W"),
- ("East leg", (210, 167), (183, 153), "E"),
- ("South leg", (173, 115), (167, 132), "S"),
- ("North leg", (173, 205), (167, 184), "N"),
- )
- for net, (leg, label_xy, port_xy, port_name) in zip(problem.nets, labels, strict=True):
- port = min((net.start, net.target), key=lambda p: abs(p.x - 160) + abs(p.y - 160))
- _waveguide(ax, run.results_by_net[net.net_id], color=ROUTE)
- _heading(ax, port, 5)
- ax.text(*label_xy, leg, color=ROUTE, fontsize=11, ha="center")
- ax.text(*port_xy, port_name, color=INK, fontsize=10, weight="bold", ha="center")
+ _waveguide(ax, result, color=ROUTE)
+ for label, port, dx, dy in (("A east port", link.start, 14, -13), ("B west port", link.target, -14, 13)):
+ _heading(ax, port, 10)
+ ax.text(port.x + dx, port.y + dy, label, color=INK, fontsize=10, ha="left" if dx > 0 else "right")
ax.annotate(
- "Device keepout", xy=(144, 176), xytext=(93, 198), color=INK, fontsize=10,
- arrowprops={"arrowstyle": "->", "color": MUTED},
+ "Port access opening", xy=(76, 79), xytext=(94, 117), color=INK, fontsize=10,
+ arrowprops={"arrowstyle": "->", "color": MUTED}, zorder=8,
)
ax.annotate(
- "Access slot", xy=(177, 164), xytext=(202, 131), color=INK, fontsize=10,
- arrowprops={"arrowstyle": "->", "color": MUTED},
+ "External waveguide", xy=(154, 75), xytext=(168, 47), color=ROUTE, fontsize=10,
+ arrowprops={"arrowstyle": "->", "color": ROUTE},
)
_save(fig, directory, "placed-crossing.png")