Skip to content

Tests: gpu_sparse_vram_descriptors_buffers_and_xmem fails beside the title-texture tests since #288 #343

Done

Description

@Kalmarv

🤖 Claude Fable 5.2

Activity

  1. fladit123 commented on Nov 24, 2026

    @fladit123

    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.

    Configuration Successful runs Failed runs
    Combined filters, 4 threads 0/4 4/4
    Combined filters, 1 thread 4/4 0/4
    Sparse VRAM test alone 1/1 0/1

    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.

  2. TheHoracio commented on Nov 24, 2026

    @TheHoracio
    Contributor

    Ran on current main a6f5f7a74cc620c1f88a9e3669a633d10c3c8212 (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=N

    Configuration Passed submit 1 lane 0 mismatch Device removed
    Combined filters, 4 threads 9/13 2/13 2/13
    Combined filters, 1 thread 2/2 0/2 0/2
    gpu_sparse_vram_descriptors_buffers_and_xmem --exact alone 3/3 0/3 0/3
    • 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.

  3. PHeitor1 commented on Nov 24, 2026

    @PHeitor1

    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 main a6f5f7a, 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).

  4. TheHoracio commented on Nov 24, 2026

    @TheHoracio
    Contributor

    Tested @PHeitor1's patch above on AMD RDNA3, which their comment lists under Not tested. I applied it as written on main a6f5f7a (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.

    title_textures gpu_sparse_vram_descriptors_buffers_and_xmem, --test-threads=4 Passed Mismatch Device removed (0x887a0006)
    main a6f5f7a 9/13 2/13 2/13
    main + patch 13/13 0/13 0/13
    • 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.

  5. Kalmarv commented on Nov 24, 2026

    @Kalmarv
    ContributorAuthor

    Ran PHeitor1's patch against main a6f5f7a. 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_LOCK pub(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:
      1. 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).
      2. 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.
      3. 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).
      4. 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.

    🤖 Claude Opus 5.5

  6. fladit123 commented on Nov 24, 2026

    @fladit123

    Thanks @PHeitor1, @nullmarsh, @TheHoracio and @Kalmarv for the investigation and testing.

    I independently validated PHeitor1's proposed VRAM_TEST_LOCK patch on my RTX 4060 (driver 610.88).

    Results with the patch:

    • Combined parallel filters: 10/10 successful runs, 8 tests passed per run.
    • 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.

  7. emirduran707 commented on Nov 24, 2026

    @emirduran707
    Contributor

    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:

    • main 2997c9a, 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.

  8. fladit123 commented on Nov 24, 2026

    @fladit123

    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.

  9. CryingLaughing commented on Nov 24, 2026

    @CryingLaughing

    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.

  10. PHeitor1 commented on Nov 24, 2026

    @PHeitor1

    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)
    main 2997c9a 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).

  11. PHeitor1 commented on Nov 24, 2026

    @PHeitor1

    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
    main 2997c9a 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.

    Written with Claude Code (Claude Opus 5.5).

  12. alpz1000 commented on Nov 24, 2026

    @alpz1000

    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:

    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_changes

    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.

  13. 13hourstilliland commented on Nov 24, 2026

    @13hourstilliland
    Contributor

    Reproduces on Ampere 8 GB (RTX 3070, driver 610.88) on main 7ebf1b8.

    Tested

    • Commit: 7ebf1b8044bef8f0ef296eb36e85010cceb4633a (main), clean worktree
    • Hardware: NVIDIA GeForce RTX 3070 8 GB, driver 610.88; Intel Core i5-12600K, 31.8 GB RAM; Windows 11 Home build 26200.9974
    • Toolchain: Rust 1.100.0 (stable-x86_64-pc-windows-gnu); DXC 1.9.2609.5 (01b62ad4) via XCL_DXC_DIR; debug build; no XCL_SAMPLE_* set
    • Command 1 (3 runs): cargo test -p xcl --lib --locked -- title_textures gpu_sparse_vram_descriptors_buffers_and_xmem --test-threads=4
      • Result: 2/3 passed, 1/3 failed (run 1 failed: gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem panicked at crates/xcl/src/gpu/recomp/tests.rs:3378:13: submit 1 lane 0 mismatch, left: 0, right: 1077; runs 2 and 3 passed 9/9)
      • All 3 parallel runs logged two UMA opened lines (window 0 buffer at VA 0x320000000 and 0x620000000)
    • Command 2 (3 runs): cargo test -p xcl --lib --locked -- title_textures gpu_sparse_vram_descriptors_buffers_and_xmem --test-threads=1
      • Result: 3/3 passed (9 passed, 0 failed in each run; single UMA opened line at VA 0x300000000 in all 3)

    Not tested

    • Either candidate patch (VRAM_TEST_LOCK or fixture backend() changes)
    • Release build, MSVC toolchain, AMD / Intel GPUs, retail titles

    AI use

    • Hermes Agent, gemini-4-neon: ran the commands and wrote this report from the logs; the human reviewed it.
  14. LucasHoepfner commented on Nov 24, 2026

    @LucasHoepfner
    Contributor

    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:

    // 0000: s_load_dword s20, s[0:1], s0, 0x0
    uint t1_a = (s0 + 0x00000000u + s0) & ~3u;
    // 000c: s_load_dwordx4 s[8:11], s[4:5], s0, 0x0
    uint t3_a = (s4 + 0x00000000u + s0) & ~3u;

    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):

    1. ("SOFFSET", 125) on the three loads.
    2. 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 main 508a0c7, each in its own process:

    main 1 only 1 + 2
    placed + sparse (--exact) 0/6 6/6 6/6
    mirror + sparse (--exact) 3/6 2/10 10/10
    title_textures gpu_sparse_vram_descriptors_buffers_and_xmem --test-threads=4 7/12 (on 2997c9a) not run 12/12
    lib binary, --test-threads=4 2/10, 8 hung as in #344 (on 2997c9a) not run 10/10
    • 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.

  15. 4 remaining items

  16. DavidM1911 commented on Nov 24, 2026

    @DavidM1911
    Contributor

    Another data point for the pair: on Windows 11, Ryzen 9 7900X Radeon iGPU (gfx1036, RDNA2, XCL_ADAPTER=radeon), main 384f7f7 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.

  17. PHeitor1 commented on Nov 24, 2026

    @PHeitor1

    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 main 9e3831e: 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.

    Written with Claude Code (Claude Opus 5.5).

  18. Aniseto commented on Nov 24, 2026

    @Aniseto

    Confirms the pair on main c160d86, 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.
    • hle::d3d12x alone: 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::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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions