tooling: validate relocated resource roots against their schemas #311
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/316"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T21:51:33Z.
Change
The same little-endian PRD0 v0x7a header marker occurs in archived resources from different subsystems. This command identifies the numeric root type and its verified byte size within one explicitly sized zlib member. It checks the root's one-based index, both relocated directory spans, the root span and its independent schema row. The CLI reports only the hash and byte count.
The new experiment describes the observed profile. #186 checks matching sizes in the section-based script tree walker. That walker uses separately serialized instance/schema sections and a five-array 80-byte root. This reader uses relocated virtual addresses and the directory of the supplied member. It shares the existing bounded zlib reader.
Verification
Commit
03d3211930cb5d2d3322c776bb4e9c93d463801e, baseb53bfb0b6489398aba7a81f3761e2d56aaa00ccf, Windows x64, Python 3.12.python -B tests/resource_root_check.py RootChecks.test_member_cli: before the reader existed the normal command returned exit 2 and the test failed. On this commit the fixture reports the expected root hash and byte size.python -m venv out/pe-env,out/pe-env/Scripts/python.exe -m pip install -r requirements-dev.txt,. ./tools/dev.ps1andcmake --preset devsucceeded.ctest --preset dev --no-tests=error -R '^(resource_relocated_root|resource_range_controls|script_state_literals|docs_links)$' --output-on-failurepassed all four tests.git diff --check HEAD^ HEADpassed.Evidence and follow-up
The original MIT-licensed fixture stores two distinct types in opposite schema/block orders. Selecting indices 1 and 2 reports different roots. Controls reject mismatched sizes, an ambiguous root schema, metadata aliasing, out-of-member pointers, incorrect stored length, and an over-budget member before a read.
For local verification, three nonoverlapping 8 MiB windows per archive (start, middle and end) were searched at 16-byte alignment. The survey allowed up to 512 KiB of stored bytes and 2 MiB of decoded bytes per candidate and required checksum-verified EOF. Of 616 marked animation-archive members, 556 contained the full required extents and shared a 352-byte root type. Two controls from the same package yielded 189 of 211 navigation members with a different 304-byte root, and 43 of 63 pack members with a third, 192-byte root. These observations establish directory and schema relationships for the measured profile. Animation class names, clip counts and playback were not established. All local assets stayed out of the repository.
The reader was independently implemented from the measured header fields and the public metadata row layouts and one-based root lookup. CodeWalker documents an older header version. The version-specific reference checks the marker and pointer offsets. Neither source was copied.
Checklist
This contribution was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T21:58:58Z.
At
03d3211the merge conflicts are inREADME.md. Retain the schema-validation documentation alongside #298's descriptor lookup.Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T22:04:36Z.
The README at
61ae89ekeeps the relocated-root schema experiment and the texture descriptor-key lookup from #298, including itsresource_range_controlsselector. The four selected CTest cases passed locally, and all three CI jobs passed on this commit.@codex review
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T22:07:08Z.
Codex Review: Didn't find any major issues. More of your lovely PRs please.
Reviewed commit:
61ae89e953ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T21:51:44Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
61ae89eℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.