You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tests: gpu_sparse_vram_descriptors_buffers_and_xmem fails beside the title-texture tests since #288 #343
On main3516080, the lib test binary with the filters title_textures gpu_sparse_vram_descriptors_buffers_and_xmem (default threads) fails 3 of 3 runs: tests.rs:3326: submit 1 lane 0 mismatch, left 0, right 1077.
The test alone (--exact) passes 3 of 3, and the same filters with --test-threads=1 pass 3 of 3 (the sparse test then runs first).
Debug builds, RTX 5070 Ti, driver 610.74, Windows 11 26200. Not tested: the whole suite on 3516080, a release build, which of the title-texture tests it takes.
A guess, not checked: placed_title_textures_share_vram_and_preserve_pixels submits through title_textures::refresh, whose write-watch scan resets the written pages of every watched range, the sparse windows included, so it can take the write the sparse test makes between its two submits. If so it is two tests sharing one process's memory windows, not a fault a title would see.
All four parallel failures match the original report: submit 1 lane 0 mismatch, actual 0, expected 1077.
Reproduction command:
cargo test -p xcl --lib --locked -- title_textures gpu_sparse_vram_descriptors_buffers_and_xmem --test-threads=4--show-output
I'll investigate which tests interfere with each other, check whether the failure persists on current main, and look for a narrowly scoped test-isolation fix without weakening the assertions.
Root cause not yet confirmed. No runtime changes or retail data used.
AI use: ChatGPT (GPT-6.2) assisted with test planning and report preparation. All tests were executed locally by me.
On this commit the failure is intermittent here (about 1 run in 3), not every run as reported on 3516080. The mismatch values are unchanged: left: 0, right: 1077 at tests.rs:3326.
New on this GPU: in 2 of 13 parallel runs the sparse test failed with a device removal. The test binary exited with 0x887a0006 (DXGI_ERROR_DEVICE_HUNG), and no assertion was printed. In both runs the sparse test had only created its pipeline and fence when it failed. This could be a separate problem, but it shows up only with the same parallel filters.
Not tested: the whole suite, a release build, which title-texture test interferes, and other commits on this GPU.
AI use: Claude Code ran the commands and drafted this comment; the runs are real runs on the hardware above.
Superseded: the cause given below is wrong, and the lock only hides it. gpu_mirror_upload_… also uses the backend's device, not its own as written here. See #343 (comment) for the cause and #614 for the fix.
Reproduced, and the guess in the report holds. Fix below; I have not opened a PR, because it has to touch vram.rs (one #[cfg(test)] line) and pr_check then asks for a regression run on a retail title, which I cannot make.
Repro on maina6f5f7a, RTX 5060 Ti 8 GB (NVIDIA 621.24), Ryzen 5 5600X, Windows 11 Pro 26300, rustc 1.100.0 MSVC, debug, lib test binary with the filters title_textures gpu_sparse_vram_descriptors_buffers_and_xmem:
--test-threads=4: fails 1 of 3 (submit 1 lane 0 mismatch, left 0, right 1077), and a second run printed no result line
--test-threads=1: passes 3 of 3
Cause.placed_title_textures_share_vram_and_preserve_pixels and gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes call title_textures::refresh on their own device and queue. refresh_once runs GetWriteWatch(WRITE_WATCH_FLAG_RESET) over every watched range, the sparse windows included (cached_watch_ranges adds sparse::mapped_ranges()), then passes the dirty pages to sparse::before_execute on that other queue. If one of them runs between the sparse test's CPU writes (descriptor heap slot, in_a) and its first submit, it takes those dirty pages and the sparse test's own submit finds none. The descriptor slot never reaches the sparse VRAM, the V# reads as zero, the store is dropped, and out_buf stays 0. This is two tests sharing one process's write watch, not something a title with a single device would see.
Both title-texture tests already hold vram::VRAM_TEST_LOCK; the sparse test does not.
Fix:
--- a/crates/xcl/src/hle/d3d12x/vram.rs+++ b/crates/xcl/src/hle/d3d12x/vram.rs
#[cfg(test)]
-pub(super) static VRAM_TEST_LOCK: Mutex<()> = Mutex::new(());+pub(crate) static VRAM_TEST_LOCK: Mutex<()> = Mutex::new(());--- a/crates/xcl/src/gpu/recomp/tests.rs+++ b/crates/xcl/src/gpu/recomp/tests.rs
@@ fn gpu_sparse_vram_descriptors_buffers_and_xmem() {
if !gpu_ready() {
return;
}
+ // the title-texture tests' submits look at (and reset) the CPU writes of every watched+ // range, these sparse windows included: one of them between this test's write and its+ // submit takes the write, and the descriptor heap never reaches VRAM (#343)+ let _vram_guard = crate::hle::d3d12x::vram::VRAM_TEST_LOCK.lock().unwrap_or_else(|e| e.into_inner());
crate::hle::d3d12x::real::init().expect("real D3D12.X backend");
With the fix, same machine and binary:
the same filters with --test-threads=4: 8 of 8 pass
the whole xcl lib binary with --test-threads=4: 636 passed, 0 failed, 21 ignored (SKIPPED: only the 2 no wave64 tests)
Not tested: AMD / Intel GPUs; a release build. @fladit123, since you are on this: feel free to take the patch into your PR.
Investigated and written with Claude Code (Claude Opus 5.5).
Tested @PHeitor1's patch above on AMD RDNA3, which their comment lists under Not tested. I applied it as written on maina6f5f7a (the pub(crate) on VRAM_TEST_LOCK, and the guard at the top of gpu_sparse_vram_descriptors_buffers_and_xmem).
Environment: RX 7800 XT, driver 32.0.32015.7029, Windows 11 Pro 26300, Rust 1.100.0 MSVC, DXC 1.9.2602.17, debug build. This is the same machine as my comment above.
On this GPU the patch also fixes the device removals I reported above, so they came from the same interference.
Pairs on main (6 runs each): placed_title_textures_share_vram_and_preserve_pixels failed 6/6, gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes failed 5/6 (4 mismatches and 1 device removal). The other five title_textures tests failed 0/6. This matches @nullmarsh's table.
With the patch, cargo test --workspace --no-fail-fast -- --test-threads=4: 676 passed, 0 failed, 41 ignored, no SKIPPED. This matches main without the patch on this machine (676 / 0 / 41).
Not tested: a release build.
AI use: Claude Code ran the commands and drafted this comment; the runs are real runs on the hardware above.
Ran PHeitor1's patch against maina6f5f7a. It fixes the pairing here. The trace below does not fit the explanation as written, though.
Tested
RTX 5070 Ti, NVIDIA 610.74, Windows 11 Pro 26200; MSVC stable, debug.
The lib test binary, --test-threads=4 title_textures gpu_sparse_vram_descriptors_buffers_and_xmem, each run in its own process with a 180 s cap, main and the patch alternating:
a6f5f7a: 4 of 6 failed with submit 1 lane 0 mismatch (left 0, right 1077); the other 2 passed.
a6f5f7a with the patch (VRAM_TEST_LOCKpub(crate), taken in the sparse test): 6 of 6 passed, 8 of 8 tests each.
4 more runs of a6f5f7a with logging behind an environment variable: each refresh_once (test thread, sparse pages found) and each sparse::before_execute (bytes uploaded, fence value, whether the queue waited). In order:
Failed, mismatch.gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes's refresh took the sparse test's writes: 576 bytes, which is the two descriptor slots plus in_a and in_b. They were uploaded at fence value 5. A later refresh by the same test uploaded a 64 KiB sparse page and one zeroed run (value 8). That is its physical-page step. Then the sparse test's own refresh found nothing, its queue waited for value 9, and the dispatch wrote nothing (out stayed 0).
Device removed (0x887a0006) during the sparse test's submit 1. Its fence wait returned with the fence at u64::MAX, as on a removed device. The mirror test's refresh took only in_a and in_b (512 bytes). The sparse test's refresh found nothing, so no refresh saw the descriptor slots at all.
Sparse test passed, but the mirror test failed at title_textures.rs:1142, exercise the lazy mapping before its first touch: the page was already committed. Two more tests then failed on the locks it poisoned (VRAM_TEST_LOCK, TEST_LOCK).
Passed. The mirror test's refresh again took and uploaded the sparse test's 576 bytes before its submit. Its 64 KiB physical-page upload came after the sparse test this time.
What this says about the cause
Another test's refresh taking the write is not enough to fail:
in runs 3 and 4 the mirror test took the sparse test's writes too, and the sparse test passed.
sparse::before_execute uploads what it finds on XCL's own copy queue, whichever queue it is called for. The sparse test's new queue then waits for that fence (waited has no entry for it).
In the failing runs, something else came between the sparse test's writes and its submit:
in run 1, the mirror test's physical-page upload (the zeroed run and the 64 KiB page);
in run 2, a descriptor write that no refresh saw.
gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes uses the backend's own device (real::device_raw()), not one of its own. So "not something a title with a single device would see" isn't shown for this pairing. Which addresses that zeroed run and 64 KiB page cover, and whether they overlap the descriptor heap's tile, I did not log.
TheHoracio's device-hung runs look like the same pairing. Here it happened once in 4 logged runs: during submit 1, after the descriptor write had been missed. With the patch the two tests never overlap, and none of the 6 patched runs hung. What makes the GPU hang (as opposed to reading zeros) is not shown, since there is no DRED capture.
Not tested
The whole suite with the patch.
A release build, AMD / Intel GPUs.
placed_title_textures_share_vram_and_preserve_pixels alone beside the sparse test: in my 4 logged runs only the mirror test touched the sparse pages before the sparse test's submit.
Whether a title can hit either loss: a write no refresh sees, or a page upload between a write and its submit.
Added after @fladit123's comment above. In every one of the a6f5f7a runs in this report (6 plain, 4 logged), the log shows the sparse windows set up twice (sparse window(s) for the title's own memory and UMA opened, two of each). In all 6 runs with the patch they are set up once. So in this pairing two first real::init() calls overlap, and a second sparse state replaces the first one, which the sparse test may already have used. fladit123 saw the same for the mirror pairing.
That is not enough on its own either: 2 of the 6 plain runs passed with the double setup.
Which state the test's allocations, uploads and window addresses each landed in was not logged.
Both interfering pairs, the isolated sparse test and sequential execution passed.
Full workspace suite: 676 passed, 0 failed, 41 ignored.
Two explicit GPU skips due to lack of native wave64.
Without the patch, the placed-texture pair failed in all three runs on a6f5f7a, and the mismatch was also reproduced on 2997c9a.
My instrumentation supports Kalmarv's observation that the original explanation is incomplete. The mirror-test pairing showed two initializations replacing the UMA windows before submission. In the placed-texture pairing, a later readback found the expected descriptors and input values in VRAM despite the earlier failed dispatch. The exact mechanism of that failure remains unresolved.
I have retained PHeitor1's minimal patch, adjusting only its explanatory comment to reflect the available evidence.
@ivall, the visibility change to VRAM_TEST_LOCK is behind #[cfg(test)], but pr_check.py classifies vram.rs as runtime code based on its path.
Would you accept this as a test-only PR without retail smoke runs, or would you prefer another approach?
No retail data was used. The patch remains local pending review.
AI use: OpenAI Codex (GPT-6, exact variant not reported by the session) assisted with investigation, instrumentation, patch preparation and local testing. ChatGPT (GPT-6.2) assisted with analysis and report preparation.
AMD (RDNA4) for the patch, and an offer for the retail run.
Tested – RX 9060 XT 16 GB, driver 32.0.31044.16, Ryzen 5 5600, Windows 11 Pro 26300, rustc 1.100.0 MSVC, debug:
main2997c9a, lib binary with --test-threads=4 title_textures gpu_sparse_vram_descriptors_buffers_and_xmem: 4 of 6 runs failed at tests.rs:3326.
With PHeitor1's patch (as posted, on 2997c9a): 8 of 8 passed. Whole workspace: 676 passed, 0 failed, 41 ignored, no SKIPPED.
@fladit123, since you have the patch ready: I have a retail title here. If you push your branch, I'll run scripts/smoke.ps1 on its head commit and on main and paste both xcl-smoke blocks here for your description (pr_check wants the PR's own head commit, so a run of my local copy would not count).
AI use: Claude Code with Claude Opus 5.5 ran these tests and wrote this comment.
Thanks @emirduran707! I really appreciate the additional RDNA4 validation and your offer to run the retail regression tests.
I'm completing the final review and additional validation of the test-only patch. Once the branch is ready, I'll share its exact head commit so you can run both smoke tests.
I'll make sure your testing contribution is credited in the PR description.
RTX 4080 results for a two-step fixture initialization change on a6f5f7a74cc620c1f88a9e3669a633d10c3c8212. I paired gpu_sparse_vram_descriptors_buffers_and_xmem with each title-texture test in a fresh lib-test process, two test threads and three runs per pair.
Fixture setup
With gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes
With placed_title_textures_share_vram_and_preserve_pixels
Clean base
0/3 passed
0/3 passed
Recompiler fixtures use the existing one-time backend() initializer
3/3 passed
0/3 passed
Same change, plus backend() completes before the placed-texture fixture adopts its native D3D12 device
3/3 passed
3/3 passed
On the clean base the mirror pair showed duplicate UMA initialization with different VA ranges, two device removals and one zero readback. The fully patched mirror runs showed one UMA initialization each. The placed-texture failure still reproduced with the recompiler-only edit. A separate fence diagnostic confirmed completion before the incorrect placed-pair readback in all three runs. The comparison isolates the two setup changes on this machine and leaves the precise cause of the placed-pair mismatch open.
Tested
Windows 11 25H2 build 26200.9974, RTX 4080 (NVIDIA 621.01), Core i5-13600K, Rust 1.100.0 MSVC x64, DXC 1.8.2502.11, debug. XCL_ADAPTER=4080, synthetic fixtures and all XCL_SAMPLE_* unset.
Focused command for each pair, with the matching title-texture test name substituted for <pair-filter>: <xcl-lib-test.exe> <pair-filter> gpu_sparse_vram_descriptors_buffers_and_xmem --test-threads=2 --show-output --color=never.
With both setup edits, cargo build --workspace --locked -j 4 passed and cargo test --workspace --locked -j 4 -- --test-threads=4 --show-output reported 676 passed, 0 failed and 41 ignored. The pass count includes four explicit skips: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (native wave64 unavailable), and test_title_draws_with_a_root_signature_under_the_debug_layer and uploads_start_from_each_subresources_state (D3D12 debug layer unavailable). Opt-in game-data tests returned without running.
Not tested
The lock-based patch discussed above, AMD, release builds or retail titles.
AI use
OpenAI Codex (GPT-6 family, exact variant unavailable) investigated, wrote the local fixture edits, ran the tests and drafted this report.
Follow-up on the real::init() mutex
I compared clean 2997c9aca6ebf4577fed34ebdb3cb0a77dd9ec21 with the seven-line runtime mutex from the reply above, without either fixture change or the VRAM_TEST_LOCK patch. Same RTX 4080, driver, toolchain, focused command and two-thread setup as above, five fresh processes per pair and configuration. A DXGI check verified that adapter zero, which the placed fixture selects directly, was also the RTX 4080.
Pair
Clean base
Runtime mutex only
Mirror + sparse
2/5 passed, 1 mismatch, 2 device removals (0x887a0006); two UMA openings per run
5/5 passed; one UMA opening per run
Placed texture + sparse
0/5 passed, 5 submit-1 mismatches; one UMA opening per run
0/5 passed, 5 submit-1 mismatches; one UMA opening per run
The placed pair still failed with a single UMA opening in every run. On this RTX 4080 the mutex also eliminated the mirror-pair failures in the five trials, whereas the RTX 5060 Ti follow-up still saw them. This update covers only the focused synthetic pair runs. Codex ran the comparison and drafted the update.
Superseded: the init() lock below does not fix the pairs, see #343 (comment). The fix is #614.
@Kalmarv's double setup is the cause here, and my write-watch explanation above was wrong. Serializing real::init() alone, without the VRAM_TEST_LOCK patch, fixes the pairing on this machine.
Change (runtime, crates/xcl/src/hle/d3d12x/real.rs):init() checks device_raw(), then builds the device and calls open_uma with nothing held. Two first calls at once each make a device and open the UMA windows, and the second replaces the first's sparse state.
pub fn init() -> Result<String, String> {
if !device_raw().is_null() {
return Ok(ADAPTER.lock().map(|a| a.clone()).unwrap_or_default());
}
+ // two first calls at once would each make a device and open the UMA windows, the second+ // replacing the first's sparse state (#343): one makes them, the other waits and takes them+ static INIT: Mutex<()> = Mutex::new(());+ let _init = INIT.lock().unwrap_or_else(|e| e.into_inner());+ if !device_raw().is_null() {+ return Ok(ADAPTER.lock().map(|a| a.clone()).unwrap_or_default());+ }
unsafe {
Tested: RTX 5060 Ti 8 GB, NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300, rustc 1.100.0 MSVC, debug. Lib test binary, title_textures gpu_sparse_vram_descriptors_buffers_and_xmem --test-threads=4, each run its own process:
Passed
submit 1 lane 0 mismatch
Device removed (0x887a0006)
main2997c9a
4/10
1/10
5/10
main + the init() lock only (no VRAM_TEST_LOCK change)
20/20
0
0
The device removals happen on NVIDIA too, not only on @TheHoracio's RDNA3. On this machine they were the most common failure on 2997c9a.
With the lock, the whole xcl lib binary with --test-threads=4 gives 636 passed, 0 failed, 21 ignored. SKIPPED: only the 2 no wave64 tests.
So the write-watch steal alone does not fail the test, which matches Kalmarv's runs 3 and 4. The VRAM_TEST_LOCK patch worked only because it also keeps the two first init() calls apart.
Which fix:
VRAM_TEST_LOCK (test-only) hides the race in the test suite.
The init() lock removes it, but it is a runtime change and needs the two xcl-smoke runs. I can't make those (no title here). @emirduran707 offered to run them for a PR.
@fladit123, it is your call whether your PR takes this one instead, or both.
Not tested:
Whether a title can make two first init() calls at once. I did not trace the callers.
AMD / Intel GPUs; a release build; a retail title.
Investigated and written with Claude Code (Claude Opus 5.5).
Correction to my comment above: the real::init() lock does not fix the pairing. Please disregard it as a fix.
Its 20/20 came from the combined filter title_textures gpu_sparse_vram_descriptors_buffers_and_xmem with --test-threads=4, where the lock only changes which tests overlap. On the exact pairs, same machine (RTX 5060 Ti, 621.24), --exact <title-texture test> gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem, 6 runs each:
placed_title_textures_… + sparse
gpu_mirror_upload_… + sparse
main2997c9a
0/6 pass (6 mismatch)
3/6 pass (2 mismatch, 1 0x887a0006)
main + init() lock
0/6 pass (6 mismatch)
3/6 pass (2 mismatch, 1 0x887a0006)
I checked that the binary was rebuilt with the lock (Compiling xcl), and reran the placed pair 3 more times: 3 of 3 mismatches.
The lock would not matter for a title either. Outside tests, real::init() is only called from d3d12x::backend(), which is a OnceLock. Only gpu_uma_import_check_at_init and gpu_sparse_vram_descriptors_buffers_and_xmem call real::init() directly, so the double setup is a test-only race. That matches @CryingLaughing's step 2: switching the fixtures to backend() fixes the mirror pair. The placed pair is still open, as they found.
@fladit123's VRAM_TEST_LOCK patch serializes both pairs, which is why it works. I'd keep that as the fix and drop my init() suggestion. Sorry for the noise.
Reproduced both exact test pairings on clean main 508a0c74d7c0625d6d2de8d24494e69dc2e1926f with an RTX 3060 12 GB (driver 610.88 / 32.0.16.1088), i5-8400, Windows 11 Home 26200.9974, and Rust 1.100.0 x86_64-pc-windows-msvc, debug.
Run
Result
Sparse VRAM test alone, one thread
2/2 passed
Cubemap test alone, one thread
1/1 passed
Sparse VRAM + cubemap test, two threads
Sparse test failed 3/3; cubemap passed 3/3
Sparse VRAM + mirror-upload test, two threads
Sparse test failed 3/3; mirror passed 3/3
All six sparse failures were submit 1 lane 0 mismatch, actual 0, expected 1077. No reported GPU skips. Each invocation used a fresh test process. The mirror pairing takes about 0.65 s to run once the test binary is built:
Not tested: proposed fixes, full workspace, retail titles, or other adapters in this run.
AI use: OpenAI Codex (GPT-6) ran the local tests and summarized the logs.
Follow-up: two-step fixture setup
On the same base and hardware, I locally reproduced the fixture changes described in the RTX 4080 report. Each entry counts fresh processes where both tests in the pair passed, with the same exact filters and two test threads.
Setup
Sparse + mirror
Sparse + cubemap
Clean base (above)
0/3
0/3
Both recompiler fixtures call the one-time D3D12.X backend initializer
3/3
0/3
Same, plus initialize the backend before the cubemap fixture adopts its device
3/3
3/3
The combined runs emitted no GPU skip messages. With only the first change, every cubemap pairing still reproduced the sparse test's submit-1 mismatch. This was a local test-only experiment. The full suite and retail titles were not run with these changes. Codex applied the local fixture changes and ran the tests.
Full workspace verification
On the same RTX 3060 and base commit, with both local test-only edits applied, cargo build --locked --workspace succeeded and cargo test --locked --workspace --no-fail-fast -- --test-threads=4 exited 0: 680 passed, 0 failed, 41 ignored. Two tests included in the pass count reported no wave64 skips: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware. Both previously failing pairs ran in the full suite. No retail game files were used.
@CryingLaughing, are you already preparing a PR for the two fixture changes? I have the local test-only diff and can share it if that helps avoid duplicate work.
Root cause of the placed pair: the sparse test's own program. Nothing takes a write from it.
Cause. The test's three S_LOAD_DWORD* instructions (tests.rs:3262–3265 on 508a0c7) leave SOFFSET unset. The field is then 0, which is register s0, not "no register" (125, what the other SMEM tests in the file pass; emit.rs:1461). So every scalar load adds s0, and s0 is the low half of arg_table's address. The translated HLSL:
s0 is 0 only while arg_table is the first allocation in the coherent window (+0x300000000). Any uma.alloc before it moves it, and both descriptor loads then read s0 bytes past the heap. out_buf stays 0 (left: 0, right: 1077), as it does when the V#s read as zeros: the store is bounds-checked against s14. placed_title_textures_… allocates its 16 MiB pool there first, and that alone is enough.
Checked with local edits (on 2997c9a, not for a PR):
The placed test stopped right after its uma.alloc, before any texture or refresh: the sparse test fails. Stopped just before the uma.alloc: it passes.
No second test: one extra u.alloc(0x1_0000, 256) before arg_table, the sparse test alone with --exact, fails every time with the same values (arg_table at +0x300010000). The same allocation after arg_table: passes.
Fix, tests.rs only (5 lines):
("SOFFSET", 125) on the three loads.
gpu_sparse_vram_descriptors_buffers_and_xmem and gpu_uma_import_check_at_init go through d3d12x::backend() instead of real::init(). This is @CryingLaughing's fixture change above: they are the only direct callers, and the source of the double UMA opening in the mirror pair.
Runs passing on main508a0c7, each in its own process:
With both: cargo test --workspace --no-fail-fast -- --test-threads=4: 680 passed, 0 failed, 41 ignored. SKIPPED: the 2 no wave64 tests.
Every run with both changes logged one sparse window(s) line. Every mirror run without change 2 logged two.
Neither change needs VRAM_TEST_LOCK or a file outside tests.rs, so pr_check asks for no regression run. I'll open a PR with these two commits, unless @fladit123 would rather take them into theirs.
Tested on: RTX 3060 Ti 8 GB (32-lane waves), NVIDIA 621.01, i7-14700KF, 32 GB, Windows 11 Pro 26200, rustc 1.99.1 MSVC, DXC 1.8.2502.11, debug.
Not tested: AMD / Intel GPUs, a release build, a retail title. gpu_unified_memory_arena and gpu_memory_windows_above_4_gib also leave SOFFSET unset on SMEM loads; I did not check what s0 holds there.
AI use: Claude Code (Claude Fable 5.2) found the cause, ran the tests and wrote this comment. The runs are real runs on the hardware above.
Another data point for the pair: on Windows 11, Ryzen 9 7900X Radeon iGPU (gfx1036, RDNA2, XCL_ADAPTER=radeon), main384f7f7 debug — --exact hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem --test-threads=4 fails 4/4 runs with submit 1 lane 0 mismatch (left 0, right 1077). Not flaky here — deterministic, same signature as above. Useful for checking whether #614 (or the VRAM_TEST_LOCK variant) actually removes it on RDNA2, not only on the RTX 5060 Ti / RDNA3 machines so far.
AI use: test runs by Devin (Cognition, SWE-2); no code changes.
Thanks @LucasHoepfner, the missing SOFFSET is what I missed. Both pairs pass 10 of 10 here with #614, against 0/10 (placed) and 7/10 (mirror) on main9e3831e: see the report on #614.
In my last comment I said I would keep the VRAM_TEST_LOCK patch as the fix. Please disregard that too: it only keeps the tests apart. I have marked my two earlier comments here as superseded.
Confirms the pair on mainc160d86, and it does not need the whole gpu::recomp group.
Machine: RTX 5070 Ti (Blackwell, 32-lane waves), driver 32.0.16.2124, Windows 11 build 26200, rustc 1.100.0, debug build, XCL_ADAPTER=nvidia, no XCL_SAMPLE_* set.
cargo test --workspace -- --test-threads=4: fails on 7 of 7 runs (5 measured earlier, 2 now), always the same three tests: the cubemap assertion in placed_title_textures_share_vram_and_preserve_pixels, then transitions_apply_when_their_list_is_submitted and vram::d32s8_targets_take_their_own_size_of_video_memory on the poisoned lock. 672 passed, 3 failed, 21 ignored.
--test-threads=1: 675 passed, 0 failed.
Filters hle::d3d12x::title_textures + gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem, 4 threads: 10 of 10 runs fail. (One earlier run in the same session passed 3 times in a row before that, so it is not a fixed clock/order constant, but failing is the dominant outcome here.)
The same filters with gpu_uma_import_check_at_init, gpu_unified_memory_arena, gpu_memory_windows_above_4_gib or gpu_bench_really_runs in place of the sparse test: 14 passed, 0 failed each.
So on this tree it is exactly this sparse test beside the title-texture tests, as the guess above says; gpu::recomp as a group reproduces it only because it contains this test.
Not tested: AMD, release build, which of the two tests takes the other's memory windows first.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash 1017 - ran the commands above on this machine; no game data was used.
Activity
fladit123 commentedon Nov 24, 2026
Independently reproduced on
3516080d53daac0f7749b5c02bc9b1e371479557.Environment: RTX 4060 (driver 610.88), i5-12400F, 32 GiB RAM, Windows 11 Pro build 26300, Rust 1.100.0 MSVC, DXC 1.8.2502.11, debug build.
All four parallel failures match the original report:
submit 1 lane 0 mismatch, actual0, expected1077.Reproduction command:
I'll investigate which tests interfere with each other, check whether the failure persists on current main, and look for a narrowly scoped test-isolation fix without weakening the assertions.
Root cause not yet confirmed. No runtime changes or retail data used.
AI use: ChatGPT (GPT-6.2) assisted with test planning and report preparation. All tests were executed locally by me.
TheHoracio commentedon Nov 24, 2026
Ran on current
maina6f5f7a74cc620c1f88a9e3669a633d10c3c8212(after the #288 follow-ups, including 3516080 and a6f5f7a).Environment: AMD Radeon RX 7800 XT (RDNA3, 16 GB), driver 32.0.32015.7029, Ryzen 7 9800X3D, Windows 11 Pro 10.0.26300, Rust 1.100.0 MSVC, DXC 1.9.2602.17, debug build.
Tested:
cargo test -p xcl --lib --locked -- title_textures gpu_sparse_vram_descriptors_buffers_and_xmem --test-threads=Nsubmit 1 lane 0 mismatchgpu_sparse_vram_descriptors_buffers_and_xmem --exactaloneleft: 0, right: 1077attests.rs:3326.0x887a0006(DXGI_ERROR_DEVICE_HUNG), and no assertion was printed. In both runs the sparse test had only created its pipeline and fence when it failed. This could be a separate problem, but it shows up only with the same parallel filters.Not tested: the whole suite, a release build, which title-texture test interferes, and other commits on this GPU.
AI use: Claude Code ran the commands and drafted this comment; the runs are real runs on the hardware above.
PHeitor1 commentedon Nov 24, 2026
Superseded: the cause given below is wrong, and the lock only hides it.
gpu_mirror_upload_…also uses the backend's device, not its own as written here. See #343 (comment) for the cause and #614 for the fix.Reproduced, and the guess in the report holds. Fix below; I have not opened a PR, because it has to touch
vram.rs(one#[cfg(test)]line) andpr_checkthen asks for a regression run on a retail title, which I cannot make.Repro on
maina6f5f7a, RTX 5060 Ti 8 GB (NVIDIA 621.24), Ryzen 5 5600X, Windows 11 Pro 26300, rustc 1.100.0 MSVC, debug, lib test binary with the filterstitle_textures gpu_sparse_vram_descriptors_buffers_and_xmem:--test-threads=4: fails 1 of 3 (submit 1 lane 0 mismatch, left 0, right 1077), and a second run printed no result line--test-threads=1: passes 3 of 3Cause.
placed_title_textures_share_vram_and_preserve_pixelsandgpu_mirror_upload_follows_cpu_writes_and_later_mapping_changescalltitle_textures::refreshon their own device and queue.refresh_oncerunsGetWriteWatch(WRITE_WATCH_FLAG_RESET)over every watched range, the sparse windows included (cached_watch_rangesaddssparse::mapped_ranges()), then passes the dirty pages tosparse::before_executeon that other queue. If one of them runs between the sparse test's CPU writes (descriptor heap slot,in_a) and its first submit, it takes those dirty pages and the sparse test's own submit finds none. The descriptor slot never reaches the sparse VRAM, the V# reads as zero, the store is dropped, andout_bufstays 0. This is two tests sharing one process's write watch, not something a title with a single device would see.Both title-texture tests already hold
vram::VRAM_TEST_LOCK; the sparse test does not.Fix:
With the fix, same machine and binary:
--test-threads=4: 8 of 8 passxcllib binary with--test-threads=4: 636 passed, 0 failed, 21 ignored (SKIPPED: only the 2no wave64tests)Not tested: AMD / Intel GPUs; a release build. @fladit123, since you are on this: feel free to take the patch into your PR.
Investigated and written with Claude Code (Claude Opus 5.5).
TheHoracio commentedon Nov 24, 2026
Tested @PHeitor1's patch above on AMD RDNA3, which their comment lists under Not tested. I applied it as written on
maina6f5f7a(thepub(crate)onVRAM_TEST_LOCK, and the guard at the top ofgpu_sparse_vram_descriptors_buffers_and_xmem).Environment: RX 7800 XT, driver 32.0.32015.7029, Windows 11 Pro 26300, Rust 1.100.0 MSVC, DXC 1.9.2602.17, debug build. This is the same machine as my comment above.
title_textures gpu_sparse_vram_descriptors_buffers_and_xmem,--test-threads=40x887a0006)maina6f5f7amain+ patchmain(6 runs each):placed_title_textures_share_vram_and_preserve_pixelsfailed 6/6,gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changesfailed 5/6 (4 mismatches and 1 device removal). The other fivetitle_texturestests failed 0/6. This matches @nullmarsh's table.cargo test --workspace --no-fail-fast -- --test-threads=4: 676 passed, 0 failed, 41 ignored, no SKIPPED. This matchesmainwithout the patch on this machine (676 / 0 / 41).Not tested: a release build.
AI use: Claude Code ran the commands and drafted this comment; the runs are real runs on the hardware above.
Kalmarv commentedon Nov 24, 2026
Ran PHeitor1's patch against
maina6f5f7a. It fixes the pairing here. The trace below does not fit the explanation as written, though.Tested
--test-threads=4 title_textures gpu_sparse_vram_descriptors_buffers_and_xmem, each run in its own process with a 180 s cap, main and the patch alternating:a6f5f7a: 4 of 6 failed withsubmit 1 lane 0 mismatch(left 0, right 1077); the other 2 passed.a6f5f7awith the patch (VRAM_TEST_LOCKpub(crate), taken in the sparse test): 6 of 6 passed, 8 of 8 tests each.a6f5f7awith logging behind an environment variable: eachrefresh_once(test thread, sparse pages found) and eachsparse::before_execute(bytes uploaded, fence value, whether the queue waited). In order:gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes's refresh took the sparse test's writes: 576 bytes, which is the two descriptor slots plusin_aandin_b. They were uploaded at fence value 5. A later refresh by the same test uploaded a 64 KiB sparse page and one zeroed run (value 8). That is its physical-page step. Then the sparse test's own refresh found nothing, its queue waited for value 9, and the dispatch wrote nothing (outstayed 0).0x887a0006) during the sparse test's submit 1. Its fence wait returned with the fence atu64::MAX, as on a removed device. The mirror test's refresh took onlyin_aandin_b(512 bytes). The sparse test's refresh found nothing, so no refresh saw the descriptor slots at all.title_textures.rs:1142,exercise the lazy mapping before its first touch: the page was already committed. Two more tests then failed on the locks it poisoned (VRAM_TEST_LOCK,TEST_LOCK).What this says about the cause
sparse::before_executeuploads what it finds on XCL's own copy queue, whichever queue it is called for. The sparse test's new queue then waits for that fence (waitedhas no entry for it).gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changesuses the backend's own device (real::device_raw()), not one of its own. So "not something a title with a single device would see" isn't shown for this pairing. Which addresses that zeroed run and 64 KiB page cover, and whether they overlap the descriptor heap's tile, I did not log.TheHoracio's device-hung runs look like the same pairing. Here it happened once in 4 logged runs: during submit 1, after the descriptor write had been missed. With the patch the two tests never overlap, and none of the 6 patched runs hung. What makes the GPU hang (as opposed to reading zeros) is not shown, since there is no DRED capture.
Not tested
placed_title_textures_share_vram_and_preserve_pixelsalone beside the sparse test: in my 4 logged runs only the mirror test touched the sparse pages before the sparse test's submit.Added after @fladit123's comment above. In every one of the
a6f5f7aruns in this report (6 plain, 4 logged), the log shows the sparse windows set up twice (sparse window(s) for the title's own memoryandUMA opened, two of each). In all 6 runs with the patch they are set up once. So in this pairing two firstreal::init()calls overlap, and a second sparse state replaces the first one, which the sparse test may already have used. fladit123 saw the same for the mirror pairing.real::init()exclusive would remove both. Not written or tested.🤖 Claude Opus 5.5
fladit123 commentedon Nov 24, 2026
Thanks @PHeitor1, @nullmarsh, @TheHoracio and @Kalmarv for the investigation and testing.
I independently validated PHeitor1's proposed
VRAM_TEST_LOCKpatch on my RTX 4060 (driver 610.88).Results with the patch:
Without the patch, the placed-texture pair failed in all three runs on
a6f5f7a, and the mismatch was also reproduced on2997c9a.My instrumentation supports Kalmarv's observation that the original explanation is incomplete. The mirror-test pairing showed two initializations replacing the UMA windows before submission. In the placed-texture pairing, a later readback found the expected descriptors and input values in VRAM despite the earlier failed dispatch. The exact mechanism of that failure remains unresolved.
I have retained PHeitor1's minimal patch, adjusting only its explanatory comment to reflect the available evidence.
@ivall, the visibility change to
VRAM_TEST_LOCKis behind#[cfg(test)], butpr_check.pyclassifiesvram.rsas runtime code based on its path.Would you accept this as a test-only PR without retail smoke runs, or would you prefer another approach?
No retail data was used. The patch remains local pending review.
AI use: OpenAI Codex (GPT-6, exact variant not reported by the session) assisted with investigation, instrumentation, patch preparation and local testing. ChatGPT (GPT-6.2) assisted with analysis and report preparation.
emirduran707 commentedon Nov 24, 2026
AMD (RDNA4) for the patch, and an offer for the retail run.
Tested – RX 9060 XT 16 GB, driver 32.0.31044.16, Ryzen 5 5600, Windows 11 Pro 26300, rustc 1.100.0 MSVC, debug:
main2997c9a, lib binary with--test-threads=4 title_textures gpu_sparse_vram_descriptors_buffers_and_xmem: 4 of 6 runs failed attests.rs:3326.SKIPPED.@fladit123, since you have the patch ready: I have a retail title here. If you push your branch, I'll run
scripts/smoke.ps1on its head commit and onmainand paste bothxcl-smokeblocks here for your description (pr_checkwants the PR's own head commit, so a run of my local copy would not count).AI use: Claude Code with Claude Opus 5.5 ran these tests and wrote this comment.
fladit123 commentedon Nov 24, 2026
Thanks @emirduran707! I really appreciate the additional RDNA4 validation and your offer to run the retail regression tests.
I'm completing the final review and additional validation of the test-only patch. Once the branch is ready, I'll share its exact head commit so you can run both smoke tests.
I'll make sure your testing contribution is credited in the PR description.
CryingLaughing commentedon Nov 24, 2026
RTX 4080 results for a two-step fixture initialization change on
a6f5f7a74cc620c1f88a9e3669a633d10c3c8212. I pairedgpu_sparse_vram_descriptors_buffers_and_xmemwith each title-texture test in a fresh lib-test process, two test threads and three runs per pair.gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changesplaced_title_textures_share_vram_and_preserve_pixelsbackend()initializerbackend()completes before the placed-texture fixture adopts its native D3D12 deviceOn the clean base the mirror pair showed duplicate UMA initialization with different VA ranges, two device removals and one zero readback. The fully patched mirror runs showed one UMA initialization each. The placed-texture failure still reproduced with the recompiler-only edit. A separate fence diagnostic confirmed completion before the incorrect placed-pair readback in all three runs. The comparison isolates the two setup changes on this machine and leaves the precise cause of the placed-pair mismatch open.
Tested
XCL_ADAPTER=4080, synthetic fixtures and allXCL_SAMPLE_*unset.<pair-filter>:<xcl-lib-test.exe> <pair-filter> gpu_sparse_vram_descriptors_buffers_and_xmem --test-threads=2 --show-output --color=never.cargo build --workspace --locked -j 4passed andcargo test --workspace --locked -j 4 -- --test-threads=4 --show-outputreported 676 passed, 0 failed and 41 ignored. The pass count includes four explicit skips:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(native wave64 unavailable), andtest_title_draws_with_a_root_signature_under_the_debug_layeranduploads_start_from_each_subresources_state(D3D12 debug layer unavailable). Opt-in game-data tests returned without running.Not tested
The lock-based patch discussed above, AMD, release builds or retail titles.
AI use
OpenAI Codex (GPT-6 family, exact variant unavailable) investigated, wrote the local fixture edits, ran the tests and drafted this report.
Follow-up on the
real::init()mutexI compared clean
2997c9aca6ebf4577fed34ebdb3cb0a77dd9ec21with the seven-line runtime mutex from the reply above, without either fixture change or theVRAM_TEST_LOCKpatch. Same RTX 4080, driver, toolchain, focused command and two-thread setup as above, five fresh processes per pair and configuration. A DXGI check verified that adapter zero, which the placed fixture selects directly, was also the RTX 4080.0x887a0006); two UMA openings per runThe placed pair still failed with a single UMA opening in every run. On this RTX 4080 the mutex also eliminated the mirror-pair failures in the five trials, whereas the RTX 5060 Ti follow-up still saw them. This update covers only the focused synthetic pair runs. Codex ran the comparison and drafted the update.
PHeitor1 commentedon Nov 24, 2026
Superseded: the
init()lock below does not fix the pairs, see #343 (comment). The fix is #614.@Kalmarv's double setup is the cause here, and my write-watch explanation above was wrong. Serializing
real::init()alone, without theVRAM_TEST_LOCKpatch, fixes the pairing on this machine.Change (runtime,
crates/xcl/src/hle/d3d12x/real.rs):init()checksdevice_raw(), then builds the device and callsopen_umawith nothing held. Two first calls at once each make a device and open the UMA windows, and the second replaces the first's sparse state.pub fn init() -> Result<String, String> { if !device_raw().is_null() { return Ok(ADAPTER.lock().map(|a| a.clone()).unwrap_or_default()); } + // two first calls at once would each make a device and open the UMA windows, the second + // replacing the first's sparse state (#343): one makes them, the other waits and takes them + static INIT: Mutex<()> = Mutex::new(()); + let _init = INIT.lock().unwrap_or_else(|e| e.into_inner()); + if !device_raw().is_null() { + return Ok(ADAPTER.lock().map(|a| a.clone()).unwrap_or_default()); + } unsafe {Tested: RTX 5060 Ti 8 GB, NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300, rustc 1.100.0 MSVC, debug. Lib test binary,
title_textures gpu_sparse_vram_descriptors_buffers_and_xmem --test-threads=4, each run its own process:submit 1 lane 0 mismatch0x887a0006)main2997c9amain+ theinit()lock only (noVRAM_TEST_LOCKchange)2997c9a.xcllib binary with--test-threads=4gives 636 passed, 0 failed, 21 ignored. SKIPPED: only the 2no wave64tests.So the write-watch steal alone does not fail the test, which matches Kalmarv's runs 3 and 4. The
VRAM_TEST_LOCKpatch worked only because it also keeps the two firstinit()calls apart.Which fix:
VRAM_TEST_LOCK(test-only) hides the race in the test suite.init()lock removes it, but it is a runtime change and needs the twoxcl-smokeruns. I can't make those (no title here). @emirduran707 offered to run them for a PR.Not tested:
init()calls at once. I did not trace the callers.Investigated and written with Claude Code (Claude Opus 5.5).
PHeitor1 commentedon Nov 24, 2026
Correction to my comment above: the
real::init()lock does not fix the pairing. Please disregard it as a fix.Its 20/20 came from the combined filter
title_textures gpu_sparse_vram_descriptors_buffers_and_xmemwith--test-threads=4, where the lock only changes which tests overlap. On the exact pairs, same machine (RTX 5060 Ti, 621.24),--exact <title-texture test> gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem, 6 runs each:placed_title_textures_…+ sparsegpu_mirror_upload_…+ sparsemain2997c9a0x887a0006)main+init()lock0x887a0006)I checked that the binary was rebuilt with the lock (
Compiling xcl), and reran the placed pair 3 more times: 3 of 3 mismatches.The lock would not matter for a title either. Outside tests,
real::init()is only called fromd3d12x::backend(), which is aOnceLock. Onlygpu_uma_import_check_at_initandgpu_sparse_vram_descriptors_buffers_and_xmemcallreal::init()directly, so the double setup is a test-only race. That matches @CryingLaughing's step 2: switching the fixtures tobackend()fixes the mirror pair. The placed pair is still open, as they found.@fladit123's
VRAM_TEST_LOCKpatch serializes both pairs, which is why it works. I'd keep that as the fix and drop myinit()suggestion. Sorry for the noise.Written with Claude Code (Claude Opus 5.5).
alpz1000 commentedon Nov 24, 2026
Reproduced both exact test pairings on clean main
508a0c74d7c0625d6d2de8d24494e69dc2e1926fwith an RTX 3060 12 GB (driver 610.88 / 32.0.16.1088), i5-8400, Windows 11 Home 26200.9974, and Rust 1.100.0 x86_64-pc-windows-msvc, debug.All six sparse failures were
submit 1 lane 0 mismatch, actual0, expected1077. No reported GPU skips. Each invocation used a fresh test process. The mirror pairing takes about 0.65 s to run once the test binary is built:cargo test --locked -p xcl --lib -- --exact --test-threads=2 gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem hle::d3d12x::title_textures::tests::gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changesNot tested: proposed fixes, full workspace, retail titles, or other adapters in this run.
AI use: OpenAI Codex (GPT-6) ran the local tests and summarized the logs.
Follow-up: two-step fixture setup
On the same base and hardware, I locally reproduced the fixture changes described in the RTX 4080 report. Each entry counts fresh processes where both tests in the pair passed, with the same exact filters and two test threads.
The combined runs emitted no GPU skip messages. With only the first change, every cubemap pairing still reproduced the sparse test's submit-1 mismatch. This was a local test-only experiment. The full suite and retail titles were not run with these changes. Codex applied the local fixture changes and ran the tests.
Full workspace verification
On the same RTX 3060 and base commit, with both local test-only edits applied,
cargo build --locked --workspacesucceeded andcargo test --locked --workspace --no-fail-fast -- --test-threads=4exited 0: 680 passed, 0 failed, 41 ignored. Two tests included in the pass count reportedno wave64skips:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware. Both previously failing pairs ran in the full suite. No retail game files were used.@CryingLaughing, are you already preparing a PR for the two fixture changes? I have the local test-only diff and can share it if that helps avoid duplicate work.
13hourstilliland commentedon Nov 24, 2026
Reproduces on Ampere 8 GB (RTX 3070, driver 610.88) on
main7ebf1b8.Tested
7ebf1b8044bef8f0ef296eb36e85010cceb4633a(main), clean worktreestable-x86_64-pc-windows-gnu); DXC 1.9.2609.5 (01b62ad4) viaXCL_DXC_DIR; debug build; noXCL_SAMPLE_*setcargo test -p xcl --lib --locked -- title_textures gpu_sparse_vram_descriptors_buffers_and_xmem --test-threads=4gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmempanicked atcrates/xcl/src/gpu/recomp/tests.rs:3378:13:submit 1 lane 0 mismatch,left: 0,right: 1077; runs 2 and 3 passed 9/9)UMA openedlines (window 0 buffer at VA 0x320000000and0x620000000)cargo test -p xcl --lib --locked -- title_textures gpu_sparse_vram_descriptors_buffers_and_xmem --test-threads=1UMA openedline atVA 0x300000000in all 3)Not tested
VRAM_TEST_LOCKor fixturebackend()changes)AI use
gemini-4-neon: ran the commands and wrote this report from the logs; the human reviewed it.LucasHoepfner commentedon Nov 24, 2026
Root cause of the placed pair: the sparse test's own program. Nothing takes a write from it.
Cause. The test's three
S_LOAD_DWORD*instructions (tests.rs:3262–3265on508a0c7) leaveSOFFSETunset. The field is then 0, which is registers0, not "no register" (125, what the other SMEM tests in the file pass;emit.rs:1461). So every scalar load addss0, ands0is the low half ofarg_table's address. The translated HLSL:s0is 0 only whilearg_tableis the first allocation in the coherent window (+0x300000000). Anyuma.allocbefore it moves it, and both descriptor loads then reads0bytes past the heap.out_bufstays 0 (left: 0, right: 1077), as it does when the V#s read as zeros: the store is bounds-checked againsts14.placed_title_textures_…allocates its 16 MiB pool there first, and that alone is enough.Checked with local edits (on
2997c9a, not for a PR):uma.alloc, before any texture or refresh: the sparse test fails. Stopped just before theuma.alloc: it passes.u.alloc(0x1_0000, 256)beforearg_table, the sparse test alone with--exact, fails every time with the same values (arg_tableat+0x300010000). The same allocation afterarg_table: passes.Fix,
tests.rsonly (5 lines):("SOFFSET", 125)on the three loads.gpu_sparse_vram_descriptors_buffers_and_xmemandgpu_uma_import_check_at_initgo throughd3d12x::backend()instead ofreal::init(). This is @CryingLaughing's fixture change above: they are the only direct callers, and the source of the double UMA opening in the mirror pair.Runs passing on
main508a0c7, each in its own process:main--exact)--exact)title_textures gpu_sparse_vram_descriptors_buffers_and_xmem --test-threads=42997c9a)--test-threads=42997c9a)cargo test --workspace --no-fail-fast -- --test-threads=4: 680 passed, 0 failed, 41 ignored. SKIPPED: the 2no wave64tests.sparse window(s)line. Every mirror run without change 2 logged two.Neither change needs
VRAM_TEST_LOCKor a file outsidetests.rs, sopr_checkasks for no regression run. I'll open a PR with these two commits, unless @fladit123 would rather take them into theirs.Tested on: RTX 3060 Ti 8 GB (32-lane waves), NVIDIA 621.01, i7-14700KF, 32 GB, Windows 11 Pro 26200, rustc 1.99.1 MSVC, DXC 1.8.2502.11, debug.
Not tested: AMD / Intel GPUs, a release build, a retail title.
gpu_unified_memory_arenaandgpu_memory_windows_above_4_gibalso leaveSOFFSETunset on SMEM loads; I did not check whats0holds there.AI use: Claude Code (Claude Fable 5.2) found the cause, ran the tests and wrote this comment. The runs are real runs on the hardware above.
4 remaining items
Tests: the sparse VRAM test's scalar loads take no register offset
Tests: the sparse VRAM and UMA import tests take the backend's device
Tests: the sparse VRAM test's scalar loads take no register offset
Tests: the sparse VRAM and UMA import tests take the backend's device
Tests: the sparse VRAM test's scalar loads take no register offset
Tests: the sparse VRAM and UMA import tests take the backend's device
DavidM1911 commentedon Nov 24, 2026
Another data point for the pair: on Windows 11, Ryzen 9 7900X Radeon iGPU (gfx1036, RDNA2,
XCL_ADAPTER=radeon),main384f7f7debug —--exact hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem --test-threads=4fails 4/4 runs withsubmit 1 lane 0 mismatch(left 0, right 1077). Not flaky here — deterministic, same signature as above. Useful for checking whether #614 (or theVRAM_TEST_LOCKvariant) actually removes it on RDNA2, not only on the RTX 5060 Ti / RDNA3 machines so far.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
Tests: the sparse VRAM test's scalar loads take no register offset
Tests: the sparse VRAM and UMA import tests take the backend's device
PHeitor1 commentedon Nov 24, 2026
Thanks @LucasHoepfner, the missing
SOFFSETis what I missed. Both pairs pass 10 of 10 here with #614, against 0/10 (placed) and 7/10 (mirror) onmain9e3831e: see the report on #614.In my last comment I said I would keep the
VRAM_TEST_LOCKpatch as the fix. Please disregard that too: it only keeps the tests apart. I have marked my two earlier comments here as superseded.Written with Claude Code (Claude Opus 5.5).
Aniseto commentedon Nov 24, 2026
Confirms the pair on
mainc160d86, and it does not need the wholegpu::recompgroup.Machine: RTX 5070 Ti (Blackwell, 32-lane waves), driver 32.0.16.2124, Windows 11 build 26200, rustc 1.100.0, debug build,
XCL_ADAPTER=nvidia, noXCL_SAMPLE_*set.cargo test --workspace -- --test-threads=4: fails on 7 of 7 runs (5 measured earlier, 2 now), always the same three tests: the cubemap assertion inplaced_title_textures_share_vram_and_preserve_pixels, thentransitions_apply_when_their_list_is_submittedandvram::d32s8_targets_take_their_own_size_of_video_memoryon the poisoned lock. 672 passed, 3 failed, 21 ignored.--test-threads=1: 675 passed, 0 failed.hle::d3d12x::title_textures+gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem, 4 threads: 10 of 10 runs fail. (One earlier run in the same session passed 3 times in a row before that, so it is not a fixed clock/order constant, but failing is the dominant outcome here.)gpu_uma_import_check_at_init,gpu_unified_memory_arena,gpu_memory_windows_above_4_giborgpu_bench_really_runsin place of the sparse test: 14 passed, 0 failed each.hle::d3d12xalone: 115 passed.gpu::alone: 283 passed. Both together: fails.So on this tree it is exactly this sparse test beside the title-texture tests, as the guess above says;
gpu::recompas a group reproduces it only because it contains this test.Not tested: AMD, release build, which of the two tests takes the other's memory windows first.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash 1017 - ran the commands above on this machine; no game data was used.
Tests: the sparse VRAM test's scalar loads take no register offset
Tests: the sparse VRAM and UMA import tests take the backend's device
Docs: the split-wave64 exchange spins by default, since PR xcl-dev#798