Reject directionally illegal route fallbacks - #104
Merged
pfeiferj merged 1 commit intoAug 9, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MatchingWays.StartPositionat the junction.Motivation
NextWayalready rejected reverse one-way candidates in its preferred and generic candidate paths, but the final fallback returned rawmatchingWays[0]. The audit's two-road fixture therefore returned way 2 withIsForward=falseeven though leaving the junction required reversing along a one-way road.That impossible predicted path can feed recursive route prediction, upcoming speed-limit, advisory-speed, and hazard scans, curve generation, and extended path output.
Legality must be established before the soft heuristics. Filtering only the final fallback is insufficient: on freeways, an illegal preferred non-service road can make the freeway filter discard the only legal service or access alternative before fallback.
Behavior
68813e05de30289StartPositionStartPositionThe first row is the executed audit reproduction. The remaining rows are deterministic static source-path outcomes against Base and Head, not executed tests. Sharp-turn rows deliberately place the candidate above the active curvature threshold so they exercise the unchanged final fallback.
Validation
make buildjob on exact commitde30289.Compatibility
NextWaysand downstream consumer implementations and interfaces are unchanged; they now receive only legal continuations or the no-way sentinel.oneway=yes) are rejected at their repeated endpoint by the now-universal filter for as long asIsForwardFromclassifies that match as reverse; PR #105's closed-way clause restores forward classification there. Land Preserve OSM one-way direction during generation #105's runtime change with or before this one — a trial merge of both auto-merges cleanly, builds, and passes the full test suite, with Preserve OSM one-way direction during generation #105's clause preventing this filter from discarding one-way roundabout rings.