fix(xodr): preserve the five warned-and-dropped spec areas (#539) - #556
Merged
Conversation
fmt-f2. <lateralProfile><shape> and the legacy <crossfall> (§10.5.1), road <surface>/<CRG> (§10.6), <junctionGroup> (§12.16), <railroad> and root <station> (chapter 15), and an <include> outside <header> (§7.1). These were LOUD and lossy: one diagnostic, then permanent data loss — worse than a silent drop in one respect, because the file looked like it had been understood. A round trip flattened a non-planar carriageway, dropped a CRG-referenced surface, made the standard's own roundabout grouping unrepresentable, and lost a tram file's rail layer. All five reuse #453's capture_unmodeled() rather than adding five more walks; the change is a set of modeled-member lists plus three writer emission points. That reuse is what fmt-f1 was shaped for. The diagnostic is downgraded too, and that is half the fix. "is not supported yet and was ignored" was TRUE before and is a lie now. note_preserved() says "is preserved verbatim but not modeled; it round-trips unchanged and has no effect in this build" — a user needs the second half without being told the first, since a preserved <shape> still will not bend the carriageway. Nothing here is modeled and none of it needs to be for v0.1.0; modeling stays with whoever owns the feature later (<junctionGroup> with #495). Fixes #539
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.
The defect
Five spec areas were warned about and then thrown away — one diagnostic,
then permanent data loss:
<lateralProfile><shape>, legacy<crossfall><surface>/<CRG><junctionGroup><railroad>, root<station><include>outside<header>Loud-and-lossy is worse than silent in one respect: the file looked like it had
been understood.
What landed
All five ride the preserved tier built for #453 — reusing
capture_unmodeled()rather than adding five more walks. The change is a setof modeled-member lists plus three writer emission points; that reuse is exactly
what fmt-f1 was shaped for.
Three new homes for the fragments:
Road::lateral_profile_extras,Road::road_extras, andRoadNetwork::preserved_root_children()(a sibling ofpreserved_user_data(), separate because the writer emits the two in differentplaces).
The diagnostic downgrade is half the fix. "is not supported yet and was
ignored" was true before and is a lie now.
note_preserved()says "ispreserved verbatim but not modeled; it round-trips unchanged and has no effect
in this build" — the user needs the second half without being told the first,
since a preserved
<shape>still will not bend the carriageway.Nothing here is modeled, and none of it needs to be for v0.1.0. Modeling stays
with whoever owns the feature later —
<junctionGroup>with #495.Tests
New corpus seed
preserved_sweep.xodrcarrying all five areas.TheWarnedAndDroppedScopesNowSurviveWriteParseWrite— all eight markers inthe emitted bytes, plus the content (
file="pavement.crg",junction="101",file="extra_geometry.xodr"): a writer emitting an empty<shape/>would satisfy a tag-only search while still having flattened thecarriageway. Then the write→parse→write fixed point.
TheSweptScopesSayPreservedRatherThanIgnored— asserts the new wordingappears and that the old "was ignored" claim does not. A fix that
preserved the data while still saying it was discarded would pass a
preservation-only check.
Sabotage-verified: reverting root children to warn-and-drop failed both.
Verification
ctest --preset ci-macos— 3281/3281 passpytest python/tests— 541 passed, 1 skippedclang-formatcleanFixes #539