shader: preserve length-prefixed record names in extraction #240
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/243"
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-21T19:05:29Z.
Change
Add
--length-prefixed-namesfor archives whose record names carry a one-byte length that includes the terminator. In this mode a matching printable length byte stays out of manifest names and output filenames. A matching prefix already present before the printable run takes precedence, so genuine leading punctuation survives.The default keeps the full printable run. A prefixless 80-byte name beginning with
Pcan be byte-identical to a 79-byte name preceded by the length byteP. The caller chooses the format when it is known.Verification
Windows 11 build 26200.9974, Visual Studio Build Tools 2022 17.14.45, Python 3.12.10, CMake 3.31.6.
python -B tests/rdna2_tools_check.py -k test_extracted_names_round_trip_length_prefixed_recordswith the initial source-built fixture onf85723e: failed for 33-byte and 125-byte names because the manifest retained their printable prefixes.out/pe-env/Scripts/python.exe -B tests/rdna2_tools_check.py -k test_ambiguous_length_prefix_requires_explicit_modeon the initial PR heada9948d4: reproduced the review report that default extraction removed thePfrom a prefixless 80-byte name. The opt-in switch was absent at that head.out/pe-env/Scripts/python.exe -B tests/rdna2_tools_check.py -k test_ambiguous_length_prefix_requires_explicit_mode -k test_extracted_names_round_trip_length_prefixed_records: both tests passed at3fe72f9.cmake --preset devandcmake --build --preset dev --target root_probe DualUav.cso triangle_ps.cso: configured and built source-owned shader and host fixtures in a fresh build directory.ctest --preset dev --no-tests=error -R '^(rdna2_tools_check|compressed_scene_metadata|dxcontainer_part_offsets)$' -V: 3/3 passed at3fe72f9. The existing optional LLVM subtest insiderdna2_tools_checkskipped locally because the complete LLVM toolchain was unavailable. The other 18 Python tests passed.git diff --check: passed.Evidence and follow-up
The MIT-licensed regression builds its own archive envelopes. It tests both CLI modes on byte-identical input, verifying both manifest names and output filenames. In explicit mode the extracted names round-trip through
pixel_aot.native_program. Further controls cover short names, genuine leading punctuation, the transition from printable length byte 126 to nonprintable 127, a 127-byte name, a legacy name without a recognized prefix, and a truncated record.A read-only local metadata comparison captured 26,503 records. The default mode emitted the same names and stage counts as the prior extractor. With
--length-prefixed-namesenabled, 24,795 names lost exactly one byte matching the encoded length. In 191 of those entries, later name bytes also fit a shorter suffix length. The 1,377 distinct names shared by multiple records still require separate lookup context.For the first 12 pixel manifest entries, enabling the option reduced missing-name errors from 7 to 0 and increased successful native lookups from 2 to 7. The other five lookups reported
Expected one aligned, terminated programafter name resolution. The comparison retained aggregate metadata only.Checklist
AI-assisted with Codex.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T19:09:50Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
a9948d4d7fℹ️ 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 Vonsek on 2026-11-21T19:13:42Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T19:16:27Z.
@codex review
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T19:19:52Z.
Codex Review: Didn't find any major issues. Keep them coming!
Reviewed commit:
3fe72f9bd1ℹ️ 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-21T19:05:41Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
3fe72f9ℹ️ 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.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T19:09:50Z.
Code review location:
tools/extract_shaders.py; line 172For a prefixless record named
b"PS_" + b"L" * 77, the printable run is 80 bytes and its first byte is also 80 (P). This condition therefore removes the genuineP, silently changing both the manifest name and output filename toS_.... I reproduced this usingenvelope(code, name)[1:], the same legacy format retained by the new test: the parent preserves the name, while this commit truncates it. Disambiguate prefixed records from the legacy fallback before removing the first byte; byte-length equality alone also matches legitimate names.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T19:13:42Z.
Code review location:
tools/extract_shaders.py; line 172The reproducer is valid. The 80-byte prefixless
PS_…record and the 79-byteS_…record prefixed byPare byte-identical. Commit3fe72f9keeps the old printable-run interpretation by default and adds--length-prefixed-namesfor callers who know the archive format. The new CLI regression feeds both modes the same bytes and checks the manifest names, filenames, and synthetic payload. Both targeted tests and all three focused CTests passed locally. A guarded metadata comparison also confirmed the default emitted the same 26,503 names as the previous extractor.