Repository navigation
Conversation
…v#505) A retail game submits a list with a Wait64BitValueX on a counter before the list, on another queue, that writes the counter, from one thread - at times before that list is even recorded. XCL evaluated the wait on the CPU before submitting the waiting list, so the thread was held 2 s per wait and the writer came only after the timeouts; the waiting lists ran without the value. The title's frames stopped and its watchdog ended it (+0x23cf683). A wait that is not met when its list is submitted now becomes ID3D12CommandQueue::Wait on a fence of its own. Lists remember the values their Write32/64BitValue*X put at each address until they are submitted; the list that writes the value - recorded already, or the first one recorded later - signals the fence on its queue right after its submission. A watcher thread signals it instead when the memory meets the wait (a CPU write) or after 10 s, and a writer list that is reset or released lets it go. Without a queue or a fence the wait stays a CPU wait. Assisted-by: Claude Code (Claude Opus 5.5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Linux (Wine + vkd3d-proton) test of Tested
Compared with the same tree without this PR (same settings; one of the three with With this PR
Control run (the same, but
So on this card, after this PR, skipping compute leads to the Not tested: Windows. The default 4000 ms limits. More than one run of each. Whether the Xid repeats. AI use: Claude Code (Claude Opus 5.5) merged and built the trees, ran the suite and the runs, read the logs and drafted this comment. The runs are mine, on the hardware above. |
A retail title submits a list whose
Wait64BitValueXwaits for a counter before the list, on another queue, that writes it – from one thread, and at times before that list is even recorded (@vibryxcx's trace in #505). XCL checked the wait on the CPU before submitting the waiting list, so the thread was held 2 s per wait and the writer was submitted only after the timeouts; the waiting lists ran without the value. Frames stopped and the title's watchdog ended it at+0x23cf683. Part of #505.A wait that is not met when its list is submitted now becomes
ID3D12CommandQueue::Waiton a fence of its own, as on the console, and the list goes to the GPU at once. The fence is signalled on the writer's queue right after the writer list is submitted. The writer is a list recorded already, or the first one recorded later that writes a value meeting the wait. A watcher thread signals the fence instead when the memory meets the wait (a CPU write) or after 10 s, and a writer list that is reset or released lets it go. With no queue or no fence, the wait stays a CPU wait as before.What is in it
crates/xcl/src/hle/d3d12x/list_x.rs: lists keep the values of theirWrite32/64BitValue…Xuntil submitted (value_writes),later_writer,wait_before_submit(inexecute_with_waitsandKickoffX), the gates signalled inafter_submit, the watcher (WATCHED), and two tests.crates/xcl/src/hle/d3d12x/real.rs:execute_with_waitsgets the queue.Tested
cargo test --workspace -- --test-threads=4on6c61607: 703 passed, 0 failed, 41 ignored, no SKIPPED (--no-fail-fast). An earlier run of the same commit failedplaced_title_textures_share_vram_and_preserve_pixels(+2 follow-on) – the cubemap page-count flake that fails onmainhere too and that Tests: check cubemap tile reuse independently of idle page reclamation #447 fixesa_later_writer_is_a_list_not_submitted_whose_value_meets_the_wait(the lookup) anda_wait_for_a_later_list_holds_the_gpu_not_the_submitting_thread(GPU: two queues; for a writer recorded before, recorded after the submit, released instead, and the CPU writing the counter, the submit returns at once, the waiting queue does not run before its writer, and goes on after it). With the GPU wait turned off the second fails (the submit waited 2.03 s on the CPU); without claiming a writer recorded later, its third round fails.XCL_NETWORK=0): with this change,Wait64BitValueX … waits on the GPU for list …, which writes it and is not submitted yetfor the waits @vibryxcx traced (at 177 s and 230 s in two runs). One wait whose writer was not recorded yet still timed out on the CPU in those runs; the commit now covers it. The title still ends at+0x23cf683in these runs: the frames stop before these waits, while compute pipelines are built (up to 116 s for one on this driver). This change removes one cause of the stall, not all of it.Regression run
main:
PR:
Not tested
KickoffXwith a gated wait is covered by the same functions but not by its own test.AI use
🤖 Generated with Claude Code