Tests: the GPU-wait watchdog releases a bridged Wait64 whose producer was never submitted #2443
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!2443
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2443"
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 19:06 UTC · original
tiagonleal:test-wait64-unsubmitted-producer→main· +97 −0 · 1 files · 2 commits · openPart of #1452.
A
Wait64BitValueXis bridged to a GPUqueue.Waitwhenever aWrite64BitValueXfor the same address has been recorded (try_gpu_wait). If that producer list is recorded but never submitted, the log showsprod=qNone ... wait-before-signalandrecorded=<v> submitted=0x0 completed=0x0, and the waiting queue stays blocked until the sync watchdog signals the fence on the CPU afterXCL_GPU_WAIT_TIMEOUT_MS(5 s by default). Nothing in the test suite arms a wait this way and waits for the realxcl-sync-watchdogthread: the only test of the expiry path,cpu_watchdog_signal_with_inflight_gpu_signal_completes_cleanly, signals the fence by hand.What is in it
#[cfg(test)]test incrates/xcl/src/hle/d3d12x/list_x.rs,unsubmitted_write64_producer_wait_is_released_by_the_watchdog(+82 lines, nothing outsidemod tests).Write64and a DIRECT list with the matchingWait64, arms the DIRECT list's wait on its queue throughexecute_with_waits_on(the COMPUTE list is never submitted), then signals a fence on that queue. It checks that the fence stays at 0 while the wait is armed (submitted_max == 0), that it reaches 1 after the watchdog timeout and not before, that the cell records the CPU release (no armed waits left,cpu_signaled_max == 0x677), and that the queue runs more work afterwards.OnceLockread from the environment, so the test uses whatever it resolved to (5 s by default, about 5.4 s of wall time) instead of setting a process-wide variable that could race with the other tests. Same GPU-or-WARP device setup as the neighbouring tests.It passes on main and only pins the current behaviour; no runtime code changes. It will also catch a change that stops expiring waits with no known producer, which is what #1046, #1045 and #1123 touch.
Tested
3f277701plus this commit. No game was running when the runs started.cargo test -p xcl --lib unsubmitted_write64_producer -- --nocapture: 1 passed; the log shows thebridged to GPU queue.Wait (... prod=qNone ...; wait-before-signal ...)line and thendid not complete within 5000 ms ... released on CPU. The same test binary run alone 5 times: 5/5 passed (5.3 s each).hle::d3d12xwith--test-threads=4, 3 runs: 246 passed, 0 failed, 2 ignored each time.cargo test --workspace -j 6 -- --test-threads=4, 3 runs: 1275 passed, 5 failed, 26 ignored each time; the new test passes in all 3. The 5 failures are the same on3f277701without this commit (1274 passed, 5 failed, 26 ignored):gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0to_3andgpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier. 24SKIPPEDlines per run on this adapter (no wave64and similar).Notes on the test
execute_with_waits_onstill arms thequeue.Wait):ExecuteCommandListsgoes through the queue hook, which would add the queue, blocked for 5 s, topresent::QUEUES, and the sparse tests (flush_parked...,a_tile_decommitted...) andreadback_routing_teststhen wait on it and fail when they run in that window. I found this because the first version executed the list and failed 3 other tests in a parallel run.ExecuteCommandListsalso re-entersexecute_with_waits_on, so a bridged wait can be armed twice for one list (seen with--test-threads=4); the assertions accept one or more armed waits for that reason. Observation only, not changed here.Update, second commit
84ee77d1(review request)Dropruns the cleanup on a normal return and on unwind:on_releasefor both lists, the fence, and the twoSYNC_GRAPHentries. +22/−7, still nothing outsidemod tests.panic!forced right after the guard:hle::d3d12xwith--test-threads=4gave 245 passed, 1 failed (the forced one), 2 ignored. The panic is not in the commit.84ee77d1: the test alone 5 of 5;hle::d3d12x3 runs, 246 passed, 0 failed each;cargo test --workspace --no-fail-fast -j 4 -- --test-threads=4twice, 1353 passed, 5 failed, 46 ignored each time (25SKIPPEDlines), the same 5 failures as above. These totals count every test binary of the workspace.Regression run
First block:
main3f277701; second: this PR's head84ee77d1; same title, built from clean trees, run again after the second commit.Not tested
XCL_GPU_WAIT_TIMEOUT_MSset to a non-default value (the value is read once per process).AI use
🤖 Generated with Claude Code
@emirduran707 on GitHub · 2026-11-25 19:54 UTC · original
Independent AMD RDNA4 (native wave64) test report on exact head
9dd81efd3145e6456cbc72025794eb3b9949c831(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: 1355 passed, 3 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::unsubmitted_write64_producer_wait_is_released_by_the_watchdog.main:gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 722) andfuzz_validate_and_gpu_3(seed 1599) on this GPU, plusgpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier(from50a9fde/ #2074, fixed later onmainin #2420).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 20:02 UTC · original
gpu_suite (cold cache): 160 passed / 4 failed, no crashes. The four are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, depth-buffer state refusal, andgpu_promoted_uav_clear_values_pass_create_committed_resource(report); none caused by this PR.Targeted run of the new watchdog tests (
unsubmitted_write64_producer_wait_is_released_by_the_watchdogand friends): 3 passed, including the 5 s release path, on this lane. Related to the failures I logged on #2439: the twod11_*tests that hang until the watchdog fires are the same mechanism, and this PR's harness approach looks compatible.@DavidM1911 on GitHub · 2026-11-25 20:15 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.Thanks!
@luckyteagirl on GitHub · 2026-11-25 21:57 UTC · original
One test-isolation issue: this fixture calls
on_createfor both lists and records the fakevain the sync graph, buton_releaseand the graph/fence cleanup run only after the assertions and the finalexpect. If the watchdog behavior regresses, an assertion panics first; the COM lists andcellthen drop while their raw addresses remain in global test state. Later tests running in the same process can encounter stale registrations and report secondary failures unrelated to their own code.Could you install a small scope guard immediately after registration to run the existing cleanup on both normal return and unwind? This is especially useful for a test whose purpose is to catch a timeout/failure path.
Read-only review of head
9dd81efd3145e6456cbc72025794eb3b9949c831; I did not build or run it. AI use: OpenAI Codex and a Luna subagent inspected the diff and drafted this finding.@luckyteagirl on GitHub · 2026-11-25 22:21 UTC · original
Focused RX 6800M report for exact PR head
9dd81efd3145e6456cbc72025794eb3b9949c831(clean detached worktree).Tested
30.0.13002.13003; Windows 11 Home build 26200; Rust1.99.0MSVC.XCL_ADAPTER=6800M XCL_REQUIRE_GPU=1 XCL_DIRECT_DXIL=1 cargo test --locked -p xcl --lib -j 2 unsubmitted_write64_producer_wait_is_released_by_the_watchdog -- --test-threads=1 --show-output: 1 passed, 0 failed, 0 ignored, 0 skipped. The expected 5-second GPU wait timeout released on CPU; noSKIPPEDrecord appeared. Resource guard: none. Log:filter-unsubmitted-write64-watchdog.log.Not tested
AI use
@tiagonleal on GitHub · 2026-11-25 22:41 UTC · original
Done in
84ee77d1. The test now installs a guard right after the registrations, and itsDropruns the cleanup that used to sit at the end of the test:on_releasefor both lists, the fence, and the twoSYNC_GRAPHentries. It runs on a normal return and on unwind, and it takes over a poisoned lock so it cannot panic a second time.To check the failure path I forced a
panic!right after the guard and rancargo test -p xcl --lib -- hle::d3d12x --test-threads=4: 245 passed, 1 failed (the forced one), 2 ignored. The panic is not in the commit.The suite counts and the two smoke blocks in the description are for the new head.
@DavidM1911 on GitHub · 2026-11-26 02:12 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
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.