D3D12.X: the GPU wait watchdog does not miss the wake of an armed wait #2499
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2499
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2499"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@tiagonleal on GitHub · 2026-11-25 20:42 UTC · original
tiagonleal:watchdog-lost-wakeup→main· +66 −6 · 1 files · 1 commits · openThe GPU wait watchdog takes its pair's lock, reads
ARMED_GPU_WAITSand sleeps on the condvar when it is 0. The arm intry_gpu_waitcallednotify_one()without that lock, so a notify that fell between the watchdog's read of 0 and itscv.waitwas lost: the watchdog slept with the wait armed, its timeout never ran, and a wait with no producer was never released on the CPU (no "did not complete … released on CPU" line). Only a later arm woke it. The notify now takes the pair's lock.Part of #1452
Lock order (all callers):
cv.wait/wait_timeoutand takes no other lock while it holds it (SYNC_GRAPHcomes after the guard is dropped);try_gpu_wait→wake_sync_watchdog, has droppedSYNC_GRAPHby then and takes the pair's lock last;SYNC_GRAPHor a queue lock.What is in it
crates/xcl/src/hle/d3d12x/list_x.rs:notify_sync_watchdogtakes the lock aroundnotify_one(); the check-and-sleep moves unchanged intosync_watchdog_sleep_if_idle, which has anafter_checkhook (a no-op in the runtime, asframe::publish_origin'safter_release); new testa_wait_armed_during_the_watchdogs_check_wakes_it.Tested
after_check(it has read 0 and holds the lock), arms and notifies from the test thread, and requires the watchdog to wake within 2 s. Without the fix (the lock removed fromnotify_sync_watchdog, local commit):FAILED … assertion failed: the watchdog slept through the arm's notify, left: Err(Timeout)(1 failed, 2.02 s). With the fix: passed 10 of 10 runs alone (0.20 s each).cargo test -p xcl --lib hle::d3d12x -- --test-threads=4, 3 runs: 254 passed, 0 failed, 2 ignored each.cargo build --workspaceok;cargo test --workspace --no-fail-fast -- --test-threads=4, 2 runs: 1420 passed, 4 failed, 46 ignored each; 25SKIPPEDlines. The 4 failures aregpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3, which fail the same way on the base commit6d12f58aon this machine (cargo test -p xcl --lib gpu::dxil::fuzz_tests::fuzz_validate_and_gpu: 0 passed, 4 failed).Regression run
main (
6d12f58a):this PR (
62f37212):Not tested
AI use
🤖 Generated with Claude Code
@emirduran707 on GitHub · 2026-11-25 21:00 UTC · original
Independent AMD RDNA4 (native wave64) test report on exact head
62f372122cb7c5efa8c2e78e4979e310b87dcb61(clean detached checkout, no local changes).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1422 passed, 2 failed, 46 ignored; 8 SKIPPED (6 inlower_dxil::tests::{f16,f32}_programs_on_the_gpurefused by per-lane form;heap_window_out_of_memory_falls_back_to_the_switch_form;pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.hle::d3d12x::list_x::tests::a_wait_armed_during_the_watchdogs_check_wakes_it.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1seed 722 andfuzz_validate_and_gpu_3seed 1599) are pre-existing on unmodifiedmainon this GPU.Regression run (60 s retail-title smoke,
XCL_NETWORK=0, release)(Matched
main68a284abaseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)Not tested
AI use
@SlopTart on GitHub · 2026-11-25 21:00 UTC · original
gpu_suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.Targeted run of the new
a_wait_armed_during_the_watchdogs_check_wakes_it: passed. Related context from this lane: on #2439 twod11_*tests sit red here because bridged Wait64 waits get released by the 5 s watchdog; this PR's armed-wake fix is the right machinery for that class.@DavidM1911 on GitHub · 2026-11-25 21:03 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.