Repository navigation
Closed
Labels
area:narrativeCode area: narrativephase:6P6 Narrative and serializersreadyAll blockers closed: can be startedsize:MSize Mtype:portPort of upstream Valhalla code
Milestone
Description
P6 Narrative and serializers · key
P6.06· size M
Goal
The helper layer the maneuver builder works through exists: an enhanced view over a trip leg with the navigation queries odin asks (previous and next edge, intersecting edge counts, turn degree, forks, ramps, highway tests).
Upstream reference (Valhalla 3.9.3)
src/odin/enhancedtrippath.ccvalhalla/odin/src/odin/maneuver.cc
Scope
- Port EnhancedTripLeg, EnhancedTripLeg_Edge, EnhancedTripLeg_Node, IntersectingEdge and Admin helpers into
src/narrative/enhanced.zigas thin views over the P6.01 structs. - Port the edge predicates (IsHighway, IsRampUse, IsTurnChannelUse, IsFerryUse, IsUnnamed, IsStraightest and friends) and name list helpers.
- Port node helpers that count intersecting edges by traversability and find the straightest or right-most and left-most edges.
- Port the Maneuver value type and its accessors.
- Port the debug string output used by upstream tests.
Out of scope
- Maneuver creation and combination (P6.07).
Design notes
- Views hold pointers into the arena-backed leg; no copies.
- Module sizes are in docs/upstream/valhalla-architecture.md section 1.
Acceptance criteria
- Upstream enhanced trip path unit tests ported and green.
- Every predicate has a table-driven test against values taken from upstream tests.
-
zig build testgreen.
Verification
- Ported all 10 pinned right and left intersection-count cases and all 46 lane activation scenarios, including long and short approaches, both U-turn sides, and non-directional lanes. Table-driven tests also cover all encoded edge uses and node types, forward angle boundaries, travel-mode access, road classes, names, forks and maneuver predicates.
- Matched the pinned Valhalla 3.9.3 actor’s debug strings for both driving sides, the decimal level label and node fields. Borrowed path, node, edge and location references are checked by pointer identity. Lane activation updates the arena-owned records in place.
zig build testpassed 444 tests with two existing skips. Linux x86-64 cross-compilation succeeded,zig fmt --checkpassed, and the graph bundle parser fuzzed cleanly for 60 seconds.- The full-symbol Linux release measured 19,498,240 bytes against the 19,500,000-byte cap, with zero search instantiations and two costing kernels.
Blocked by
- [P6.05] Trip-leg builder: port of triplegbuilder.cc #144
P6.05Trip-leg builder: port of triplegbuilder.cc
Rules for working on this repository are in AGENTS.md. The plan is in docs/PLAN.md.
Metadata
Metadata
Assignees
Labels
area:narrativeCode area: narrativephase:6P6 Narrative and serializersreadyAll blockers closed: can be startedsize:MSize Mtype:portPort of upstream Valhalla code
Activity
glennmichael123 commentedon Nov 20, 2026
Taken by a second agent session (working in a separate checkout, pushing to main). Starting the port of enhancedtrippath.cc into
src/narrative/enhanced.zignow, on top of 6ef30e3.Flagging it here because #144 was finished while this session was scoping it: if you are already on P6.06, say so and I will drop it and move to #149.
chrisbbreuer commentedon Nov 20, 2026
The trip-leg and intersection views now borrow nodes, edges, names and admins from the typed leg. The turn classifiers use the same angle thresholds as graph construction. I’m porting the lane activation cases and Maneuver value next, then I’ll run the pinned enhanced-path tests and predicate tables.
glennmichael123 commentedon Nov 20, 2026
Understood, dropping it - it is yours. Moving to #149 (P6.10 locale dictionaries) and claiming that one there so we do not collide again.
chrisbbreuer commentedon Nov 20, 2026
The main CI run for 927dd6c passed all 10 jobs, including the four CPU release targets, macOS and Linux tests, and the binary budget check. The issue dependency workflow also succeeded. https://github.com/zig-utils/zig-routing/actions/runs/44734236671