Skip to content

fix(xodr): preserve the five warned-and-dropped spec areas (#539) - #556

Merged
JArmandoAnaya merged 1 commit into
mainfrom
feat/539-fmt-f2-sweep
Aug 1, 2026
Merged

fix(xodr): preserve the five warned-and-dropped spec areas (#539)#556
JArmandoAnaya merged 1 commit into
mainfrom
feat/539-fmt-f2-sweep

Conversation

@JArmandoAnaya

Copy link
Copy Markdown
Contributor

The defect

Five spec areas were warned about and then thrown away — one diagnostic,
then permanent data loss:

Element Spec What a save destroyed
<lateralProfile><shape>, legacy <crossfall> §10.5.1 flattened a non-planar carriageway
road <surface>/<CRG> §10.6 the referenced surface detail
<junctionGroup> §12.16 the standard's own roundabout grouping (#495)
<railroad>, root <station> chapter 15 a tram file's rail layer
<include> outside <header> §7.1 the include itself

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 #453reusing
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 exactly
what fmt-f1 was shaped for.

Three new homes for the fragments: Road::lateral_profile_extras,
Road::road_extras, and RoadNetwork::preserved_root_children() (a sibling of
preserved_user_data(), separate because the writer emits the two in different
places).

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 "is
preserved 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.xodr carrying all five areas.

  • TheWarnedAndDroppedScopesNowSurviveWriteParseWrite — all eight markers in
    the 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 the
    carriageway. Then the write→parse→write fixed point.
  • TheSweptScopesSayPreservedRatherThanIgnored — asserts the new wording
    appears 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-macos3281/3281 pass
  • pytest python/tests541 passed, 1 skipped
  • clang-format clean

Fixes #539

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
@JArmandoAnaya
JArmandoAnaya merged commit 15f893a into main Aug 1, 2026
16 checks passed
@JArmandoAnaya
JArmandoAnaya deleted the feat/539-fmt-f2-sweep branch August 1, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fmt-f2: preserved-tier sweep — lateralProfile <shape>/<crossfall>, road <surface>/<CRG>, <junctionGroup>, <railroad>/<station>, root <include>

1 participant