Skip to content

v1.4: preserve consecutive livery parent/child transforms - #30

Draft
Datamining00 wants to merge 4 commits into
v1.4-parser-structural-auditfrom
v1.4-consecutive-transform-pair-fix
Draft

v1.4: preserve consecutive livery parent/child transforms#30
Datamining00 wants to merge 4 commits into
v1.4-parser-structural-auditfrom
v1.4-consecutive-transform-pair-fix

Conversation

@Datamining00

@Datamining00 Datamining00 commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Fix derivative of v1.4-parser-structural-audit.

Root cause confirmed by the ownership trace

The supplied Parent Ownership Diagnostic shows that the earlier bare-parent recovery at offset 271968 is now correct: it owns exactly two child groups (272009 and 272321). However, the remaining central XANADU / THE NEW WORLD artwork is a different parser failure.

The raw stream around offset 269788 contains:

  • a parent transform (-360.5, -31.0, 0.9000001, 3.5);
  • immediately after it, the exact extended child marker 00 02 00 01 00 00 00 03 with child transform (0.0125732, 2.4793174, 0.05000036, 0);
  • then the first counted child group at 269828.

Unlike the previous bare-parent case, this parent is already recognized by the pinned decoder as a normal zero-marker livery transform. The bug is that walk_step() stores only one pending_transform; when the extended child transform follows, it replaces the already-recognized parent instead of preserving parent/child ownership.

The result is structurally valid layer counts but a wrong GroupNode tree, which explains why Structural Audit v2 correctly reported unframed_transform_candidate_count = 0 while the artwork was still misplaced.

Fix

Adds a narrow consecutive-transform grammar rule:

  • requires an existing clean pending parent whose marker is exactly 00;
  • requires the current record to use the exact extended child marker 00 02 00 01 00 00 00 03;
  • requires a valid livery group boundary immediately after the child transform;
  • materializes the pending parent as an implicit two-child GroupNode;
  • keeps the second transform pending for the first child group;
  • relies on the existing stack completion logic to keep the parent open for the second child.

No car ID, section name, phrase, creator, source offset, or coordinate is hard-coded. No layer reversal, mask rule, source-offset normalization, or renderer/projection behavior is changed.

Validation

  • Windows CI: success.
  • Full regression suite: 178 tests, OK.
  • New consecutive-transform regression tests: all passed.
  • PyInstaller one-file build: success.
  • EXE SHA-256: 5a386de6a7f61b27e5cfdbbbb5606685e8fda5fe4356856f73ae60f63af595b1.
  • Artifact ZIP SHA-256: fbf532baebfaeb72b0316070010031e1aa1054f2a3e1d7d72644f7534607bea6.

Validation target

On the supplied Livery_0343 Right section, this should move the currently central XANADU/THE NEW WORLD group family under its real parent transform instead of leaving it around the character face.

This PR stays draft until the real livery is visually checked.

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.

1 participant