textures: honor declared zero padding in raw page maps #286
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/290"
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:57:47Z.
Change
Extend the raw descriptor page map to account for a declared alignment suffix in a raw interval. The 12 high bits of the interval's starting boundary give the trailing-byte count. For unequal lengths the count must equal the excess of stored length over logical length, and every byte in that suffix must be zero. Equal-size ranges retain their original metadata-only mapping. The reader then maps the logical prefix at the stored interval start. The reported offsets and 4 KiB page size are unchanged. Usage and field reference.
Verification
Windows 11 x64, Python 3.12.10, commit
a809eb23ae46235c1a64f18124de7f9da19cff5fon upstreamd311159b7ba56f4c75c10c1dd8c4303988c80d99.Before the change both the Python regression and its CTest failed with
Raw mapping requires equal stored and logical range sizes. The new control puts a 1,280-byte zero suffix after a two-page raw payload, gives its next boundary a different count, and verifies that the second logical page still maps to file offset 8,704. All fifteen Python tests and the focused CTest passed.Evidence and follow-up
The input is an original MIT-licensed Python fixture. Its guarded stream permits only metadata and the padding range to be read. It rejects a wrong neighboring count, a truncated count, a nonzero first or last suffix byte, and premature EOF during the suffix read. A short-read guard reproduces the original equal-size mapping even with nonzero high bits and permits no suffix read in that case. The suffix check reads at most 4,095 bytes and does not interpret texture pixels or subresource layout. This change shares the indexed interval lookup integrated by #280.
AI-assisted contribution.
Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T20:57:58Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
a809eb2ℹ️ 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.