Tie routing documentation to user and developer workflows

This commit is contained in:
Jan Petykiewicz 2026-11-27 10:15:54 -08:00
commit 2c7a7ea90a

View file

@ -31,24 +31,32 @@ Enable the `DiagnosticsOptions` flag for the question you want to answer.
| Question | Flag and result |
| --- | --- |
| 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. |
| Which two routes overlap after re-verification? | `capture_conflict_trace` records the conflicting net IDs and the indices of their overlapping path components. |
| 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). |
### Find overlapping components
1. Enable `capture_conflict_trace` in the run's `DiagnosticsOptions`. In the returned `run.conflict_trace`, use the entry whose `stage` is `"final"` to inspect the paths the run returned.
2. Find the two net IDs in `conflict_edges`. In the matching `nets` entry, read `component_conflicts` for `self_component_index`, `other_net_id`, and `other_component_index`.
3. Index each net's `path` in `run.results_by_net` using those zero-based indices. Plot the components' `physical_geometry` on the board and check their spacing against the required clearance. See whether both components compete for the same opening.
For an earlier stage such as `restored_best`, read the net and component indices from that entry. The final paths may have changed during repair.
### Follow a late conflict into pair-local repair
Capture the no-warm-start fan-out scenario from the repository root.
Capture the conflict trace for fan-out with warm starts disabled. The best congestion iteration leaves two disjoint pairs of nets competing for space.
```sh
python -m scripts.record_iteration_trace --scenario example_07_large_scale_routing_no_warm_start \
python -m scripts.record_conflict_trace \
--scenario example_07_large_scale_routing_no_warm_start \
--output-dir /tmp/inire-trace
```
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).
1. Open `conflict_trace.json` and find `restored_best`. Six nets are complete and the conflict edges are `net_02` with `net_03` and `net_06` with `net_07`. For example, the entry for `net_02` reports that its component 1 overlaps component 1 of `net_03`. See the stage summary in the [recorded conflict trace](../archive/routing/conflict_trace.md#example_07_large_scale_routing_no_warm_start).
2. Compare with `final`. All ten nets verified and the conflict edges are empty. The staged trace shows that repair resolved conflicts remaining after the congestion iterations.
3. To compare expansions and congestion work in the iterations leading up to repair, substitute `scripts.record_iteration_trace` in the command. If you need the reroute order and per-net work immediately before repair, substitute `scripts.record_pre_pair_frontier_trace` and compare with the [recorded pre-pair trace](../archive/routing/pre_pair_frontier_trace.md).
Use the returned result to count final successes. For live progress during routing, pass an [`iteration_callback`](user/api-reference.md#route-a-problem).