Repository navigation
Description
P5 Motor vehicle costing and restrictions · key
P5.20· size L
Goal
The upstream gurka integration suites for access, restrictions, time-dependence and closures run against our engine on the ASCII-map DSL and pass.
Upstream reference (Valhalla 3.9.3)
test/gurka/
Scope
- Inventory the gurka test files in these areas and list them in the issue as a checklist.
- Port each onto the Zig ASCII-map DSL from P1.18, keeping test names traceable to the upstream file.
- Where a test asserts upstream's pruned (suboptimal) behaviour, assert the exact result instead and note the reason beside the test.
- Record any test that cannot be ported yet with the blocking issue key.
Pinned Gurka inventory
The Valhalla 3.9.3 tree at 5c7f918e61306521d79cc4496d40c19c5305fa4b contains 136 Gurka test files. The checklist covers their access, turn restrictions, time dependence, and closure cases. The Zig integration tests use ASCII maps and assembled native bundles. Source comments name the matching files. Checked entries have green local coverage. Open entries name the issue responsible for the remaining cases.
-
test_access.ccandtest_deadend_barrier.cc. PSV on ways and nodes, private driveway endpoints, denied and private barriers, directional overrides, and multimode tag processing are green. Full route worker correlation and service error cases depend on [P3.33] /route serializer for directions_type none: units, shape formats, ids #79P3.33. -
test_avoids.cc. Polygon, level, directed-edge and partial same-edge exclusions are green. Service limits and errors need [P1.13] Service skeleton: action routing, GET ?json= and POST, Valhalla error codes, service limits #28P1.13and [P3.33] /route serializer for directions_type none: units, shape formats, ids #79P3.33. The accelerated-path exclusion check needs [P4.07] Potentials in the search core: turn-cost folding and the relax-time admissibility assertion #96P4.07. -
test_barrier_uturns.cc. Break, break-through and forced-heading turnbacks are green, including reverse search. The blocked node permits only the return along the incoming edge. -
test_closure_annotations.cc. Closure annotation and response shape indices need [P6.05] Trip-leg builder: port of triplegbuilder.cc #144P6.05, [P6.13] Valhalla route serializer with maneuvers, lanes, signs and summaries #152P6.13and [P10.02] Live traffic overlay: record layout, lock-free reads, epoch, live-to-bound ratio #197P10.02. -
test_closure_penalty.cc. Escape from a closed start, penalty-factor route choice, and ignoring unavailable or disabled live traffic are green. Closure suffixes and the open bypass between two closed ends need [P5.20b] Route through closures explicitly admitted at trip endpoints #244P5.20b. -
test_conditional_restrictions.cc. Mode-specific time windows, endpoint and intermediate access, destination-only costs, and timed denials are green. Matrix and isochrone cases need [P7.02] Matrix v1: shared potential contexts per target, parallel exact searches, lower-bound pruning #159P7.02and [P7.07] Isochrone expansion into the grid with multiple time and distance contours #164P7.07. -
test_construction.cc. Build-time inclusion, omission of invalid construction and the routing override are green. Accelerated routing across construction edges needs [P4.07] Potentials in the search core: turn-cost folding and the relax-time admissibility assertion #96P4.07. -
test_costing_with_traffic.cc. Speed source resolution and clocked route cost are green with synthetic observations. Traffic codec and integrated costing cases need [P10.02] Live traffic overlay: record layout, lock-free reads, epoch, live-to-bound ratio #197P10.02, [P10.04] Predicted speeds: weekly profiles, SIMD DCT codec, deduplicated profile table #199P10.04and [P10.05] Traffic in costing and the admissibility floors #200P10.05. -
test_deadend.cc. The access-driven turnback and break-through behavior are green in the barrier and multi-location cases. The bidirectional action selection and serialized algorithm checks need [P3.33] /route serializer for directions_type none: units, shape formats, ids #79P3.33and [P6.13] Valhalla route serializer with maneuvers, lanes, signs and summaries #152P6.13. -
test_destination_only.cc. Tagged motor and HGV access, entry penalties, and zero-penalty shortcut route selection are green in both search directions. -
test_exclude_cash_only_tolls.cc. Default/false, opted-in bypass and no remaining gravel route are green in auto, bus, taxi and truck. -
test_exclude_unpaved_smoothness.cc. Interior exclusions, impassable smoothness, and explicit surface and track grade precedence are green. Replaying endpoint placement and default bidirectional dispatch uses [P3.33] /route serializer for directions_type none: units, shape formats, ids #79P3.33. -
test_ferry_connections.ccaccess and exclusion cases. Assembly and duration coverage is green, with route action and ferry snapping checks depending on [P3.33] /route serializer for directions_type none: units, shape formats, ids #79P3.33. -
test_hard_exclusions_bridge_tunnel_tolls.ccandtest_hard_exclusions_highways.cc. Default route, detour and exit from an excluded stretch are green. Service defaults and error output need [P1.13] Service skeleton: action routing, GET ?json= and POST, Valhalla error codes, service limits #28P1.13and [P3.33] /route serializer for directions_type none: units, shape formats, ids #79P3.33. -
test_hov.cc. HOV2, HOV3, HOT and ordinary access are covered by native assembly and costing checks. -
test_ignore_restrictions.cc. Simple turn overrides, timed allowance/denial and dimensions preserved by the non-vehicular override are green. Endpoint correlation with vehicle exceptions needs [P3.33] /route serializer for directions_type none: units, shape formats, ids #79P3.33. -
test_linear_feature_factors.ccandtest_use_feature.cc. Shape-based overrides need [P5.19a] Resolve and apply linear cost factors along exact edge walks #241P5.19a. -
test_not_thru_pruning.cc. The directed pruning hint leaves the sole legal native route available and eligible for exact comparison. -
test_oneways.cc. Mode-direction and reverse tag assembly, route direction, and one-way override coverage are green. Matrix and isochrone entries need [P7.02] Matrix v1: shared potential contexts per target, parallel exact searches, lower-bound pruning #159P7.02and [P7.07] Isochrone expansion into the grid with multiple time and distance contours #164P7.07. -
test_oneways_foot_bike.cc. Shared-road and footway direction rules, including reversed foot and bicycle directions, are green. -
test_only_restrictions.cc. Simple only turns and multi-via only restrictions across branches are green. -
test_permissible_dimensions.cc. Inclusive width, height, length and weight limits select the matching detour in both search directions for auto, bus, taxi and truck. Motorcycle and scooter still use the dimension-free path. -
test_probable_restrictions.cc. Builder and search support need [P5.20a] Build and enforce probability-tagged turn restrictions #243P5.20a. -
test_reach.cc. Reach with and without live closures is green. The upstream disabled second closure case involves terminal closure access, tracked in [P5.20b] Route through closures explicitly admitted at trip endpoints #244P5.20b. -
test_recost.cctime and access cases. Clocked fixed-path pricing and checked turns are green. Named recost API and response cases need [P5.19b] Serialize named recosts and score same-graph routes in zr diff #242P5.19b. -
test_restricted_area.cc. OSRM restricted classes need [P6.14] OSRM serializer: routes, legs, steps, intersections, banner and voice instructions #153P6.14. -
test_route.ccaccess, one-way and turn cases. Native policy tests cover both search directions. Route orchestration and deprecated request behavior need [P3.33] /route serializer for directions_type none: units, shape formats, ids #79P3.33and [P6.13] Valhalla route serializer with maneuvers, lanes, signs and summaries #152P6.13. -
test_search_filter.cc. Filtered correlation, live closure avoidance, level/class filters, temporal settings and option conflict are green. Remaining endpoint closures need [P5.20b] Route through closures explicitly admitted at trip endpoints #244P5.20b. Vehicle restriction correlation and endpoint response cases need [P3.33] /route serializer for directions_type none: units, shape formats, ids #79P3.33, and matrix needs [P7.02] Matrix v1: shared potential contexts per target, parallel exact searches, lower-bound pruning #159P7.02. -
test_simple_restrictions.cc. Direction-sensitive no-turn and only-turn detours, reverse traversal and ignore overrides are green. Matching coverage needs [P8.05] /trace_route API with shape_match modes and trace options #181P8.05. -
test_sump_buster.cc. Default motor bans, foot/bike access and explicit grants for other modes are green. -
test_time_dependent_restrictions.cc. Forward/reverse and invariant cases before, within and after the window are green. The via node's timezone is evaluated independently of either endpoint. -
test_time_dependent_tags.cc. Hour-only, weekday-only, combined and annual wrapping windows plus incomplete tag pairs are green in both directions. -
test_time_tracking.cc. Forward/reverse DST and timezone clocks, waits, and per-leg time retention are green. -
test_traffic.cc. Fixed closure observations have native coverage. Overlay updates and epoch-dependent access need [P10.02] Live traffic overlay: record layout, lock-free reads, epoch, live-to-bound ratio #197P10.02. Endpoint placement needs [P5.20b] Route through closures explicitly admitted at trip endpoints #244P5.20b, and geometry output needs [P6.05] Trip-leg builder: port of triplegbuilder.cc #144P6.05. -
test_traffic_smoothing.cc. Scalar source blending, live coverage/fade and free-flow versus constrained routes are green. End-to-end overlays and matching need [P10.02] Live traffic overlay: record layout, lock-free reads, epoch, live-to-bound ratio #197P10.02, [P10.04] Predicted speeds: weekly profiles, SIMD DCT codec, deduplicated profile table #199P10.04, [P10.05] Traffic in costing and the admissibility floors #200P10.05and [P8.04] Match results to a path: match_route, discontinuities, edge walking #180P8.04. -
test_truck.cc. Directional dimensions/hazmat, designated truck routes, speed caps and ordinary low-class entry costs are green. The signed low-class corner remains in [P5.12] Truck costing: full port of truckcost.cc with dimension, weight and hazmat checks #128P5.12. -
test_match.ccrestriction cases. Matching needs [P8.04] Match results to a path: match_route, discontinuities, edge walking #180P8.04and [P8.05] /trace_route API with shape_match modes and trace options #181P8.05.
Out of scope
- Narrative assertions inside these tests (Phase 6).
Design notes
- Upstream has 136 gurka files; this batch is the routing-behaviour subset. See docs/upstream/valhalla-architecture.md, section 7.
Acceptance criteria
- Checklist of ported files in this issue, each green or linked to a blocking issue.
- No Gurka case is silently skipped.
-
zig build testgreen.
Verification
Landed in 92b40d6 on main. The fresh pinned-toolchain build passed 433 tests, including all 84 Gurka tests, with two existing skips outside Gurka. Linux x86_64 test binaries cross-compiled, and Linux CI will execute them. The issue graph tests also passed. CI run
Blocked by
- [P5.10] Conditional and timed restrictions, access restrictions and their conditions #126
P5.10Conditional and timed restrictions, access restrictions and their conditions - [P5.15] Time-dependent search: depart_at, arrive_by, current, invariant, across timezones #131
P5.15Time-dependent search: depart_at, arrive_by, current, invariant, across timezones - [P5.16] Avoid and exclude: locations, polygons, edges and closures #132
P5.16Avoid and exclude: locations, polygons, edges and closures - [P5.17] Destination-only, private access and not-thru semantics in an exact search #133
P5.17Destination-only, private access and not-thru semantics in an exact search
Rules for working on this repository are in AGENTS.md. The plan is in docs/PLAN.md.
Activity
chrisbbreuer commentedon Nov 20, 2026
All ten jobs passed on CI run 44712640840, including macOS and Ubuntu tests, the binary size budget and all four release targets. The issue graph run passed as well.