fix(xodr): round-trip virtual-junction linkage and connection internals (#537) - #558
Merged
Conversation
…ls (#537) Three holes, all in MODELED scopes that #453's preservation sweep deliberately does not cover. @elementS/@elementDir were read nowhere. asam.net:xodr:1.7.0:road.linkage.virtjunc_link_attribute_usage REQUIRES both on a <link> pointing at a virtual junction; read_link took only elementType/elementId/contactPoint, with no diagnostic, so a conformant file lost its virtual-junction linkage on the first save. They ride RoadLink now and are written back only when the source carried them — an ordinary road link, where the standard forbids them, stays byte-identical. A virtual junction's own <connection>s were DELETED. §12.7 permits them, but arms-xor-spans cleared the list: warned, then destroyed. They are preserved instead — held out of `connections` so nothing tries to build geometry from them (arms-xor-spans still holds for GENERATION, which is what it is actually about) and re-emitted unchanged. <connection> @type and non-<laneLink> children were dropped. @id regeneration is benign because the writer renumbers deterministically; @type is not. Built on #534's junction test scaffolding, as the issue intended. Fixes #537
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.
Three fidelity holes, all in modeled scopes that #453's preservation sweep
deliberately does not cover. Built on #534's junction test scaffolding, as the
issue intended.
1.
@elementS/@elementDirwere read nowhereasam.net:xodr:1.7.0:road.linkage.virtjunc_link_attribute_usagerequiresboth on a
<link>pointing at a virtual junction.read_linktook onlyelementType/elementId/contactPoint, with no diagnostic, andwrite_link_elementnever emitted them — so a spec-conformant file lost itsvirtual-junction linkage on the first save.
They ride
RoadLinknow (element_sas an optional,element_dirverbatim —it is a two-value enumeration whose spelling is the whole content) and are
written back only when the source carried them. An ordinary road link, where
the standard forbids them, stays byte-identical; there is a test for exactly
that, because "write them always" would churn every fixture in the suite and
assert something the spec disallows.
2. A virtual junction's own
<connection>s were deleted§12.7 permits them, but the arms-xor-spans policy cleared the list — warned, and
then destroyed the data.
They are preserved now, in
Junction::preserved_connections: held out ofconnectionsso nothing tries to build geometry from them, and re-emittedunchanged. Worth being precise about why that is not a contradiction —
arms-xor-spans is about generation. A span junction never cuts its main
road, so there is nothing to derive; that stays true. What was wrong was
concluding the file's data must therefore be discarded.
3.
<connection>@typeand non-<laneLink>children were droppedThe reader iterated
children("laneLink")only.@idregeneration is benign —the writer renumbers connections deterministically — but
@type(§12.3Table 61) carries meaning the file owns, and anything a later revision adds was
vanishing too.
Tests
New corpus seed
virtual_junction_links.xodr: a road linking into a virtualjunction with
@elementS/@elementDiron both ends, and a junctiondeclaring a connection that carries
@typeand an unmodeled child — so cases 2and 3 ride together.
VirtualJunctionLinkageAndConnectionsSurviveWriteParseWriteasserts the model,then the bytes (a model-only check passes on a writer that emits none of
it), then the fixed point.
AnOrdinaryRoadLinkWritesNoElementSOrDirpins thebyte-stability of every other link.
Sabotage-verified: re-deleting the virtual junction's connections failed the
round-trip test.
Verification
ctest --preset ci-macos— 3283/3283 passpytest python/tests— 541 passed, 1 skippedclang-formatcleanFixes #537