Repository navigation
D3D12.X: use per-queue cpu_writes workers and atomic 64-bit stores - #1819
n-romanovich wants to merge 1 commit into
Conversation
|
Checked on Ampere: RTX 3070 8 GB, driver 616.56, Windows 11, debug,
The one failure was The release key matches: AI-assisted (Claude Code). Synthetic tests only. |
74ad74e to
ef0b30b
Compare
|
Thanks for the thorough stress run and for catching that timing edge case! Updated Re-verified on Windows 11 ( |
|
Re-ran at What actually happens: the device is lost. I logged the worker locally. In a failing run, A's worker wakes from
So the reset only comes when this test's queue sits on AI-assisted (Claude Code). Synthetic tests only. |
|
Heads-up for the |
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)
ef0b30b to
43a0130
Compare
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
PR #1819 | STOR-WINLAB compatibility testTested commit 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 Build Focused tests Workspace
Not tested A baseline on T3 Code / Codex ( |
# Conflicts: # crates/xcl/src/hle/d3d12x/cpu_writes.rs
|
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, Tested
Read
Not tested: a run where a write reaches the CPU path; the Windows System log, where upipibi saw 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. |
Addresses #1488 (
XCL-BT-003).Previously,
cpu_writesused a single globalxcl-cpu-writesFIFO worker thread for all command queues and wroteWrite::Immediatedwords with a loop of 32-bitAtomicU32stores:WAIT_MS(10,000 ms) head-of-line blocked or deadlocked independent queues' bottom-of-pipe writes.write_nowtore 8-byte aligned 64-bitWrite::Immediatestores into two separate 32-bit writes, allowing spinning CPU readers to observe a half-writtenu64.FENCEShad no cleanup on queue release.What is in it
crates/xcl/src/hle/d3d12x/cpu_writes.rs:worker()with a dedicated FIFO worker thread per queue insideQueueFence(spawn_worker), checkingCreateEventWforNULL, callingResetEventbeforeSetEventOnCompletionto avoid stale timeout signals, and advancingentry.valueonly afterq.Signalsucceeds.on_queue_release(queue)to remove released queues fromFENCESand shut down their worker thread cleanly.is_region_writableacrosswrite_now,write_u64_now, andwritable, and store 8-byte aligned 64-bitWrite::Immediatevalues atomically viawrite_u64_now.independent_queues_do_not_hol_block_each_otherandwrite_now_stores_64bit_immediates_atomicallyunit tests (withQueueCleanupguards).crates/xcl/src/hle/d3d12x/real.rs: callsuper::cpu_writes::on_queue_release(this as usize)inq_releasewhen refcount reaches0.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 ignoredcargo test --workspace -- --test-threads=4:893 passed; 0 failed; 42 ignoredSKIPPED: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 (
4178e888c0b5be50a2887eda45cdb832763b68a4):PR (
ef0b30b1535e20c66eef5cd1991e6a6c1635ff8a):Not tested
AI use
Claude Sonnet 5.5): implemented thecpu_writes.rs/real.rschanges and unit tests, ran the test suites andsmoke.ps1, and verified the diff with an independent adversarial reviewer subagent.