[Tests] Retail TTPF texture detile failure on the retail title data #1121
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#1121
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?
@KunasuC on GitHub · 2026-11-24 12:03 UTC · original
Context: I ran the test suite with
XCL_SAMPLE_TTPFpointing to mytextures.rpffrom the retail title (v1.0.2.1). The goal was to check if the texture decoder handles real game data.Result: 684 passed, 1 failed.
Failed test:
gpu::texture::tests::retail_ttpf_textures_detile_with_their_mip_chainsError output:
Test summary: 684 passed, 1 failed. GPU tests were skipped (no GPU detected by the script).
rapport_tests_xcl.txt
report.json
xcl.log
github-bot referenced this issue2026-11-26 04:48:16 +00:00
@shzyjbr06-dev on GitHub · 2026-11-24 12:35 UTC · original
Tested
retail_ttpf_textures_detile_with_their_mip_chainsat47efa2eagainst several retail.ttpfarchives (note:XCL_SAMPLE_TTPFexpects anRDS5.ttpffile rather thantextures.rpf):data\ttdb\graphics\ttdb_graphics.ttpf: passes (909 of 912match;6 of 6mip textures pass).data\ttdb\peds\peds_loose.ttpf:6198 of 6204match (99.9%),1 of 1mip texture passes (0.13/255vs88.22/255), only fails thechecked >= 5threshold in the test assertion.data\ttdb\ui\ttdb_ui.ttpf: reproduces the8115 / 10013mismatch seen in this issue.Inspecting the
RDS5directory table (at = 0x17500,count = 10013), almost every mismatched entry (1,897of1,898) shares the exact same bit pattern:(b >> 24) == 2and(c >> 21) != 0(0x164or0x102)256x256(a >> 28 == 1), whereend - startis20pages (80 KB) for 1 B/px formats (dxgi=99/98/65) or10pages (40 KB) for 0.5 B/px formats (dxgi=80/71), instead of16/8pages.ttdb_ui.ttpf:b>>24 == 0, c>>21 == 0:5365b>>24 == 1, c>>21 == 0:2751b>>24 == 2, c>>21 == 0x164:1834(20pages for256x256)b>>24 == 2, c>>21 == 0x102:63(10pages for256x256)@tiagonogueiraa-bit on GitHub · 2026-11-24 13:01 UTC · original
claiming: decoding the extra mip levels in the RDS5 texture table (the
c >> 21/d & 0xFfields from here and #707), so the test reads the mip count every archive stores instead of only the 912-texture one's. I have the 1.0.2.1 archives locally; I'll report the rule here with counts per archive (table fields only, no texture data), then open a test-only PR. Written with Claude Code (Claude Opus 5.5).@tiagonogueiraa-bit on GitHub · 2026-11-24 13:35 UTC · original
Found the missing field. A texture's stored mip count is
(dword0 >> 28) + (dword1 & 7). Bits 0–2 of dword 1 sit below the DXGI format ((b & 0x3ff) >> 3), and the test never read them.I checked this against all 46
.ttpfarchives of retail 1.0.2.1, using table fields only andgpu/tiling.rsfrom main47efa2e:a >> 28(main)(a >> 28) + (b & 7)endis the stream total. No mip count fits either group.ttdb_graphics.ttpfpassed anyway: 104 of its 912 textures set the bits, but their extra levels all fall inside the mip-tail block, which takes the same space. This is also why(c >> 21)/dword3looked related: they correlate with the texture class, butb & 7alone decides the count. Every distinct entry (all fields but the page offset) has a single count that fits all of its textures.cargo test.lighting.ttpf(cubes) andplatform.ttpf(one texture).ttdb_props_1_3.ttpf, has 5 of 6 close.ttdb_graphics.ttpf, since the other archives have no 3D LUTs (#752).For
ttdb_ui.ttpffrom the report above, the size check goes from 8115 / 10013 to 10012 / 10013. The one left is the archive's last entry. Theb>>24 == 2, c>>21 == 0x164 / 0x102groups are 256×256 textures witha >> 28 = 1andb & 7 = 1, so 2 levels, which explains the 20 / 10 pages.The change is one line in the test's
Ttpf::open. The PR will follow as a draft. It needs a Windows run ofcargo testwithXCL_SAMPLE_TTPF, which I can't do from macOS; @shzyjbr06-dev, would you be up for it?Written with Claude Code (Claude Opus 5.5).
@KunasuC on GitHub · 2026-11-24 20:36 UTC · original
Update : I re-ran the test suite on the latest commit (
b9b6ea6) with XCL_REQUIRE_GPU=1 to force GPU tests.The texture test still fails (as expected, PR #... is pending), but a new GPU test failure appeared :
This error seems to be related to the VCRUNTIME140.dll crash I experienced when launching the game (see report.json from the previous run). The game crashes with 0xc0000005 after calling ID3D12GraphicsCommandList10::#101.
Test summary : 838 passed, 2 failed. GPU tests were forced (XCL_REQUIRE_GPU=1).
Attached: rapport_complet_xcl.txt (new full log).
rapport_complet_xcl.txt
@KunasuC on GitHub · 2026-11-24 21:47 UTC · original
Correction to my earlier comments:
the project: on Windows 10 22H2 cargo test did not find the Agility SDK, so the inbox D3D12Core (SM 6.5)
refused the compute PSO with E_INVALIDARG. With XCL_D3D12_DIR pointing at the Agility SDK it passes.
I have no evidence that it is related to the VCRUNTIME140 crash (#101), please disregard that link.
was a setup error on my side. Please disregard it.
Drafted with Claude (Claude Sonnet 5.5).