textures: inventory bounded ETPF descriptor tables #262
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/266"
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:47:24Z.
Change
Add a read-only inventory of texture dimensions, DXGI format numbers and mip-marker bytes from the first raw ETPF table in an RDS5 archive. This gives an independent source for the explicit base dimensions used by the late BC7 tail check. The marker is recorded as its original byte. Establishing which mip is resident at runtime requires separate evidence.
The existing range reader reads the initial and terminal boundaries, checks the descriptor table against both the stored and logical extent of its chunk, and verifies each descriptor's 4 KiB page address against the declared virtual size. The CLI groups matching descriptors and prints JSON. This inventory profile accepts at most 1 MiB of descriptor records per archive (65,536 entries). Command and field layout.
Verification
Windows 11 x64, Python 3.12.10, commit
dad7776on upstream7233cec.Before implementation the CLI test exited 2 because the tool was absent, and the bounds test could not import the reader. An intermediate exact-EOF check rejected valid declared ranges when the test appended 256 unrelated trailing bytes. With the patch, all eight Python tests passed and CTest passed in 0.22 seconds. The synthetic CLI run reported 258 descriptors grouped as 257 with a 44×12 extent, DXGI 99 and marker 2, and one with a 12×44 extent, DXGI 71 and marker 0.
Evidence and follow-up
The fixtures are original MIT-licensed Python constructions. They include distinct reserved and codec bits, a table spanning a 4 KiB read boundary, an individually invalid last descriptor, a truncated file, inconsistent physical and virtual extents, and a declared table over the 1 MiB limit. The guarded input rejects reads outside the outer header, counted boundary, and descriptor table, or any read longer than 4 KiB.
The independently written reader uses the descriptor fields documented by PercyStar. It adds no external code or dependency. It validates the ranges needed by the inventory and leaves later chunk contents unread.
AI-assisted contribution.
Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T19:47:36Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
dad7776ℹ️ 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.