Skip to content

D3D12.X: map a one-slice title texture's packed mips where D3D12 addresses them - #470

Open
Abdellah-Khanani wants to merge 2 commits into
xcl-dev:mainfrom
Abdellah-Khanani:rdna1-packed-mips
Open

Abdellah-Khanani wants to merge 2 commits into
xcl-dev:mainfrom
Abdellah-Khanani:rdna1-packed-mips

Conversation

@Abdellah-Khanani

@Abdellah-Khanani Abdellah-Khanani commented Nov 24, 2026 •

Copy link
Copy Markdown

On AMD's RDNA1 Windows driver, the packed mips of a reserved title texture with standard mips stay unmapped, so they read zero. Measured on an RX 5700 XT with the 64x64x64 RGBA8, 4-mip 3D texture of placed_title_textures_share_vram_and_preserve_pixels: GetResourceTiling gives 19 tiles: mip 0 has 16 (start 0), mip 1 has 2 (start 16), and mips 2-3 are packed into 1 tile (NumStandardMips 2, start 18). After Pages::map's single run over the 19 overall tiles from subresource 0, mip 2 reads back all zero (3D 64x64x64 4 mips: subresource 2 mismatch). Mapping the packed block a second time, with the first packed mip as the subresource and the tile in the block as X (how D3D12 addresses packed mips), fixes it.

That test has been SKIPPED on this adapter since a6f5f7a, because the driver refuses the reserved 256x256x6 cube too. This PR lets the test run there: only the cube's same-address reuse step is left out when the cube is committed, so it catches this bug.

What is in it

  • D3D12.X: map the packed mips of a one-slice title texture where D3D12 addresses them: Pages::map_packed_mips in crates/xcl/src/hle/d3d12x/vram.rs, called after map in bind. Only for a 3D texture or a 2D texture without an array (an array keeps a packed block per slice; not measured here), and only when it has both standard and packed mips. It maps the same tiles map chose, so on a driver where the run already reached them nothing changes.
  • Tests: the title textures test runs on an adapter that makes no reserved cube: crates/xcl/src/hle/d3d12x/title_textures.rs. The whole-test skip from a6f5f7a is removed. The cubemap's same-address reuse check runs only when the first cube was reserved (a committed cube has no tiles to reuse); the existing tolerance for a committed cube stays as it was.

Tested

  • AMD Radeon RX 5700 XT (RDNA1, 8 GB), driver 32.0.21045.29003; Ryzen 5 2600; Windows 11 Pro 23H2 (22631); Rust 1.100.0 (stable-x86_64-pc-windows-msvc), debug.
  • Tiled resources tier 3, resource heap tier 2. The driver refuses the reserved 256x256x6 cube with 9 mips (committed instead).
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on main 2997c9a + this PR: 675 passed, 1 failed, 41 ignored. The failure is gpu::recomp::tests::gpu_nonfused_mad_and_mac_prevent_fma_contraction, which also fails on main on this adapter and is unrelated (the driver does not fuse mad; reported separately).
  • SKIPPED gpu::recomp::tests::gpu_geometry_mode_es_gs_strip: no mesh shaders, SKIPPED gpu::recomp::tests::gpu_mesh_mode_two_passes: no mesh shaders.
  • placed_title_textures_share_vram_and_preserve_pixels with the test change but without the vram.rs change: fails (3D 64x64x64 4 mips: subresource 2 mismatch). With both changes: passes.

Regression run

main:

xcl-smoke v1
commit: 508a0c74d7c0625d6d2de8d24494e69dc2e1926f
gpu: AMD Radeon RX 7800 XT
title: RetailGame_Dump
seconds: 90
exit: 0x0
frames shown: 2361 (PresentX 2361)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15674 MB

this PR's head:

xcl-smoke v1
commit: 3896e4fb97d4971971ab7b178a541170cb96318b
gpu: AMD Radeon RX 7800 XT
title: RetailGame_Dump
seconds: 90
exit: 0x0
frames shown: 2365 (PresentX 2365)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15683 MB

Not tested

  • A retail title on my machine: I have none; the run above is @srcamarda's.
  • Intel and GitHub's runner. RDNA2, RDNA3, RDNA4, an AMD iGPU and several NVIDIA cards were tested by others in the comments below, not by me.
  • Array and cube textures with packed mips, which this change leaves alone.
  • Whether the retail run above places a one-slice texture with packed mips in its 90 s (the title stays on its account screen); @srcamarda did not check, so the run shows no regression, not the fix at work.

AI use

  • Claude Code with Claude Opus 5.5 (claude-opus-5-5): found the cause with a temporary GetResourceTiling log, wrote both changes and this description, and ran the tests above on my machine. I reviewed the diff.

🤖 Generated with Claude Code

Abdellah-Khanani and others added 2 commits November 24, 2026 01:45
… addresses them

On AMD's RDNA1 Windows driver (RX 5700 XT, 32.0.21045.29003) the packed mips
of a reserved title texture with standard mips stayed unmapped and read zero.
A 64x64x64 RGBA8 texture with 4 mips has 19 tiles there: mip 0 16, mip 1 2,
and mips 2-3 packed into one tile (NumStandardMips 2, start 18). After the
single run over the overall tiles from subresource 0 in Pages::map, mip 2
read back all zero.

The packed block is now mapped again with the first packed mip as the
subresource and the tile within the block as X, to the same tiles map chose.
Only for a 3D texture or a 2D texture without an array (an array keeps a
packed block per slice, not measured), and only when it has standard and
packed mips.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ved cube

a6f5f7a skipped placed_title_textures_share_vram_and_preserve_pixels whole
on an adapter that refuses the reserved 256x256x6 cube with 9 mips, because
the cube's same-address reuse step then expected shared pages it never got.
That also hid the unmapped packed mips of the 3D texture on AMD's RDNA1
driver. The reuse step now runs only when the first cube was reserved (a
committed cube has no tiles to reuse); the rest of the test runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Mustafaiq1998x

Copy link
Copy Markdown

Independent RDNA2 validation — AMD Radeon RX 6800

Confirmed that the packed-mip issue also affects RDNA2.

Environment:

  • GPU: AMD Radeon RX 6800

  • Driver: 32.0.21045.29003

  • Windows build: 26300

  • Rust: 1.100.0 MSVC

  • DXC: 1.9.2602.17

  • Debug build

Results:

Revision | Passed | Failed -- | -- | -- Main (2997c9a) | 0 | 2 PR #470 (3896e4f) | 4 | 0

Main fails with:
3D 64x64x64 4 mips: subresource 2 mismatch

The PR passes the complete placed_title_textures_share_vram_and_preserve_pixels test.

For the final A/B run, I temporarily instrumented the test to print and assert the actual DXGI adapter, since it uses EnumAdapters1(0) rather than XCL_ADAPTER.

Both runs confirmed AMD Radeon RX 6800.

The diagnostic source changes were restored afterward. No retail game data was used.

This confirms the fix on RDNA2 in addition to the author's RDNA1 results.

AI use: ChatGPT (GPT-6.2) assisted with investigation, test planning and report preparation. All GPU tests were executed on my local hardware.

@MesshM

MesshM commented Nov 24, 2026

Copy link
Copy Markdown

Test run of 3896e4fb97d4971971ab7b178a541170cb96318b on AMD RDNA4 (the PR has RDNA1 and RDNA2 results). The branch is based on 2997c9a, so I merged it onto current main 7ebf1b8 locally (clean merge, title_textures.rs and vram.rs) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4) on the merge: 677 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 637 passed, 0 failed, 21 ignored
  • 0 SKIPPED: on this adapter the reserved 256x256x6 cube is made, so placed_title_textures_share_vram_and_preserve_pixels takes the reserved path, including the cubemap same-address reuse step, with map_packed_mips active; it passes (again alone with --nocapture: 1 passed, 14.2 s, no SKIPPED line)

So on RDNA4, where map already reached the packed tiles before this change (the test ran and passed on main a6f5f7a on this machine, 0 SKIPPED), mapping them a second time changes nothing that the test can see.

Review of the change: map_packed_mips maps the same tiles map chose, addressed as D3D12 addresses packed mips (subresource = first packed mip, X = tile within the packed block), one call per heap with the other heaps' tiles skipped, as map does. It returns early for arrays and cubes, for textures without standard or packed mips, and when the packed block does not fit tiles. The test change keeps the reuse step only when the first cube was reserved, which is the case the step is about. I found nothing to change. One thing not measured: every placement of a one-slice texture with packed mips now does a second UpdateTileMappings and a Signal; that could matter during world streaming, next to #490.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main; main 7ebf1b8 itself was not run in full on this machine.

Run and report by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

@WebIdentity1

Copy link
Copy Markdown

Independent two-adapter validation of 3896e4fb97d4971971ab7b178a541170cb96318b (base 2997c9a).

Tested

  • Ryzen 7 7800X3D / AMD Radeon(TM) Graphics (32.0.21030.2001) plus RTX 3090 (591.74), Windows10 build19045, Rust1.98.1 MSVC debug, SDK DXC1.8.2502.11, public Agility1.620.2.
  • The fixture ignores XCL_ADAPTER and picks adapter0 (AMD here). Focused A/B tests temporarily selected and asserted the adapter name/vendor on both sides; those diagnostics were removed for the full run.
  • Focused command: cargo test --locked -p xcl --lib hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels -- --exact --nocapture.
  • AMD integrated: PR test changes with base vram.rs fail at 3D64×64×64 mip2 (zero readback); full PR passes. RTX3090: original fixture skips for no reserved cubemap; PR test changes run and pass both with base mapping and PR mapping. Each completed focused run: 1 test, 0 ignored, 656 filtered out.
  • Exact head: cargo build --locked --workspace passes. Desktop session1, cargo test --locked --workspace --no-fail-fast -- --test-threads=1: 675 passed, 1 failed, 41 ignored. Remaining failure: pre-existing gpu_clamp_and_omod_per_instruction. Two native-wave64 SKIPPED tests, not GPU coverage: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • Four-thread full run did not complete: stopped after120s+ with UMA-init, two console-heap tests and copy_descriptors_remaps_xbox_extra_cbv_srv_uav_to_pc_enum waiting over60s. Root cause not established; related fixture-interference work exists in Tests: gpu_sparse_vram_descriptors_buffers_and_xmem fails beside the title-texture tests since #288 #343. Serial result is supplementary, not a claim of a clean four-thread run.

Not tested
Retail title/smoke, release, other GPUs. No XCL_SAMPLE_* data. Full-suite fixtures use mixed adapters; only the focused texture controls assert one GPU.

AI use
Codex (GPT-6) assisted with inspection, diagnostic overlays, test execution and this report. No changes proposed to the author's fix.

@PHeitor1

Copy link
Copy Markdown

Tested 3896e4f merged onto main 508a0c7.

RTX 5060 Ti 8 GB (Blackwell, 32-lane waves), NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native, Graphics Tools + XGameRuntime installed), rustc 1.100.0 MSVC, debug, cargo test --workspace --no-fail-fast -- --test-threads=4, no XCL_SAMPLE_*.

Pass: 680 passed, 0 failed, 41 ignored. SKIPPED: only the 2 no wave64 tests.

placed_title_textures_share_vram_and_preserve_pixels alone with --nocapture:

Run and written with Claude Code (Claude Opus 5.5).

@Y0z64

Y0z64 commented Nov 24, 2026

Copy link
Copy Markdown

Fixes the 3D packed-mip failure on RDNA2 too: RX 6700S (Navi 22, driver 32.0.21045.29003), Windows 11 26200, debug, cargo test --workspace --no-fail-fast -- --test-threads=4, no XCL_SAMPLE_*.

  • main a6f5f7a: 673 passed, 3 failed (placed_title_textures_share_vram_and_preserve_pixels + 2 follow-on), 41 ignored
  • this PR 3896e4f: 676 passed, 0 failed, 41 ignored, no SKIPPED

Not tested: smoke.ps1 / retail title. Claude Code (Claude Opus 5.5) ran the tests and wrote this.

@CryingLaughing

Copy link
Copy Markdown

Exact PR head 3896e4fb97d4971971ab7b178a541170cb96318b passed the four-thread workspace suite on an RTX 4080. The focused control with the old mapping also passed on this adapter, including the reserved 3D texture's packed mips.

Tested

  • RTX 4080 (Ada), NVIDIA driver 621.01, Core i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC x64, DXC 1.8.2502.11, debug. XCL_ADAPTER=4080, all XCL_SAMPLE_* variables unset. A DXGI probe identified adapter zero, used directly by the texture fixture, as the RTX 4080.
  • cargo test -p xcl --lib --locked -j 4 placed_title_textures_share_vram_and_preserve_pixels -- --show-output passed 1/1 on the clean PR head and 1/1 with only vram.rs restored to 2997c9aca6ebf4577fed34ebdb3cb0a77dd9ec21 plus fixture diagnostics. Neither focused run skipped. The control reported tiled resources tier 4 and resource heap tier 2. Its reserved 64×64×64 RGBA8 fixture reported 19 total tiles, two standard mips and two packed mips in one tile starting at tile 18. All mip readbacks matched in both runs.
  • cargo build --workspace --locked -j 4 passed on the exact head. cargo test --workspace --locked -j 4 -- --test-threads=4 --show-output reported 676 passed, 0 failed, 41 ignored. The pass count includes opt-in game-data tests that returned early and four explicit skips.
  • SKIPPED for native wave64: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware. SKIPPED for D3D12 debug-layer availability: test_title_draws_with_a_root_signature_under_the_debug_layer and uploads_start_from_each_subresources_state.

Not tested

  • Retail smoke, release builds, or other adapters on this machine.

AI use

  • OpenAI Codex (GPT-6 family, exact variant unavailable) ran the commands, added the local diagnostics, and drafted this report.

@H0UNDZER0

H0UNDZER0 commented Nov 24, 2026 •

Copy link
Copy Markdown

Tested on an RTX 5080: pass, the same counts as main. The title-textures test runs whole and passes, and the new mapping is used on this GPU.

Several NVIDIA results are above already. This one adds an RTX 5080 on a release build, with a probe of the 3D texture's tile layout on this driver.

  • Commit 3896e4fb97d4971971ab7b178a541170cb96318b, this PR's head as is (on its base 2997c9a), release build.
  • NVIDIA GeForce RTX 5080 16 GB, driver 621.24 (32.0.16.2124), 32-lane waves, tiled resources tier 4; Ryzen 7 9700X; Windows 11 Pro 24H2 (26100.9711); Rust 1.100.0 MSVC; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0). No XCL_* variables set.
  • cargo build --release --workspace --locked: OK, the same single fetch_update warning as main.
  • cargo test --workspace --release --no-fail-fast --locked -- --test-threads=4, run twice (the second with --show-output): 676 passed, 0 failed, 41 ignored both times, the same as main 2997c9a on this PC.
  • SKIPPED: the usual 2, gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64).
  • placed_title_textures_share_vram_and_preserve_pixels passes in both runs and in 3 of 3 runs alone (--exact). Its output is the same as on main (512 unreleased 1 MiB textures over 16 MiB: +16777216 B pages (after fill: +0 B), …). There is no not reserved on this adapter line: this driver makes the reserved cube, so the cube's reuse step still runs.
  • The new code runs here. A separate probe of the same 3D texture on this driver (64x64x64 RGBA8, 4 mips, reserved, 64 KiB tiles): GetResourceTiling gives 19 tiles of 32x32x16, 2 standard and 2 packed mips, and a packed tail of 1 tile at index 18. That is the same split as the RX 5700 XT in the description. So map_packed_mips maps that tile a second time on this GPU, and all 4 subresources of the volume still read back right.

Not tested

  • This PR merged onto a newer main. At the time of the run that was 7ebf1b8, which changes title_textures.rs; git merge-tree showed no conflict with it.
  • A GPU that refuses the reserved cube. The Radeon iGPU of this PC: the test always takes adapter 0, the RTX 5080.
  • Debug build, retail titles, scripts/smoke.ps1.

AI use: Claude Code (Claude Opus 5.5, Claude Fable 5.2)

@yyc160

yyc160 commented Nov 24, 2026

Copy link
Copy Markdown

Tested on Blackwell: the test this PR un-skips passes here.

On main@2997c9a it SKIPs on my adapter for the same reason regiumlepidi saw — the driver refuses the 256x256x6 reserved cube:

SKIPPED placed_title_textures_share_vram_and_preserve_pixels: this adapter makes no reserved cube with mips
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 656 filtered out; finished in 0.25s

With this PR @3896e4f the skip is gone and the test runs to the end:

2D 256x256x6 cubemap 9 mips: not reserved on this adapter (committed instead)
test hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 656 filtered out; finished in 1.59s

Hardware: RTX 5070 Ti (Blackwell, 32-lane), driver 32.0.16.1742, Windows 11, 32 GB. cargo test --release -p xcl --lib placed_title_textures -- --nocapture, DXC 1.9.2609.

Two observations from that run:

  • The cube does not become reserved on this adapter either — XCL falls back to a committed resource and the test still passes. So removing the skip does let the test run on adapters that refuse the cube, but the cube part then exercises the committed path, not the shared-page path the test is named for. Worth putting that line in the test output so the coverage is not over-read.
  • The 3D 64x64x64 case does run and mip 2-3 now read back correctly — that is what this PR changes, and it reproduces here.

Not tested: one GPU, one driver. I cannot reproduce the RDNA1 case your description is based on. No smoke run — this change is in a test and vram.rs's page mapping is only reached through map_packed_mips, so a title run would not exercise it differently.

@yyc160

yyc160 commented Nov 24, 2026

Copy link
Copy Markdown

One more thing after reading Pages::map and the scope check.

The premise deserves a second look. map calls UpdateTileMappings with coord = D3D12_TILED_RESOURCE_COORDINATE::default() (subresource 0, x/y/z 0), region.NumTiles = tiles.len() and UseBox = false. With 19 overall tiles and a linear region, that call is supposed to cover tile 18 — the packed block — the same way it covers 0..17; the linear region runs through the overall tile range. So "mip 2 reads zero after one pass" could also mean the first call does not reach what we think it reaches (heap ranges from heap_ranges, NumTiles, the coordinate base) rather than the driver refusing to map a packed tile. A second, differently-shaped call fixing it is a valid workaround either way — but the comment states it as a driver bug, and if it is actually our first call, the workaround hides it. Worth confirming on the RDNA1 box by dumping GetResourceTiling for the resource and the ranges the first call actually sent.

2D arrays are skipped by the early return. if desc.Dimension != TEXTURE3D && desc.DepthOrArraySize != 1 { return; } lets all 3D through and only single-slice 2D, so a 2D array or a cube with packed mips never gets the second mapping. The comment says an array keeps a packed block per slice — if that is right, each slice needs its own mapping at (first packed mip of that slice, X), which is the same shape as the 3D case, just repeated. Out of scope on purpose, or does the array case not show up on the drivers where the single-slice one does?

@alpz1000

Copy link
Copy Markdown

Independent NVIDIA check on RTX 3060 12 GB, driver 610.88 (32.0.16.1088), Core i5-8400, Windows 11 Home 26200.9974, Rust 1.100.0 x86_64-pc-windows-msvc, debug.

Tested: cargo test --locked -p xcl --lib hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels -- --exact --test-threads=1 --nocapture.

  • Unmodified PR head 3896e4fb97d4971971ab7b178a541170cb96318b: 1 passed, 0 failed, 0 ignored, no skip messages.
  • Same head with only vram.rs restored from 2997c9a, retaining the PR's test changes: 1 passed, 0 failed, 0 ignored, no skip messages.

I did not reproduce the AMD packed-mip readback failure on this NVIDIA adapter. The targeted test also stayed green with the extra mapping enabled.

Not tested: full workspace, retail titles, or other adapters.

AI use: OpenAI Codex (GPT-6) ran both local tests and summarized their output.

@DarX-Oren

Copy link
Copy Markdown

Additional RDNA2 validation — RX 6700 XT

Confirmed that the isolated VRAM mapping change from this PR resolves the packed-mip texture failure on my RX 6700 XT.

Environment:

  • GPU: AMD RX 6700 XT (12 GB, Navi 22)
  • Driver: 32.0.21045.29003
  • CPU: Ryzen 5 5600
  • RAM: 32 GB
  • Windows 25H2, build 26200
  • Rust 1.100.0 MSVC
  • Windows SDK 10.0.26100.0
Revision Passed Failed Ignored
Main 508a0c7 677 3 41
Main + isolated VRAM change 680 0 41

The original test failed at subresource 2 of the 64x64x64 3D texture, returning zeros.

The other two failures passed independently and were associated with poisoned locks.

Applying only the vram.rs change resolved the failure without modifying the original test assertions.

Limitations: Two tests counted as passed skipped their checks because the D3D12 debug layer was unavailable. No commercial game data was used.

AI use: OpenAI Codex (GPT-6) assisted with compilation, investigation and local testing.

@Abdellah-Khanani

Copy link
Copy Markdown
Author

@yyc160 Thanks, both are fair. I measured on the RX 5700 XT (RDNA1, 32.0.21045.29003), on 3896e4f with temporary logging in Pages::map and an env switch to leave out map_packed_mips in the same build. The temporary code is not in the PR.

1. What the first call sends. For the 64x64x64 RGBA8 4-mip texture: NumTiles = 19, one pool heap, coord subresource 0 at (0,0,0), UseBox = false, and the ranges from heap_ranges:

ranges = [(true, 268, 1), (true, 284, 1), (true, 270, 2), (true, 4, 1), (true, 257, 3), (true, 272, 8), (true, 16, 3)]

That is 1+1+2+1+3+8+3 = 19 tiles, all mapped, no SKIP runs. Overall tile 18 (StartTileIndexInOverallResource of the packed block, NumStandardMips 2, 1 packed tile) is the last tile of the final (16, 3) run, so heap tile 18. So the first call does name the packed tile; the ranges are not short.

  • Without map_packed_mips (same build, switch on): 3D 64x64x64 4 mips: subresource 2 mismatch, zeros.
  • With it: passes. The second call maps the same tile 18 to the same heap tile 18, only addressed as (subresource = first packed mip, X = 0).

So with identical heap tiles, this driver applies the linear region to tiles 0-17 but not to the packed block. NVIDIA (several cards above) and RDNA4 (MesshM's run) apply it, so it does depend on the driver. I could not find wording in the D3D12 docs that settles whether a linear UseBox = false region continues into the packed block, so "driver behaviour" is my reading of the measurement, not a spec claim. I can rephrase the comment in vram.rs to say what was measured and not call it a driver bug, if you prefer.

2. 2D arrays. Out of scope on purpose, because I can't test them here. With a temporary 2D 256x256x4 array with 9 mips added to the test's shapes, this driver does not make it reserved either (not reserved on this adapter (committed instead), like the cube), so the per-slice packed case never reaches map_packed_mips on RDNA1. If an adapter that makes reserved arrays shows the same zeros, the same call per slice should fix it, as you describe. I'd rather do that in a follow-up with a test on hardware that reaches it than ship it untested.

@srcamarda

Copy link
Copy Markdown
Contributor

Regression run on a retail title, as asked under Regression run.

Tested

  • AMD Radeon RX 7800 XT (RDNA3), driver 32.0.32029.2010; Ryzen 5 5600G, 32 GB; Windows 11 Pro 26300; release builds
  • scripts/smoke.ps1 -Seconds 90, no input (the title stays on its account screen at 30 fps). Each binary was built from a clean checkout of its commit and run twice; the first run of each has a cold translation cache. Blocks below are from the second run.
  • main 508a0c7: 2343 / 2361 frames, peak 15764 / 15674 MB. This PR (3896e4f): 2329 / 2365 frames, peak 15785 / 15683 MB. No crash or device removal in any run.
  • No difference from main beyond run-to-run spread.

Regression run

main:

xcl-smoke v1
commit: 508a0c74d7c0625d6d2de8d24494e69dc2e1926f
gpu: AMD Radeon RX 7800 XT
title: RetailGame_Dump
seconds: 90
exit: 0x0
frames shown: 2361 (PresentX 2361)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15674 MB

this PR's head:

xcl-smoke v1
commit: 3896e4fb97d4971971ab7b178a541170cb96318b
gpu: AMD Radeon RX 7800 XT
title: RetailGame_Dump
seconds: 90
exit: 0x0
frames shown: 2365 (PresentX 2365)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15683 MB

Not tested

  • Whether a one-slice texture with packed mips is placed in these 90 s (the account screen) I did not check; the title keeps many textures in step, so the title-texture path runs.
  • The whole test suite at this head (only the title runs).

AI use

  • Claude Code with Claude Opus 5.5 built both commits, ran the smoke runs and wrote this report; the runs are from my machine.

@EllissonSB

Copy link
Copy Markdown

Tested 3896e4f (PR head, behind main) on AMD RX 6650 XT (RDNA2, driver 32.0.21045.29003), Tiled Resources Tier 4, debug build.

  • placed_title_textures_share_vram_and_preserve_pixels: fails on main (3D 64x64x64 4 mips: subresource 2 mismatch, the packed mips read back all zero; a plain reserved 3D resource with one heap mapped straight and the same upload reproduces it, so it is the driver's handling of the packed block, not the page sharing). Passes on this commit.
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 676 passed, 0 failed, 41 ignored.

Not run: scripts/smoke.ps1 on a title, other GPUs, the merge with current main, arrays with packed mips.

Report written with Claude Code (Claude Sonnet 5.5) from a real run on the hardware above.

@relativespace2K

relativespace2K commented Nov 24, 2026 •

Copy link
Copy Markdown

Tested - 3896e4f on main 3da2abb, retail GTA6 1.0.2.1

Tool: OpenCode with DeepSeek V4.1 Flash 1017

  • 360 s retail run on native Windows/D3D12 (RX 6800 XT, Ryzen 5 5600, 31.9 GB): exit 0,
    1,831 frames, peak 31,973 MB committed, 0 failed pipelines, 0 DXIL failures.
  • Same 40 mesh refusals (minimap) as main, 13 console-only IIDs, 10 stubs; 19,2xx unique shaders.
  • main 3da2abb itself: 360 s, exit 0, peak 32,880 MB - the old game+0x23cf683 streaming
    crash seen on b7aa9f3 does not reproduce on this main.

Tested - #470 + #673 together on AMD RDNA2

tree passed failed ignored
main 63cdc25 (one README commit before 91f9a5e) 689 3 41
#673 head 84b6645 689 1 41
main 91f9a5e + #470 + #673 692 0 41
  • Combined tree: 0 SKIPPED GPU tests; placed_title_textures_share_vram_and_preserve_pixels --exact passes (1.95 s).
  • The three main failures are gone: the packed-mip mismatch and the two PoisonError follow-ons.

Not tested: retail title / smoke.ps1, release build, NVIDIA / Intel.

AI use: OpenCode with DeepSeek V4.1 Flash 1017 ran the tests and drafted this report.

@RodrigoTorreao

Copy link
Copy Markdown

Test report on RDNA2: this PR's head 3896e4f merged locally onto current main 47efa2e (105 commits ahead of its base; the merge had no conflicts and needed no edits).

Tested

  • AMD Radeon RX 6750 XT (RDNA2, 12 GB), driver 32.0.21045.29003; Intel i5-14600KF; Windows 11 25H2 build 26200.9974; Rust 1.100.0 (stable-x86_64-pc-windows-msvc), debug build
  • XCL_SAMPLE_RPF, XCL_SAMPLE_DLLS, XCL_SAMPLE_TTPF, XCL_SAMPLE_BVH4 set to the retail title's files
  • main 47efa2e, cargo test --workspace --no-fail-fast -- --test-threads=4: 738 passed, 3 failed, 41 ignored, 0 SKIPPED
    • the one real failure is placed_title_textures_share_vram_and_preserve_pixels: 3D 64x64x64 4 mips: subresource 2 mismatch (mip 2 reads as zeros); the other two failures are PoisonError follow-ons
  • main + this PR, cargo build --workspace + cargo test --workspace --no-fail-fast -- --test-threads=4: 741 passed, 0 failed, 41 ignored, 0 SKIPPED; placed_title_textures_share_vram_and_preserve_pixels passes, including the 3D subresource 2 case, as the test is on main now
  • unmerged head 3896e4f, cargo test -p xcl --lib -- hle::d3d12x::title_textures hle::d3d12x::vram: 13 passed, 0 failed

So this PR also fixes the packed-mip readback on RDNA2, not only on the RX 5700 XT.

Not tested

AI use

  • Claude Code with Claude Opus 5.5 ran the commands and wrote this report; I checked the counts against the logs.

@RodrigoTorreao

Copy link
Copy Markdown

Test report on RDNA2 for this PR's head 3896e4f, merged locally onto current main 47efa2e. That is 105 commits past the PR's base. The merge had no conflicts and needed no edits.

On RDNA2 the packed-mip test passes with this PR, so the fix is not specific to the RX 5700 XT. The title runs with it, with no crash and no device removal. The frame-rate comparison with main is within the noise of this machine.

Tested

  • Hardware and software:
    • AMD Radeon RX 6750 XT (RDNA2, 12 GB), driver 32.0.21045.29003
    • Intel i5-14600KF, 16 GB RAM
    • Windows 11 25H2 build 26200.9974
    • Rust 1.100.0 (stable-x86_64-pc-windows-msvc)
  • Tests: debug build, with XCL_SAMPLE_RPF/DLLS/TTPF/BVH4 set to the retail title's files, cargo test --workspace --no-fail-fast -- --test-threads=4.
    • main 47efa2e: 738 passed, 3 failed, 41 ignored, 0 SKIPPED.
      • The real failure is placed_title_textures_share_vram_and_preserve_pixels: 3D 64x64x64 4 mips: subresource 2 mismatch. Mip 2 reads as zeros.
      • The other two failures are PoisonError follow-ons.
    • main + this PR, after cargo build --workspace: 741 passed, 0 failed, 41 ignored, 0 SKIPPED. This is against the test as it is on main now.
    • Unmerged head 3896e4f, cargo test -p xcl --lib -- hle::d3d12x::title_textures hle::d3d12x::vram: 13 passed, 0 failed.
  • Smoke runs: release build of main + this PR (local merge commit 07b5336), scripts/smoke.ps1 -Seconds 60 on the retail title, DXC 1.9.2609 via XCL_DXC_DIR, warm DXIL cache.
    • The title stays in its first menu, at about 13 draws per frame in every run.
    • No gamepad or keyboard input reached the title in any of them. I checked the log for pressed, and keyboard_mouse = false was set for the interleaved rounds.

Regression run
Frames shown in 60 s, all clean runs. The last three columns are interleaved rounds, in the order main → this PR → #1028.

build single runs round 1 round 2 round 3 median
main 47efa2e 987, 721 666 754 433 721
main + this PR (07b5336) 859 462 491 734 ~612
  • All runs on both sides: exit 0x0, 0 device removals, 0 crashes, peak commit 15 868–15 895 MB.
  • main alone ranges from 433 to 987 frames with the same workload, so the difference in the medians is within the noise. The title commits about 15.9 GB on a 16 GB machine, so paging is a suspect, but I have not checked it.
  • The smoke blocks name the local merge commit, not a commit of this PR, so they cannot serve as this PR's own regression run.

Not tested

  • A machine with a stable frame rate. On this one the 80 % gate cannot be measured reliably.
  • A smoke run of the unmerged head 3896e4f.
  • Other RDNA2 boards and drivers.

AI use

  • Claude Code (Claude Opus 5.5) ran the commands on my machine and wrote this report. The counts and frame numbers were copied from the test output and the XCL logs.

CalvyPZ pushed a commit to CalvyPZ/xcl that referenced this pull request Nov 24, 2026
The title-texture and VRAM tests serialise on TEST_LOCK and VRAM_TEST_LOCK
and took them with .lock().unwrap(). When one holder panics (on main,
placed_title_textures_share_vram_and_preserve_pixels fails on RDNA2, the
packed-mip case xcl-dev#470 fixes), the mutex is poisoned and every later test
that takes it fails with PoisonError, though it passes alone:
transitions_apply_when_their_list_is_submitted and
d32s8_targets_take_their_own_size_of_video_memory.

The locks guard no data, so take them the way the crate's other test
locks already do (ASYNC_TEST_LOCK, READING_CB_TEST_LOCK):
unwrap_or_else(|e| e.into_inner()). Test code only.

Measured on an RX 6650 XT, cargo test --workspace -- --test-threads=4:
lib tests 647 passed, 3 failed before; 649 passed, 1 failed after.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.