textures: report verified zlib segments for descriptor pages #276
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/280"
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-21T20:27:50Z.
Change
Add
--zlib-segment INDEXto the ETPF descriptor CLI. A codec-8 interval can include trailing alignment bytes. The range reader needs the exact length of the compressed stream. The new mode verifies that length for the interval containing a selected descriptor's first page and reports asegmentobject accepted directly bySegment(**report["segment"]). The additional offsets identify the segment's logical start and the page's position within that segment.The descriptor lookup and boundary checks are shared with the raw-page mode. This zlib mode reads and decompresses the selected interval in memory, with a 1 MiB limit on each of its stored and decoded lengths. It returns metadata after the stream reaches checked EOF, produces the declared logical size and has only zero bytes after its Adler-32 trailer. Usage.
Verification
Windows 11 x64, Python 3.12.10,
978186bon upstream7cb3c9b.The prior CLI exited 2 on
--zlib-segment 0; the new CLI test and focused CTest failed. The synthetic file has a 512-byte physical interval containing one 37-byte zlib stream that decodes to 8,192 bytes. Using 512 as the stored length failed the strict reader. The new CLI returned a stored length of 37. Passing the reported segment unchanged toPagedResourcereproduced all 4,096 bytes of its second page. All fourteen Python checks and the focused CTest passed.Evidence and follow-up
The original MIT-licensed fixture compresses two distinct page patterns with Python's standard library and appends zero padding. Negative controls cover altered Adler-32, incomplete stream, short or long decoded size, a second zlib member, a nonzero suffix, and a non-zlib codec. A guarded stream fails on reads outside the metadata or the one selected interval. Separate oversized stored and decoded spans must fail before a payload read. The tool emits offsets, byte counts and codec type, and writes no decoded payload.
AI-assisted contribution.
Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T20:27:59Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
978186bℹ️ 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.