No description
  • JavaScript 96.9%
  • CSS 2.9%
  • HTML 0.2%
Find a file
mj 1faf8bd322 navi-offroute: vectorize road_terminus_transitions (O2b, perf)
Replace the per-road-cell Python 8-neighbour scan with a single 3x3 binary
dilation of the off-network mask (scipy.ndimage), AND'd with the road/track
mask. `border_value=0` treats out-of-bounds neighbours as on-network, matching
the scalar version's OOB skip -- NOT np.roll, which would wrap the raster edges
and fabricate phantom neighbours. A road cell is never off-network itself, so
dilating with the centre included is equivalent to the loop's strict-neighbour
test; the surviving cell set and the 2 directed foot<->vehicle tuples per cell
are identical (only emission order differs; cap/kernel are order-independent).

Synthetic eyeball benchmark (1234x470, dense road block, worst case for the
loop's early-break): scalar 843 ms -> vector 9.3 ms; set-equal True. Targets the
~3.75s road_terminus stage of Route B's gather_transition_cells.

Adds test_road_terminus_dilation_no_wrap (np.roll regression guard); existing
test_road_terminus_transitions_pure_raster + gather/cost parity tests unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 02:45:18 -06:00
backend navi-offroute: vectorize road_terminus_transitions (O2b, perf) 2026-05-28 02:45:18 -06:00
frontend navi-offroute: tighten hybrid gates + fix hybrid render (#34) 2026-05-26 17:29:17 -06:00