Repository navigation
Conversation
|
AMD run, since Not tested lists AMD: Tested
Not tested
AI use
|
|
Test report on AMD RDNA3: RX 7800 XT (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. No retail data was used. Tested: the PR head
Not tested: a regression run on a title, a release build, and the head merged onto current AI use: Claude Code ran the commands and drafted this comment; the runs are real runs on the hardware above. |
|
From a static review (no builds or runs) of
Keep the submitted resources alive until GPU completion is confirmed, and require that confirmation before copying back. xcl/crates/xcl/src/hle/d3d12x/sparse.rs Lines 1001 to 1010 in 7709697 xcl/crates/xcl/src/hle/d3d12x/sparse.rs Lines 1297 to 1313 in 7709697 Review by Claude Code (Claude Opus 5.5) with a gpt-6.2-sol audit subagent; I checked each point against the code. |
After a title's ExecuteCommandLists whose lists write sparse windows on the GPU, readback_after_execute made XCL's queue wait for the title's queue (through one rb_fence shared by all title queues) and then waited on the CPU for the copy, inside the title's call and under the sparse lock. A queue may GPU-wait for a fence that a later submit signals (async compute): the CPU wait then never ends, and the later submit never comes. Values of the shared fence signalled from several queues could also complete out of order. The copy back is now recorded on the title's queue after its lists (a list of the queue's type, into a readback buffer of its own), followed by a signal of a fence of that queue's own. It is still waited for in the call, so the bytes are in the CPU's view when the title's own fence after the work completes - unless a wait the queue was given has not completed (Wait is noted, from the PC method and from the console's queue slots; XCL's own waits are not), or an earlier copy back of that queue is not landed yet. Then a worker thread lands it, in submission order, once the GPU is there. The fence exists before anything is submitted, and a copy back is landed only once its fence has reached the value (looking again every millisecond when there is no event to wait on), so its buffer and list live until the GPU is done with them; if the Signal after the copy fails, nothing can tell when it is done and they are never released (review on ivall#433). Tests (own processes, the device adopted as the title's): - sparse_readback_waits: queue A waits for F, runs a list writing 8 bytes of a sparse window and is read back; queue B then submits and signals F. Main hangs (A not done after 5 s); here A finishes and the bytes land. - sparse_readback_lands: 20 times a list writes 8 bytes, the title waits for its fence and reads them at once. Passes on main and here; fails in round 0 when every copy back goes to the worker. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
7709697 to
7184866
Compare
|
Thanks, both points were right. They're fixed in
No test covers these paths: the failures of 🤖 Claude Opus 5.5 |
After a title's
ExecuteCommandListswhose lists write sparse windows on the GPU (Write32/64BitValue…X,FillMemoryWith32BitValueX,CopyMemoryToMemoryX),sparse::readback_after_executecopies those bytes back to the CPU's view. It waited on the CPU for the title's queue to get there, inside the title's call and while holding the sparse lock. A queue may GPU-wait for a fence that a later submit signals; async compute does this. The wait then never ends, the later submit never comes, and every other submit stops at the sparse lock. Part of #262, which covers the other half of the sparse windows' cross-queue problem: the CPU-write uploads.What is in it
crates/xcl/src/hle/d3d12x/sparse.rs:rb_fencethat all title queues signalled is gone. Its values could complete out of order across queues.Signalfails they are never released (from review).crates/xcl/src/hle/d3d12x/real.rs: the queue'sWaitis noted, both from the PC method (a new override) and from the console's queue slots. XCL's own waits, made inside its own uploads, are not noted.cpu_writes.rs: it does bottom-of-pipe writes outside unified memory always on a worker, after the GPU. So there a CPU read right after the title's fence wait can always see the old value, and the worker writes anyway after 10 s. This PR keeps that window to the case where main hangs.crates/xcl/tests/, each in its own process, with the device adopted as the title's:sparse_readback_waits.rs: queue A waits for F, runs a list writing 8 bytes of a sparse window, and is read back; queue B then submits and signals F. A must finish within 5 s, and the bytes must land.sparse_readback_lands.rs: 20 times, a list writes 8 bytes, the title waits for its own fence and reads them at once.Tested
7184866on main9ab7d76; it adds the review fix to7709697. The runs by @nullmarsh and @TheHoracio below were on7709697.9ab7d767184866)cargo test -p xcl --test sparse_readback_waitscargo test -p xcl --test sparse_readback_landscargo test -p xcl --lib hle::d3d12x::sparse::testson7184866: 10 passed, 0 failed, 1 ignored.cargo test --workspace -- --test-threads=4:7184866merged with D3D12.X: the sparse state is replaced outside its lock #443's head locally, the fix for D3D12.X: replacing the sparse state deadlocks when the old state still holds placed buffers #344 (ona6f5f7a): 679 passed, 0 failed, 41 ignored.7184866alone: hung in the deadlock of D3D12.X: replacing the sparse state deadlocks when the old state still holds placed buffers #344 (gpu_uma_import_check_at_init,gpu_typed_buffer_loads_and_storesand two more), after 190 lib tests had passed, 0 failed.7709697: 653 passed, 0 failed, 40 ignored. A first run of it hung the same way.gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64).7709697merged ontomaina6f5f7a.scripts/test.ps1: 0 failed, no SKIPPED GPU tests; both new tests pass. Withreal.rsandsparse.rsback onmain,a_readback_behind_a_wait_for_a_later_signal_does_not_hangfails after 5.4 s.7709697on9ab7d76.cargo test --workspace --no-fail-fast -- --test-threads=4: 653 passed, 0 failed, 40 ignored, no SKIPPED GPU tests; both new tests pass.Regression run
main: Pending: no title on our machine yet; our own run follows when we have one.
PR: Pending: no title on our machine yet; our own run follows when we have one.
Not tested
scripts/smoke.ps1regression run.cpu_writeshas the same property.Size: 426 changed lines (+392 / -34), 189 of them tests.
Overlap:
AI use
🤖 Generated with Claude Code