Repository navigation
D3D12.X: the GPU wait watchdog starts after its wake pair is set - #1926
Conversation
wake_sync_watchdog spawned the xcl-sync-watchdog thread inside the OnceLock's initializer, and the thread's first line unwraps that OnceLock. If the thread ran before the initializer returned, it panicked on None. The initializer has run by then and does not run again, so no timed-out GPU wait was released on the CPU for the rest of the process. Seen once on main 4178e88 in a retail title run: "thread 'xcl-sync-watchdog' (3856) panicked at crates\xcl\src\hle\d3d12x\list_x.rs:1364:55: called `Option::unwrap()` on a `None` value". The pair is set first and the thread is started after it, by the call that set it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
|
A second sighting of the panic The run: RTX 4060 Ti 16 GB (driver 615.71.09), Fedora 44, Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b; a local merge of
(the same
Tested
Read
Not tested: a title run with the change (the race is rare: 1 in 144 here); the rest of the suite. AI use: Claude Code (Claude Fable 5.2) read the diff, ran the test, searched the logs of all the runs and wrote this report. Posted without review by a person: the account owner was away and reads replies later. |
|
Empirical verification report for PR #1926 (
Tested
Not tested
AI use
|
|
Code review on
Remaining before merge: |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
The
xcl-sync-watchdogthread, which releases a GPU wait that has not completed after 5 s, could panic as it started.wake_sync_watchdogspawned it inside theOnceLock's initializer, and the thread's first line unwraps thatOnceLock. If the thread ran before the initializer returned, it panicked onNoneand was not started again. The code is from 8a5643f (#795).Seen once, on
main4178e88in a retail title run (stderr):thread 'xcl-sync-watchdog' (3856) panicked at crates\xcl\src\hle\d3d12x\list_x.rs:1364:55:,called `Option::unwrap()` on a `None` value. It was 1 of the 12 local title runs without this fix (stderr kept) that bridged GPU waits; with the initializer delayed so that the thread runs first, it happened in both runs (one unit-test run, one title run; below). Royalflamejlh reports a second sighting on Linux (Wine, vkd3d-proton, RTX 4060 Ti): 1 of 144 title runs that logged a bridged wait, the sameunwrap. I don't claim that this fixes a stall.What is in it
hle/d3d12x/list_x.rs: the wake pair is set first, then the thread is started by the call that set it (sync_watchdog_pair, which takes the spawn as a closure so that the order can be tested). The thread's body is unchanged. If the spawn fails, nothing retries it, as before.[false], expected[true]), passes with the fixTested
cargo test --workspace --locked --no-fail-fast -- --test-threads=4: 976 passed, 0 failed, 45 ignored on2448457c's tree, run just before it was committed (22 SKIPPED lines: 18 no wave64, 3 wave32 per-lane forms refused, 1 no heap windows)main's code with a 300 ms sleep added after the spawn, so that the thread always runs first: the same panic (list_x.rs:1370:55at1d027e5); with the fix: noneXCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_NETWORK=0, A pressed every 4 s from 20 s, one run per line:main689f2db+ that sleep: the watchdog panics, 3 waits bridged (logged), 0 timed-out releases in the 27 s to the end of the process (17 s of the run, 10 s of drain)title_textures::content_hash(the read that D3D12.X: title texture reads outside the coherent window use the safe copy #751 replaces), before any wait was bridgedRegression run
main:
PR:
(the second of two pairs, run main, PR, main, PR; the first: main 1436 frames, peak 21110 MB; PR 1502 frames, 21521 MB; no removal or crash in either)
Not tested
4178e88, and did not repeat here)wake_sync_watchdog; the title runs above doRelated to #1452 (the watchdog that releases those waits; not a fix for it). If
goal:world-loadfits, please set it.Overlaps: #1123, #1045, #1046, #1429, #1580, #1732 and #1323 edit the same function or nearby lines; none fixes this.
AI use
🤖 Generated with Claude Code