D73 — Router hot-path optimisations¶
Decision¶
Router hot paths (doc 05 §28): the net class of every net is resolved once when the router is built (no name matching per lattice point); rule-lookup probe items come from a per-thread pool; a cell's via check is skipped when no other layer could improve at the bare via cost; a new via's routed-copper check tests layer-independent parts once; PathFinder history is read once per cell per search; second round: one-pass fixed via codes (fixed_via_code_reference kept and tested), no shape allocation in hot checks, degenerate-segment fast path in seg_seg_closer (tested exact). The skipped via checks cannot improve any state, but they leave fewer via codes cached, so the cost-to-go field sees fewer known via-blocked cells and expansion counts change slightly; since --work counts expansions, identical output is empirical (48 of 48 boards at the merge, doc 05 §28), not guaranteed. Only fixed_via_code and seg_seg_closer have reference tests; the other equivalences were checked by reading.
Alternatives¶
Fewer route-check variants or a smaller work budget in the placement loop (changes results); a mutable class cache inside DesignRules (shared across threads); small-buffer shapes to remove the remaining point allocations (wide refactor)
Reason¶
The 20M-work route check on a 0.05 mm lattice went from ~140 s to ~10 s, which makes routability-driven placement with project rules practical; the second round removes a further ~20% of CPU time (measured by instructions retired, since timings are noisy on a shared machine)