D3D12.X: use per-queue cpu_writes workers and atomic 64-bit stores #1819

Open
github-bot wants to merge 1 commit from github-bot/gh-1819 into main AGit
Owner

@⁠n-romanovich on GitHub · 2026-11-24 21:17 UTC · original
n-romanovich:d3d12x/cpu-writes-per-queue → main · +166 −45 · 2 files · 1 commits · open

Addresses #1488 (XCL-BT-003).

Previously, cpu_writes used a single global xcl-cpu-writes FIFO worker thread for all command queues and wrote Write::Immediate dwords with a loop of 32-bit AtomicU32 stores:

  1. A stalled or blocked queue waiting up to WAIT_MS (10,000 ms) head-of-line blocked or deadlocked independent queues' bottom-of-pipe writes.
  2. write_now tore 8-byte aligned 64-bit Write::Immediate stores into two separate 32-bit writes, allowing spinning CPU readers to observe a half-written u64.
  3. FENCES had no cleanup on queue release.

What is in it

  • crates/xcl/src/hle/d3d12x/cpu_writes.rs: - Replace the single global worker() with a dedicated FIFO worker thread per queue inside QueueFence (spawn_worker), checking CreateEventW for NULL, calling ResetEvent before SetEventOnCompletion to avoid stale timeout signals, and advancing entry.value only after q.Signal succeeds. - Add on_queue_release(queue) to remove released queues from FENCES and shut down their worker thread cleanly. - Share is_region_writable across write_now, write_u64_now, and writable, and store 8-byte aligned 64-bit Write::Immediate values atomically via write_u64_now. - Add independent_queues_do_not_hol_block_each_other and write_now_stores_64bit_immediates_atomically unit tests (with QueueCleanup guards).
  • crates/xcl/src/hle/d3d12x/real.rs: call super::cpu_writes::on_queue_release(this as usize) in q_release when refcount reaches 0.

Tested
Hardware: Windows 11 x64, NVIDIA GeForce RTX 5060 Ti.

  • cargo test -p xcl --lib cpu_writes::tests -- --test-threads=4: 4 passed; 0 failed; 0 ignored
  • cargo test --workspace -- --test-threads=4: 893 passed; 0 failed; 42 ignored
    • SKIPPED: gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware (no wave64), shaders::tests::pso_measurement_compiles_an_exact_synthetic_record (Windows Developer Mode is required), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows)

Regression run

Main (5478c4a7c1ae5adba127c8d27018d7fdbf3a8725):

xcl-smoke v1
commit: 5478c4a7c1ae5adba127c8d27018d7fdbf3a8725
gpu: NVIDIA GeForce RTX 5060 Ti
title: FILES
seconds: 60
exit: 0x0
frames shown: 1541 (PresentX 1541)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15701 MB

PR (0062ee19f59cfed9ce0a4551a5a9a62f35196a01):

xcl-smoke v1
commit: 0062ee19f59cfed9ce0a4551a5a9a62f35196a01
gpu: NVIDIA GeForce RTX 5060 Ti
title: FILES
seconds: 60
exit: 0x0
frames shown: 1547 (PresentX 1547)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14764 MB

Not tested

  • macOS / Linux (crate targets Windows only).
  • AMD / wave64-capable GPU.

AI use

  • Antigravity (model name not provided): implemented the fix and unit tests, ran the test suite and smoke.ps1 runs.
**@⁠n-romanovich** on GitHub · 2026-11-24 21:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/1819) `n-romanovich:d3d12x/cpu-writes-per-queue` → `main` · +166 −45 · 2 files · 1 commits · open Addresses #1488 (`XCL-BT-003`). Previously, `cpu_writes` used a single global `xcl-cpu-writes` FIFO worker thread for all command queues and wrote `Write::Immediate` dwords with a loop of 32-bit `AtomicU32` stores: 1. A stalled or blocked queue waiting up to `WAIT_MS` (10,000 ms) head-of-line blocked or deadlocked independent queues' bottom-of-pipe writes. 2. `write_now` tore 8-byte aligned 64-bit `Write::Immediate` stores into two separate 32-bit writes, allowing spinning CPU readers to observe a half-written `u64`. 3. `FENCES` had no cleanup on queue release. **What is in it** - `crates/xcl/src/hle/d3d12x/cpu_writes.rs`: - Replace the single global `worker()` with a dedicated FIFO worker thread per queue inside `QueueFence` (`spawn_worker`), checking `CreateEventW` for `NULL`, calling `ResetEvent` before `SetEventOnCompletion` to avoid stale timeout signals, and advancing `entry.value` only after `q.Signal` succeeds. - Add `on_queue_release(queue)` to remove released queues from `FENCES` and shut down their worker thread cleanly. - Share `is_region_writable` across `write_now`, `write_u64_now`, and `writable`, and store 8-byte aligned 64-bit `Write::Immediate` values atomically via `write_u64_now`. - Add `independent_queues_do_not_hol_block_each_other` and `write_now_stores_64bit_immediates_atomically` unit tests (with `QueueCleanup` guards). - `crates/xcl/src/hle/d3d12x/real.rs`: call `super::cpu_writes::on_queue_release(this as usize)` in `q_release` when refcount reaches `0`. **Tested** Hardware: Windows 11 x64, NVIDIA GeForce RTX 5060 Ti. - `cargo test -p xcl --lib cpu_writes::tests -- --test-threads=4`: `4 passed; 0 failed; 0 ignored` - `cargo test --workspace -- --test-threads=4`: `893 passed; 0 failed; 42 ignored` - - `SKIPPED`: `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask` (`no wave64`), `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` (`no wave64`), `shaders::tests::pso_measurement_compiles_an_exact_synthetic_record` (`Windows Developer Mode is required`), `heap_window_out_of_memory_falls_back_to_the_switch_form` (`no heap windows`) **Regression run** Main (`5478c4a7c1ae5adba127c8d27018d7fdbf3a8725`): ``` xcl-smoke v1 commit: 5478c4a7c1ae5adba127c8d27018d7fdbf3a8725 gpu: NVIDIA GeForce RTX 5060 Ti title: FILES seconds: 60 exit: 0x0 frames shown: 1541 (PresentX 1541) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15701 MB ``` PR (`0062ee19f59cfed9ce0a4551a5a9a62f35196a01`): ``` xcl-smoke v1 commit: 0062ee19f59cfed9ce0a4551a5a9a62f35196a01 gpu: NVIDIA GeForce RTX 5060 Ti title: FILES seconds: 60 exit: 0x0 frames shown: 1547 (PresentX 1547) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14764 MB ``` **Not tested** - macOS / Linux (crate targets Windows only). - AMD / wave64-capable GPU. **AI use** - Antigravity (model name not provided): implemented the fix and unit tests, ran the test suite and `smoke.ps1` runs.
Replace the single global xcl-cpu-writes worker with a dedicated FIFO worker per queue (cleaned up on q_release) so one stalled queue cannot HOL-block or deadlock independent queues, reset the wait event before SetEventOnCompletion, and store 8-byte aligned 64-bit Write::Immediate values atomically.

Assisted-by: Antigravity (Claude Sonnet 5.5)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:06:18 +00:00
Author
Owner

@⁠upipibi on GitHub · 2026-11-24 21:53 UTC · original

Checked on Ampere: RTX 3070 8 GB, driver 616.56, Windows 11, debug, 74ad74e merged onto main 1d027e5.

  • hle::d3d12x at --test-threads=8: 157 passed, 0 failed, 2 ignored, in 3 of 3 runs.
  • cpu_writes::tests at 4 threads: 34 of 35 runs passed. Run directly from the test binary, it passed 15 of 15 alone and 15 of 15 with the module. Through cargo test it passed 4 of 5.

The one failure was independent_queues_do_not_hol_block_each_other at cpu_writes.rs:323: left: 1, right: 0, so queue A's write had landed while A still waited on blocker. That run took 10.21 s, about WAIT_MS. It looks like the test's thread was delayed about 10 s after after(q_a), A's worker timed out and wrote anyway (as designed), and B's loop then passed at once without reaching its 3 s check. If so, it is the test's timing, not the change. One way to make the test robust: take the time right after after(q_a) and check va_a == 0 only while less than WAIT_MS has passed. I didn't find what stalled the thread.

The release key matches: q_release passes the same raw queue pointer that list_x hands to after, as list_x::on_queue_release already does.

AI-assisted (Claude Code). Synthetic tests only.

**@⁠upipibi** on GitHub · 2026-11-24 21:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/1819#issuecomment-7145516994) Checked on Ampere: RTX 3070 8 GB, driver 616.56, Windows 11, debug, `74ad74e` merged onto `main` `1d027e5`. - `hle::d3d12x` at `--test-threads=8`: 157 passed, 0 failed, 2 ignored, in 3 of 3 runs. - `cpu_writes::tests` at 4 threads: 34 of 35 runs passed. Run directly from the test binary, it passed 15 of 15 alone and 15 of 15 with the module. Through `cargo test` it passed 4 of 5. The one failure was `independent_queues_do_not_hol_block_each_other` at `cpu_writes.rs:323`: `left: 1, right: 0`, so queue A's write had landed while A still waited on `blocker`. That run took 10.21 s, about `WAIT_MS`. It looks like the test's thread was delayed about 10 s after `after(q_a)`, A's worker timed out and wrote anyway (as designed), and B's loop then passed at once without reaching its 3 s check. If so, it is the test's timing, not the change. One way to make the test robust: take the time right after `after(q_a)` and check `va_a == 0` only while less than `WAIT_MS` has passed. I didn't find what stalled the thread. The release key matches: `q_release` passes the same raw queue pointer that `list_x` hands to `after`, as `list_x::on_queue_release` already does. AI-assisted (Claude Code). Synthetic tests only.
Author
Owner

@⁠n-romanovich on GitHub · 2026-11-24 21:58 UTC · original

Thanks for the thorough stress run and for catching that timing edge case!

Updated independent_queues_do_not_hol_block_each_other (ef0b30b) as suggested: recorded t_a = Instant::now() right before after(q_a, ...) and guarded the va_a == 0 check with if t_a.elapsed() < Duration::from_millis(WAIT_MS as u64) so a 10 s OS scheduling delay under heavy parallel load won't falsely fail after queue A's worker intentionally times out.

Re-verified on Windows 11 (cargo test --workspace -- --test-threads=4: 893 passed, 0 failed, 42 ignored) and updated the xcl-smoke block in the PR description for ef0b30b.

**@⁠n-romanovich** on GitHub · 2026-11-24 21:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/1819#issuecomment-7145637439) Thanks for the thorough stress run and for catching that timing edge case! Updated `independent_queues_do_not_hol_block_each_other` (`ef0b30b`) as suggested: recorded `t_a = Instant::now()` right before `after(q_a, ...)` and guarded the `va_a == 0` check with `if t_a.elapsed() < Duration::from_millis(WAIT_MS as u64)` so a 10 s OS scheduling delay under heavy parallel load won't falsely fail after queue A's worker intentionally times out. Re-verified on Windows 11 (`cargo test --workspace -- --test-threads=4`: `893 passed, 0 failed, 42 ignored`) and updated the `xcl-smoke` block in the PR description for `ef0b30b`.
Author
Owner

@⁠upipibi on GitHub · 2026-11-24 22:12 UTC · original

Re-ran at ef0b30b (on main 689f2db, RTX 3070, driver 616.56). My timing explanation above was wrong. The new t_a guard didn't catch it: line 325 still saw A's write (1 of 20 direct runs, 0 of 5 through cargo test). hle::d3d12x at 8 threads: 157 passed.

What actually happens: the device is lost. I logged the worker locally. In a failing run, A's worker wakes from WaitForSingleObject after 680 ms, and the fence then reads 18446744073709551615 (u64::MAX, a removed device). A second worker sees the same at the same moment. Each failing run has an nvlddmkm 153 cluster in the System log (15:51:37, 16:09:07, 16:10:34). Splitting the module:

Run Runs Device lost
independent_queues_do_not_hol_block_each_other alone 60 0
cpu_writes::tests without it 60 0
cpu_writes::tests with it (4 threads) 85 3

So the reset only comes when this test's queue sits on q_a.Wait(&blocker, 1) while the other cpu_writes tests submit work. D3D12CreateDevice(None, ..) hands every test the same device, so the loss also fails every other GPU test in the process. That is the #1727 pattern again. Since the test needs no real GPU work, creating its device on the WARP adapter (EnumWarpAdapter, already the fallback here) would keep the blocked queue off the shared hardware device. I didn't find why a GPU-side wait of under a second ends in a reset on this driver.

AI-assisted (Claude Code). Synthetic tests only.

**@⁠upipibi** on GitHub · 2026-11-24 22:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/1819#issuecomment-7145932684) Re-ran at `ef0b30b` (on `main` `689f2db`, RTX 3070, driver 616.56). My timing explanation above was wrong. The new `t_a` guard didn't catch it: line 325 still saw A's write (1 of 20 direct runs, 0 of 5 through `cargo test`). `hle::d3d12x` at 8 threads: 157 passed. **What actually happens: the device is lost.** I logged the worker locally. In a failing run, A's worker wakes from `WaitForSingleObject` after 680 ms, and the fence then reads `18446744073709551615` (`u64::MAX`, a removed device). A second worker sees the same at the same moment. Each failing run has an `nvlddmkm` 153 cluster in the System log (15:51:37, 16:09:07, 16:10:34). Splitting the module: | Run | Runs | Device lost | |---|---|---| | `independent_queues_do_not_hol_block_each_other` alone | 60 | 0 | | `cpu_writes::tests` without it | 60 | 0 | | `cpu_writes::tests` with it (4 threads) | 85 | 3 | So the reset only comes when this test's queue sits on `q_a.Wait(&blocker, 1)` while the other `cpu_writes` tests submit work. `D3D12CreateDevice(None, ..)` hands every test the same device, so the loss also fails every other GPU test in the process. That is the #1727 pattern again. Since the test needs no real GPU work, creating its device on the WARP adapter (`EnumWarpAdapter`, already the fallback here) would keep the blocked queue off the shared hardware device. I didn't find why a GPU-side wait of under a second ends in a reset on this driver. AI-assisted (Claude Code). Synthetic tests only.
Author
Owner

@⁠upipibi on GitHub · 2026-11-24 22:51 UTC · original

Heads-up for the q_release hook here: #1691 adds a second path where a released queue's count reaches 0, after present::forget_queue, and with it that is the usual one. A hook only in the first if n == 0 branch would not run there. Details in xcl-dev/xcl#1899 (comment), which adds a vram hook at the same spot.

**@⁠upipibi** on GitHub · 2026-11-24 22:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/1819#issuecomment-7146730238) Heads-up for the `q_release` hook here: #1691 adds a second path where a released queue's count reaches 0, after `present::forget_queue`, and with it that is the usual one. A hook only in the first `if n == 0` branch would not run there. Details in xcl-dev/xcl#1899 (comment), which adds a `vram` hook at the same spot.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 00:39 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 00:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/1819#issuecomment-7148741617) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 03:14 UTC · original

PR #1819 | STOR-WINLAB compatibility test

Tested commit 43a01309cbc57da6e96ef5bf93ce8ad321bbfd68 (clean detached checkout). The PR gives each D3D12.X queue a worker for fence-delayed CPU writes and uses a single atomic store for aligned 64-bit immediates.

Environment STOR-WINLAB, Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB with driver 32.0.101.9175. The adapter reports DoublePrecisionFloatShaderOps=0 and wave sizes 8–32. d3d12SDKLayers.dll is absent. Rust 1.100.0 (0ef1bc386, 2026-11-09), DXC/DXIL 1.9.2609.5, unoptimized profiles with debug info disabled.

Build cargo build --workspace and cargo test --workspace --no-run both exited 0 outside the GPU lock.

Focused tests cargo test -p xcl --lib hle::d3d12x::cpu_writes::tests -- --test-threads=1 returned 4 passed, 0 failed, 0 ignored, 0 skip lines. The new tests confirmed that the compute queue's write lands while the direct queue waits on a fence and observed no torn values during 20,000 aligned 64-bit stores. The existing immediate-write and readback ordering tests also passed. The queue tests request the default D3D12 device with a WARP fallback and do not identify the selected adapter in their output.

Workspace cargo test --workspace --no-fail-fast -- --test-threads=4 ran once. Both test runs used the shared Arc lock and XCL_ADAPTER=A770. The 20 result summaries, including doc tests, sum to 969 passed, 26 failed, 45 ignored. Cargo exited 101. The four focused tests passed here too.

  • Failures (26) 21 compute PSO creation errors (0x80070057), four GPU result mismatches (fused FMA, mip sampling, the high half of an f16 result, and pixel-shader wave reduction), and one test-title failure. The title exited 1 after its dynamic depth bias check got blue where it expected green.
  • Skip lines (23) 18 due to missing wave64 support, three refused wave32 lowering cases, one driver-cache control skip, and one missing heap-window skip. These lines include partial skips and represent unexercised coverage.

Not tested A baseline on main, retail-title smoke runs, other GPU/driver combinations, or optional game-data fixtures (XCL_SAMPLE_* unset). Without a baseline, the run does not establish whether the workspace failures are regressions.

T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1819-suite.log and published this report.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 03:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/1819#issuecomment-7151728188) # PR #1819 | STOR-WINLAB compatibility test **Tested commit** `43a01309cbc57da6e96ef5bf93ce8ad321bbfd68` (clean detached checkout). The PR gives each D3D12.X queue a worker for fence-delayed CPU writes and uses a single atomic store for aligned 64-bit immediates. **Environment** STOR-WINLAB, Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB with driver 32.0.101.9175. The adapter reports `DoublePrecisionFloatShaderOps=0` and wave sizes 8–32. `d3d12SDKLayers.dll` is absent. Rust 1.100.0 (0ef1bc386, 2026-11-09), DXC/DXIL 1.9.2609.5, unoptimized profiles with debug info disabled. **Build** `cargo build --workspace` and `cargo test --workspace --no-run` both exited 0 outside the GPU lock. **Focused tests** `cargo test -p xcl --lib hle::d3d12x::cpu_writes::tests -- --test-threads=1` returned 4 passed, 0 failed, 0 ignored, 0 skip lines. The new tests confirmed that the compute queue's write lands while the direct queue waits on a fence and observed no torn values during 20,000 aligned 64-bit stores. The existing immediate-write and readback ordering tests also passed. The queue tests request the default D3D12 device with a WARP fallback and do not identify the selected adapter in their output. **Workspace** `cargo test --workspace --no-fail-fast -- --test-threads=4` ran once. Both test runs used the shared Arc lock and `XCL_ADAPTER=A770`. The 20 result summaries, including doc tests, sum to **969 passed, 26 failed, 45 ignored**. Cargo exited 101. The four focused tests passed here too. - **Failures (26)** 21 compute PSO creation errors (`0x80070057`), four GPU result mismatches (fused FMA, mip sampling, the high half of an f16 result, and pixel-shader wave reduction), and one test-title failure. The title exited 1 after its dynamic depth bias check got blue where it expected green. - **Skip lines (23)** 18 due to missing wave64 support, three refused wave32 lowering cases, one driver-cache control skip, and one missing heap-window skip. These lines include partial skips and represent unexercised coverage. **Not tested** A baseline on `main`, retail-title smoke runs, other GPU/driver combinations, or optional game-data fixtures (`XCL_SAMPLE_*` unset). Without a baseline, the run does not establish whether the workspace failures are regressions. T3 Code / Codex (`gpt-6.2-sol`, `reasoningEffort: high`) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, `gemini-4-neon`) verified counts against `pr1819-suite.log` and published this report.
Author
Owner

@⁠Royalflamejlh on GitHub · 2026-11-25 08:20 UTC · original

43a0130 merged on main 2bdf047 with #684, its cpu_writes tests (the four in cpu_writes::tests and one title_textures test) at --test-threads=4, 85 runs under Wine and 85 on Windows: the device was lost in 0 and 0 of them (upipibi saw 3 of 85 at ef0b30b, an earlier head with the same test, on an RTX 3070); 2 Windows runs failed earlier, creating a queue.

Setup: Linux: Fedora 44, Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch, RTX 4070 12 GB (driver 615.71.09), release, x86_64-pc-windows-gnu. Windows: Windows 11 Pro 26200, RTX 2070 SUPER 8 GB (driver 621.01), Ryzen 7 5700X3D, 16 GB RAM, rustc 1.100.0, debug (cargo test --workspace).

Tested

cpu_writes at 4 threads runs 5 passed device lost other failure
Wine, RTX 4070 85 85 0 0
Windows, RTX 2070 SUPER 85 83 0 2 (runs 57 and 76): CreateCommandQueue for the compute queue returned 0x8007000E at :306
  • "Device lost" here means no run failed the va_a == 0 check (:328), where upipibi's loss showed, and no output line named a removed device.
  • Both failures came before the test calls after. In run 76, and in run 18 which passed, the UMA import check in the same process got the same error making its own queue. I did not find what ran out.
  • In the title (retail 1.0.2.1, the first-run screens completed once and no story progress, A pressed when the title presented steadily, at 16.5 and 18.1 s), a copy whose counter logs the first write or drop in write_now and write_u64_now logged nothing in 100 s and 130 s runs, and after never printed its first-submission line (:181).

Read

  • #1005 (c1a9b52) made all three functions skip VirtualQuery for a committed coherent window; 43a0130 sits on 80f4819, which has it, and keeps the skip only in writable (:144). Was dropping it in :126 and :136 meant, or lost in the rebase? (At 43a0130, list_x.rs:2274 and :2345 send an address with a GPU buffer to the GPU, so the extra call costs only when a committed-window address reaches the CPU path.)

Not tested: a run where a write reaches the CPU path; the Windows System log, where upipibi saw nvlddmkm 153 for each loss (a reset that failed no test would not show here); the RTX 5070 Ti; AMD and Intel.

AI use: Claude Code. Claude Fable 5.2 read the diff, built the counting copy, ran the title and the Wine tests, and started the Windows runs; Claude Opus 5.5 read the Windows results and wrote this comment.

Posted without review by a person: the account owner was away and reads replies later.

**@⁠Royalflamejlh** on GitHub · 2026-11-25 08:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/1819#issuecomment-7156900355) `43a0130` merged on `main` `2bdf047` with #684, its `cpu_writes` tests (the four in `cpu_writes::tests` and one `title_textures` test) at `--test-threads=4`, 85 runs under Wine and 85 on Windows: the device was lost in 0 and 0 of them (upipibi saw 3 of 85 at `ef0b30b`, an earlier head with the same test, on an RTX 3070); 2 Windows runs failed earlier, creating a queue. **Setup:** Linux: Fedora 44, Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch, RTX 4070 12 GB (driver 615.71.09), release, `x86_64-pc-windows-gnu`. Windows: Windows 11 Pro 26200, RTX 2070 SUPER 8 GB (driver 621.01), Ryzen 7 5700X3D, 16 GB RAM, rustc 1.100.0, debug (`cargo test --workspace`). **Tested** | `cpu_writes` at 4 threads | runs | 5 passed | device lost | other failure | |---|---|---|---|---| | Wine, RTX 4070 | 85 | 85 | 0 | 0 | | Windows, RTX 2070 SUPER | 85 | 83 | 0 | 2 (runs 57 and 76): `CreateCommandQueue` for the compute queue returned `0x8007000E` at `:306` | - "Device lost" here means no run failed the `va_a == 0` check (`:328`), where upipibi's loss showed, and no output line named a removed device. - Both failures came before the test calls `after`. In run 76, and in run 18 which passed, the UMA import check in the same process got the same error making its own queue. I did not find what ran out. - In the title (retail 1.0.2.1, the first-run screens completed once and no story progress, A pressed when the title presented steadily, at 16.5 and 18.1 s), a copy whose counter logs the first write or drop in `write_now` and `write_u64_now` logged nothing in 100 s and 130 s runs, and `after` never printed its first-submission line (`:181`). **Read** - #1005 (`c1a9b52`) made all three functions skip `VirtualQuery` for a committed coherent window; `43a0130` sits on `80f4819`, which has it, and keeps the skip only in `writable` (`:144`). Was dropping it in `:126` and `:136` meant, or lost in the rebase? (At `43a0130`, `list_x.rs:2274` and `:2345` send an address with a GPU buffer to the GPU, so the extra call costs only when a committed-window address reaches the CPU path.) **Not tested:** a run where a write reaches the CPU path; the Windows System log, where upipibi saw `nvlddmkm` 153 for each loss (a reset that failed no test would not show here); the RTX 5070 Ti; AMD and Intel. **AI use:** Claude Code. Claude Fable 5.2 read the diff, built the counting copy, ran the title and the Wine tests, and started the Windows runs; Claude Opus 5.5 read the Windows results and wrote this comment. Posted without review by a person: the account owner was away and reads replies later.
Author
Owner

@⁠upipibi on GitHub · 2026-11-25 10:14 UTC · original · edited 2026-11-25 10:51 UTC

@⁠Royalflamejlh Same result on Ampere. RTX 3070 (driver 616.56, Windows 11, debug), 43a0130 merged onto main 568e7db. I ran the module the way I did at ef0b30b: cpu_writes::tests --test-threads=4 from the test binary, 85 runs.

  • 0 of 85 runs failed (85 of 85 test result: ok), and the System log has 0 nvlddmkm 153 events since the first run. At ef0b30b it was 3 of 85, each with a 153 cluster.

I can't credit this PR's change with that, though: ef0b30b already had it (the same commit, rebased; only 4 added lines differ), and that is where I saw the 3 losses, on main 689f2db. What changed between my two runs is the base, 689f2db to 568e7db, plus the rebase. So a newer main commit or the rebase removed the loss on this card, and I haven't isolated which. A run of 43a0130 on its own base would tell them apart.

Added later: 43a0130 on its own base 80f48190, unmerged, the same 85 runs: 0 failed, 0 nvlddmkm 153 events. So with this change present in all three runs (only 4 added lines differ after the rebase), the loss shows only on the oldest base: ef0b30b on 689f2db 3 of 85, 43a0130 on 80f48190 0 of 85, and merged onto 568e7db 0 of 85. That doesn't show it went away, though (corrected; I first wrote that it did). 3 of 85 against 0 of 85 has a probability of about 12% of being chance for either newer tree (computed with a script). Pooling both newer trees (0 of 170) gives about 4%, but that mixes two different trees. I also haven't re-run ef0b30b on 689f2db today, so I don't know whether the 3 of 85 still reproduces there.

AI-assisted (Claude Code). Synthetic tests only.

**@⁠upipibi** on GitHub · 2026-11-25 10:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/1819#issuecomment-7159424306) · edited 2026-11-25 10:51 UTC @⁠Royalflamejlh Same result on Ampere. RTX 3070 (driver 616.56, Windows 11, debug), `43a0130` merged onto `main` `568e7db`. I ran the module the way I did at `ef0b30b`: `cpu_writes::tests --test-threads=4` from the test binary, 85 runs. - **0 of 85 runs failed** (85 of 85 `test result: ok`), and the System log has **0 `nvlddmkm` 153 events** since the first run. At `ef0b30b` it was 3 of 85, each with a 153 cluster. I can't credit this PR's change with that, though: `ef0b30b` already had it (the same commit, rebased; only 4 added lines differ), and that is where I saw the 3 losses, on `main` `689f2db`. What changed between my two runs is the base, `689f2db` to `568e7db`, plus the rebase. So a newer `main` commit or the rebase removed the loss on this card, and I haven't isolated which. A run of `43a0130` on its own base would tell them apart. **Added later:** `43a0130` on its own base `80f48190`, unmerged, the same 85 runs: **0 failed**, 0 `nvlddmkm` 153 events. So with this change present in all three runs (only 4 added lines differ after the rebase), the loss shows only on the oldest base: `ef0b30b` on `689f2db` 3 of 85, `43a0130` on `80f48190` 0 of 85, and merged onto `568e7db` 0 of 85. That doesn't show it went away, though (corrected; I first wrote that it did). 3 of 85 against 0 of 85 has a probability of about 12% of being chance for either newer tree (computed with a script). Pooling both newer trees (0 of 170) gives about 4%, but that mixes two different trees. I also haven't re-run `ef0b30b` on `689f2db` today, so I don't know whether the 3 of 85 still reproduces there. AI-assisted (Claude Code). Synthetic tests only.
Author
Owner

@⁠throny on GitHub · 2026-11-25 17:00 UTC · original

Two contributors checked independently and found that #562 #1643 solves the same problem (for #1488) in a different way: #1607, group D89. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.

This is a hint from the community triage in #1607, not a maintainer decision.

AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.

**@⁠throny** on GitHub · 2026-11-25 17:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/1819#issuecomment-7168868413) <!-- xcl-1607-hint:D89 --> Two contributors checked independently and found that #562 #1643 solves the same problem (for #1488) in a different way: #1607, group D89. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 06:19 UTC · original

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 06:19 UTC · [original](https://github.com/xcl-dev/xcl/pull/1819#issuecomment-7184322386) Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1819/head:github-bot/gh-1819'
git switch 'github-bot/gh-1819'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1819'
git switch 'github-bot/gh-1819'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1819'
git switch 'github-bot/gh-1819'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1819'
git switch 'main'
git merge --squash 'github-bot/gh-1819'
git switch 'main'
git merge --ff-only 'github-bot/gh-1819'
git switch 'main'
git merge 'github-bot/gh-1819'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.