D3D12.X: preserve GPU wait watchdog wakeups on nvidia-dev #3130

Closed
Prime1997 wants to merge 1 commit from upstream-pr/3130 into main
Prime1997 commented 2026-11-28 12:37:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-28T12:37:30Z.


Backport #2499 by Tiago Leal (@tiagonleal), original commit 62f372122cb7c5efa8c2e78e4979e310b87dcb61, onto nvidia-dev 54225f5884a94cd23b7aab3f703a7c975070aa77. This is the NVIDIA branch port of that existing main PR. The watchdog could miss an armed wait's notification between checking its counter and sleeping, leaving the timeout monitor asleep.

What is in it

  • Take the watchdog pair's leaf mutex while notifying; preserve GPU wait, timeout and completion behavior.
  • Retain the original deterministic CPU test for notification arriving between the check and sleep. Original authorship and cherry-pick provenance are preserved.

Tested

  • Current PR head: 497b3c008eb21422d16b93df5b238550f1434508.
  • Windows 11 Pro 26200; Intel i5-10400; NVIDIA RTX 3060 Ti driver 32.0.16.1714; Rust 1.100.0; release profile.
  • Combined integration d50f6656fb50b7927a2279d4c78b24222be3da54: cargo build --locked --release -p xcl --target-dir <isolated-target> exited 0 in 228.576s, with 9 warnings. This includes the change but is not a standalone build/test of this PR head.
  • Watchdog logic tested on integration f94b44ac88a71feab670b6983f35b9837703ec00, before the later diagnostic/shader additions: cargo test --locked --release -p xcl --lib <filter> --target-dir <isolated-target> -- --exact --test-threads=1 --nocapture. Filters hle::d3d12x::list_x::tests::a_wait_armed_during_the_watchdogs_check_wakes_it and hle::d3d12x::list_x::tests::sync_watchdog_pair_is_set_before_the_thread_starts: each 1 passed, 0 failed, 0 ignored, 1,871 filtered, no SKIPPED messages. No before-fix run was performed in this batch.

Regression run
Pending paired clean-head main/PR title runs. No smoke result or confirmed world-loading recovery is claimed. Draft while required validation remains incomplete.

Not tested

  • Exact-head title regression, full GPU workspace suite, AMD/Intel and Linux/Wine.
  • Whether the missed notification occurred in the failing NVIDIA world-load session. This repairs a source-confirmed race; it does not identify or prove a fix for that session's GPU removal.

AI use
Codex (GPT-6) checked overlap, reviewed and ported the existing change, and prepared this description. The original contributor and AI provenance remain in the preserved commit.

Optional temporary Discord for coordinating contributor work, testing and comparing results: https://discord.gg/6B4TykyC4W

<!-- greyfinch-sync:ivall/xcl:issue:5540189232 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3130). Originally posted by [Prime1997](https://github.com/Prime1997) on 2026-11-28T12:37:30Z. --- Backport [#2499](https://github.com/xcl-dev/xcl/pull/2499) by Tiago Leal (@tiagonleal), original commit `62f372122cb7c5efa8c2e78e4979e310b87dcb61`, onto `nvidia-dev` `54225f5884a94cd23b7aab3f703a7c975070aa77`. This is the NVIDIA branch port of that existing main PR. The watchdog could miss an armed wait's notification between checking its counter and sleeping, leaving the timeout monitor asleep. **What is in it** - Take the watchdog pair's leaf mutex while notifying; preserve GPU wait, timeout and completion behavior. - Retain the original deterministic CPU test for notification arriving between the check and sleep. Original authorship and cherry-pick provenance are preserved. **Tested** - Current PR head: `497b3c008eb21422d16b93df5b238550f1434508`. - Windows 11 Pro 26200; Intel i5-10400; NVIDIA RTX 3060 Ti driver 32.0.16.1714; Rust 1.100.0; release profile. - Combined integration `d50f6656fb50b7927a2279d4c78b24222be3da54`: `cargo build --locked --release -p xcl --target-dir <isolated-target>` exited 0 in 228.576s, with 9 warnings. This includes the change but is not a standalone build/test of this PR head. - Watchdog logic tested on integration `f94b44ac88a71feab670b6983f35b9837703ec00`, before the later diagnostic/shader additions: `cargo test --locked --release -p xcl --lib <filter> --target-dir <isolated-target> -- --exact --test-threads=1 --nocapture`. Filters `hle::d3d12x::list_x::tests::a_wait_armed_during_the_watchdogs_check_wakes_it` and `hle::d3d12x::list_x::tests::sync_watchdog_pair_is_set_before_the_thread_starts`: each **1 passed, 0 failed, 0 ignored, 1,871 filtered**, no SKIPPED messages. No before-fix run was performed in this batch. **Regression run** Pending paired clean-head main/PR title runs. No smoke result or confirmed world-loading recovery is claimed. Draft while required validation remains incomplete. **Not tested** - Exact-head title regression, full GPU workspace suite, AMD/Intel and Linux/Wine. - Whether the missed notification occurred in the failing NVIDIA world-load session. This repairs a source-confirmed race; it does not identify or prove a fix for that session's GPU removal. **AI use** Codex (GPT-6) checked overlap, reviewed and ported the existing change, and prepared this description. The original contributor and AI provenance remain in the preserved commit. Optional temporary Discord for coordinating contributor work, testing and comparing results: https://discord.gg/6B4TykyC4W
Aniseto commented 2026-11-28 12:55:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-28T12:55:39Z.


Ran the GPU-wait watchdog tests at 497b3c00 on an NVIDIA Blackwell desktop part:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

XCL_ADAPTER=NVIDIA cargo test -p xcl --lib -- a_wait_armed_during_the_watchdogs_check_wakes_it sync_watchdog_pair_is_set_before_the_thread_starts --test-threads=1
2 passed; 0 failed; 0 ignored; 0 measured; 1805 filtered out      (exit 0)

Both deterministic CPU tests pass, including the case where a wait is armed between the watchdog's counter check and its sleep. The PR has no comments yet, so this is the first datapoint in the thread and the first from an RTX 5070 Ti. The author's run was on an RTX 3060 Ti in release; mine is debug here.

Not tested: a real GPU wait in a title, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

<!-- greyfinch-sync:ivall/xcl:comment:7239565018 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3130#issuecomment-7239565018). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-11-28T12:55:39Z. --- Ran the GPU-wait watchdog tests at `497b3c00` on an NVIDIA Blackwell desktop part: Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build. ``` XCL_ADAPTER=NVIDIA cargo test -p xcl --lib -- a_wait_armed_during_the_watchdogs_check_wakes_it sync_watchdog_pair_is_set_before_the_thread_starts --test-threads=1 2 passed; 0 failed; 0 ignored; 0 measured; 1805 filtered out (exit 0) ``` Both deterministic CPU tests pass, including the case where a wait is armed between the watchdog's counter check and its sleep. The PR has no comments yet, so this is the first datapoint in the thread and the first from an RTX 5070 Ti. The author's run was on an RTX 3060 Ti in release; mine is debug here. Not tested: a real GPU wait in a title, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash Free** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Prime1997 commented 2026-11-28 21:50:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-28T21:50:26Z.


Closing as a duplicate. This was the nvidia-dev port of #2499 by tiagonleal. nvidia-dev was merged into main by #3203 and this PR was retargeted to main, where #2499 is open with the same change. Checked and closed with Claude Code on Prime's behalf.

<!-- greyfinch-sync:ivall/xcl:comment:7246311878 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3130#issuecomment-7246311878). Originally posted by [Prime1997](https://github.com/Prime1997) on 2026-11-28T21:50:26Z. --- Closing as a duplicate. This was the `nvidia-dev` port of #2499 by tiagonleal. `nvidia-dev` was merged into `main` by #3203 and this PR was retargeted to `main`, where #2499 is open with the same change. Checked and closed with Claude Code on Prime's behalf.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!3130
No description provided.