Tie documentation links to reader workflows

This commit is contained in:
Jan Petykiewicz 2026-11-26 22:03:08 -08:00
commit a029791f33

View file

@ -1,14 +1,14 @@
# Routing diagnostics and metrics
Start with the symptom. For layout or option changes, use the [user troubleshooting guide](user/tune-and-troubleshoot.md).
Use these reports to investigate a change in planner selection, coverage, or runtime. To troubleshoot a layout you want to route, start with the [user guide](user/tune-and-troubleshoot.md).
## Automatic reports
- **A net is missing.** Compare the verified count with `max_routed`. In `overloaded-gate`, `capacity_limit.cut_x` locates the cut that fits three of four requested routes. Below the bound, read `stages` for skipped or locked nets and for the attempt where coverage stopped increasing. [Run the overloaded-gate fixture](benchmarks.md#run-a-benchmark)
- **A net is missing.** Compare the verified count with `max_routed`. If the count falls short of the bound, read `stages` for skipped or locked nets and look for the attempt where coverage stopped increasing. To see a run that reaches its bound of three routes out of four, try the [overloaded-gate benchmark](benchmarks.md#run-a-benchmark).
- **The chosen route changed.** Start at `stages[selected_stage]`. The `planner` identifies the source of the proposal and `mode` identifies the worker, so a bundle seed can be checked by an `off` worker. Use `planner_rejections` for constructive candidates that never reached selection. [Report definitions](../inire/results.py)
- **The chosen route changed.** Start at `stages[selected_stage]`. The `planner` identifies the source of the proposal and `mode` identifies the worker, so a bundle seed can be checked by an `off` worker. Use `planner_rejections` for constructive candidates that never reached selection.
- **The run slowed down.** Group exclusive `timings` by policy and operation, including failed attempts. `duration_s` also includes orchestration. Detailed traces, corridor reports, and expanded states describe the selected attempt when present. Check `run.metrics` and stage data for work across attempts. [Benchmark profiles](benchmarks.md#choose-a-profile)
- **The run slowed down.** Group exclusive `timings` by policy and operation, including failed attempts. `duration_s` also includes orchestration. Use `run.metrics` and stage data for work across attempts. Detailed traces, corridor reports, and expanded states describe the selected attempt when present.
## Route metrics
@ -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](../archive/routing/performance.md) · [Snapshot JSON](../archive/routing/performance_baseline.json)
`nets_routed` and `nets_reached_target` count attempts. Use `result.is_valid` or `verified_net_ids` to count final successes. Duration counters ending in `_total_ns` can vary between identical runs. For the full field list, see the [`RouteMetrics` definition](../inire/results.py).
## Traces
@ -45,11 +45,12 @@ python -m scripts.record_iteration_trace --scenario example_07_large_scale_routi
--output-dir /tmp/inire-trace
```
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](../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)
1. Compare the last iteration with the final result in `iteration_trace.md`. The last iteration had six completed nets and two conflict edges in the [recorded fan-out run](../archive/routing/iteration_trace.md#example_07_large_scale_routing_no_warm_start).
2. Read the final result and pair-local counters in `iteration_trace.json`. All ten nets verified after repair in this run.
3. Substitute `scripts.record_conflict_trace` in the command to locate the overlapping components. Compare `restored_best` with `final` as shown in the [recorded conflict trace](../archive/routing/conflict_trace.md).
4. Substitute `scripts.record_pre_pair_frontier_trace` to see the reroute order and per-net work leading up to repair. Compare your run with the [recorded 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)
Use the returned result to count final successes. For live progress during routing, pass an [`iteration_callback`](user/api-reference.md#route-a-problem).
## Reproduce and compare
@ -64,6 +65,10 @@ python -m scripts.routing_benchmark_parity capture /tmp/routing-after.json --cas
python -m scripts.routing_benchmark_parity compare /tmp/routing-before.json /tmp/routing-after.json
```
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. Select any built-in trace case by name with `--scenario`.
Select a built-in trace case by name with `--scenario`. Use `--output-dir` to write the capture in a scratch directory.
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)
### Check timing and counters
- Run the isolated timing gates with `INIRE_RUN_PERFORMANCE=1 python -m pytest -q inire/tests/test_example_performance.py`.
- Record a snapshot with `python -m scripts.record_performance_baseline --output-dir /tmp/inire-baseline`. For the resulting coverage, timing, and counter summary, see the [example baseline](../archive/routing/performance.md).
- Compare a fresh run with `python -m scripts.diff_performance_baseline`. Use `--metric` to focus on specific work or `--baseline` to override the [default baseline JSON](../archive/routing/performance_baseline.json).