Tests: retail_ttpf_textures_detile_with_their_mip_chains only passes on the one archive it was written for #707
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl#707
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@einfachama on GitHub · 2026-11-24 03:56 UTC · original
retail_ttpf_textures_detile_with_their_mip_chainsfails on most texture archives of my retail title withmip chain model: a / b. Two of those failures are exactly the ones the Quadro RTX 8000 report in #42 shows(835 / 1159 and 661 / 776). This is not a GPU or driver difference: the size check is CPU-only. As far as the
archives can show, it isn't XCL's GFX10 size model either. The test's reading of the archive fits the archive
it was written against (912 textures, 3 volume LUTs: the README's "909 of 912") and not the others.
XCL_SAMPLE_TTPFis documented only as "texture archive", so anyone who picks another one gets a failure thatlooks like a model bug.
What I measured (main
9ce2070). A throwaway script outside the repo read only each archive's texturetable and compared
gpu::texture::placement(...).byteswith each texture's slot, exactly as the test does.Counts only; no texture data was read.
too, but none of them has volume textures, so they'd fail the volume assert. Every other archive fails,
at 27–97 % fit (leaving aside one archive with a single texture). Mine in #42 was 3 732 / 9 156.
mip levels than the 4-bit
dword0 >> 28field gives. The largest group is "1 mip" entries whose slotholds exactly 3. The extra levels line up with fields the test doesn't read: the bits above 21 of the
texture's third dword, and the low nibble of its fourth. For example, low nibble 8 → +2 levels in every case.
No single field decodes cleanly, so I haven't guessed a rule.
That's the fixed
+ 0x800start offset; the next texture doesn't always have that lead-in.Open question: mipped cubes. Most cubes with mips match no layout I tried: any mip count, the other
swizzle modes, six separate faces, faces padded to 64 KB, a 2D array of 6, or 64 KB rounding. HANDOFF already
lists 2 cubes as outliers in the 912-texture archive.
xg_oraclechecks 6-slice mipped layouts against theconsole library, so I'd guess an archive layout rather than a model gap, but these numbers can't show which.
If it were the model, mipped cubes in titles would detile wrongly. A mip-smoothness check on cube faces, as
the test does for 2D, would settle it.
Proposal (asking before writing anything):
fail with a message that names the expected archive by its properties (912 textures, 3 volume LUTs).
Today it fails with a bare
mip chain model: a / b. No assertion changes on the right archive. Test-only,about 20 lines in
gpu/texture.rs.XCL_SAMPLE_TTPFas that archive rather than "texture archive".+ 0x800, accept 64 KB padding,and add the cube smoothness check.
Would you take 1 + 2 as one small PR, or rather see 3?
Tested
9ce2070: table only, no texture data.cargo test --workspace -- --test-threads=4withXCL_SAMPLE_TTPFon one archive,683 passed / 1 failed (this test).
Not tested
AI use
the repo, and drafted this issue. I reviewed it before posting.
@thehollowedone on GitHub · 2026-11-25 07:43 UTC · original
I worked through the cases left in the TTPF test and have a test-only patch against
568e7db. It includes the mip-count correction from #1245. If that PR lands first, reuse its mip-count line.0x800. Subtract the padding in bits 52–63 from the next file offset to get the exact packed extent. Dispatch raw, zlib, or the existing BCPack decoder by tag. Require the expected unpacked length, and validate the end marker against the file length and header stream length plus0x800.SW_4KB_Schain after lower-resolution tiers. Locate the full tier at the entry end minus its footprint, rounded to 64 KiB for modes 0 and 3. Require a block boundary there. Each earlier tier starts one mip lower than the next. Compare overlapping mips face by face, byte for byte.A8_UNORMmip can be uniformly clear while the next larger mip has nonzero alpha. For a uniform larger mip, that box-filter discrepancy persists under every texel ordering. Report box-filter error diagnostically for A8. Still verify its layout, detile all its mips, and run the applicable mip-tail control. Keep the color-mip assertion. The synthetic regressions accept a cleared A8 mip and reject the same chain as R8. DirectXTex alpha-coverage documentationTested
Windows x64 build 26300, Ryzen 7 9800X3D, rustc 1.99.1, debug profile.
cargo test -p xcl --lib gpu::texture::tests::ttpf_ -- --nocaptureran 3 CPU-only synthetic tests, with 3 passed, 0 failed, 0 ignored, and 0 skipped.git apply --check --cachedsucceeded against the568e7dbindex.AI use
Codex (GPT-6, exact variant unavailable) investigated the format and alpha edge case, wrote and tested the patch, and drafted this report.
Apply-ready diff for the test module
Save the diff as a patch and apply it to
568e7db.@thehollowedone on GitHub · 2026-11-26 10:07 UTC · original
Fresh Windows check of the test-only patch in my earlier comment. I applied it in a disposable scratch tree based on current
mainb49be183plus the mip-count line from #1245 head830bf78. All eight patch hunks applied cleanly. This was a composite test tree, not the exact head of either PR.On Windows build 26300 with rustc 1.99.1, I ran
cargo test --offline --locked -p xcl --lib retail_ttpf_textures_detile_with_their_mip_chains -- --nocapture --test-threads=1once for each of five privately held archives, settingXCL_SAMPLE_TTPFto one archive for each run. Each run reported 1 passed, 0 failed, 0 ignored, and no printed skips. The patched test read and detiled:cargo test --offline --locked -p xcl --lib ttpf_reads_tagged_blocks_and_the_last_texture -- --nocapture --test-threads=1also passed (1 passed, 0 failed, 0 ignored, no skip).For a control, I removed the broader patch and reran the original 912-entry archive with only #1245's mip-count change. The original test still reported 909/912 layout-size matches, yet returned 1 passed, 0 failed, 0 ignored. Thus #1245's passing result does not establish full archive read/detile coverage; the broader reader, last-entry, and cubemap checks remain useful follow-up work.
This checks five archives, not every archive in the licensed copy. There was no byte-for-byte console reference for the detiled output. I did not run the full workspace suite or a retail title on this composite tree. No game files, paths, or dumps are included here.
AI use: Codex (GPT-6.2 Sol) applied the patch, ran the tests, and drafted this report.