D3D12.X: the GPU wait watchdog does not miss the wake of an armed wait #2489

Merged
tiagonleal merged 1 commit from upstream-pr/2499 into main 2026-11-29 07:59:51 +00:00
tiagonleal commented 2026-11-25 20:42:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-25T20:42:36Z.


The GPU wait watchdog takes its pair's lock, reads ARMED_GPU_WAITS and sleeps on the condvar when it is 0. The arm in try_gpu_wait called notify_one() without that lock, so a notify that fell between the watchdog's read of 0 and its cv.wait was 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):

  • the watchdog holds the pair's lock only from its check to cv.wait / wait_timeout and takes no other lock while it holds it (SYNC_GRAPH comes after the guard is dropped);
  • the one notifier, try_gpu_wait → wake_sync_watchdog, has dropped SYNC_GRAPH by then and takes the pair's lock last;
  • so the pair's lock is a leaf and cannot invert with SYNC_GRAPH or a queue lock.

What is in it

  • crates/xcl/src/hle/d3d12x/list_x.rs: notify_sync_watchdog takes the lock around notify_one(); the check-and-sleep moves unchanged into sync_watchdog_sleep_if_idle, which has an after_check hook (a no-op in the runtime, as frame::publish_origin's after_release); new test a_wait_armed_during_the_watchdogs_check_wakes_it.

Tested

  • Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 5070 Ti 16 GB (driver 617.42), AMD Ryzen 7 9800X3D, 32 GB RAM, rustc 1.100.0, debug tests, release smoke builds.
  • The test pauses the watchdog in 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 from notify_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 --workspace ok; cargo test --workspace --no-fail-fast -- --test-threads=4, 2 runs: 1420 passed, 4 failed, 46 ignored each; 25 SKIPPED lines. The 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3, which fail the same way on the base commit 6d12f58a on this machine (cargo test -p xcl --lib gpu::dxil::fuzz_tests::fuzz_validate_and_gpu: 0 passed, 4 failed).
  • Smoke on the title below (60 s, release): no device removal, no crash, frames 1629 vs 1529 on main, peak commit 14807 vs 14875 MB.

Regression run

main (6d12f58a):

xcl-smoke v1
commit: 6d12f58a229bc73889878a448c64dc3af25eeba0
gpu: NVIDIA GeForce RTX 5070 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1529 (PresentX 1529)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14875 MB

this PR (62f37212):

xcl-smoke v1
commit: 62f372122cb7c5efa8c2e78e4979e310b87dcb61
gpu: NVIDIA GeForce RTX 5070 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1629 (PresentX 1629)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14807 MB

Not tested

  • How often the race happens in a real title: not measured. This PR does not claim to fix the stalled load in #1452; it closes one way a wait can stay armed with no release.
  • The test covers the wake (check, arm, notify, wait), not the 5 s release that follows it on the real watchdog thread.
  • AMD and Intel GPUs.

AI use

  • Claude Code with Claude Fable 5.2 and Anthropic subagents (Claude Opus 5.5) helped developing.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5498843806 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2499). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-25T20:42:36Z. --- The GPU wait watchdog takes its pair's lock, reads `ARMED_GPU_WAITS` and sleeps on the condvar when it is 0. The arm in `try_gpu_wait` called `notify_one()` without that lock, so a notify that fell between the watchdog's read of 0 and its `cv.wait` was 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): - the watchdog holds the pair's lock only from its check to `cv.wait` / `wait_timeout` and takes no other lock while it holds it (`SYNC_GRAPH` comes after the guard is dropped); - the one notifier, `try_gpu_wait` → `wake_sync_watchdog`, has dropped `SYNC_GRAPH` by then and takes the pair's lock last; - so the pair's lock is a leaf and cannot invert with `SYNC_GRAPH` or a queue lock. **What is in it** - `crates/xcl/src/hle/d3d12x/list_x.rs`: `notify_sync_watchdog` takes the lock around `notify_one()`; the check-and-sleep moves unchanged into `sync_watchdog_sleep_if_idle`, which has an `after_check` hook (a no-op in the runtime, as `frame::publish_origin`'s `after_release`); new test `a_wait_armed_during_the_watchdogs_check_wakes_it`. **Tested** - Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 5070 Ti 16 GB (driver 617.42), AMD Ryzen 7 9800X3D, 32 GB RAM, rustc 1.100.0, debug tests, release smoke builds. - The test pauses the watchdog in `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 from `notify_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 --workspace` ok; `cargo test --workspace --no-fail-fast -- --test-threads=4`, 2 runs: 1420 passed, 4 failed, 46 ignored each; 25 `SKIPPED` lines. The 4 failures are `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3`, which fail the same way on the base commit 6d12f58a on this machine (`cargo test -p xcl --lib gpu::dxil::fuzz_tests::fuzz_validate_and_gpu`: 0 passed, 4 failed). - Smoke on the title below (60 s, release): no device removal, no crash, frames 1629 vs 1529 on main, peak commit 14807 vs 14875 MB. **Regression run** main (6d12f58a): ``` xcl-smoke v1 commit: 6d12f58a229bc73889878a448c64dc3af25eeba0 gpu: NVIDIA GeForce RTX 5070 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1529 (PresentX 1529) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14875 MB ``` this PR (62f37212): ``` xcl-smoke v1 commit: 62f372122cb7c5efa8c2e78e4979e310b87dcb61 gpu: NVIDIA GeForce RTX 5070 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1629 (PresentX 1629) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14807 MB ``` **Not tested** - How often the race happens in a real title: not measured. This PR does not claim to fix the stalled load in #1452; it closes one way a wait can stay armed with no release. - The test covers the wake (check, arm, notify, wait), not the 5 s release that follows it on the real watchdog thread. - AMD and Intel GPUs. **AI use** - Claude Code with Claude Fable 5.2 and Anthropic subagents (Claude Opus 5.5) helped developing. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
copilot-pull-request-reviewer[bot] commented 2026-11-25 20:42:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T20:42:52Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

<!-- greyfinch-sync:ivall/xcl:review:6064709068 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2499#pullrequestreview-6064709068). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-25T20:42:52Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level. An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. [Learn about Copilot code review billing](https://docs.github.com/en/copilot/concepts/agents/code-review#code-review-usage).
emirduran707 commented 2026-11-25 21:05:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T21:00:41Z.


Independent AMD RDNA4 (native wave64) test report on exact head 62f372122cb7c5efa8c2e78e4979e310b87dcb61 (clean detached checkout, no local changes).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (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 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu refused 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.
    • The PR's test passed: hle::d3d12x::list_x::tests::a_wait_armed_during_the_watchdogs_check_wakes_it.
    • The 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 seed 722 and fuzz_validate_and_gpu_3 seed 1599) are pre-existing on unmodified main on this GPU.

Regression run (60 s retail-title smoke, XCL_NETWORK=0, release)

xcl-smoke v1
commit: 62f372122cb7c5efa8c2e78e4979e310b87dcb61
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1575 (PresentX 1575)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 14222 MB

(Matched main 68a284a baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)

Not tested

  • D3D12 debug layer; Intel GPUs.

AI use

  • Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7174487666 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2499#issuecomment-7174487666). Originally posted by [emirduran707](https://github.com/emirduran707) on 2026-11-25T21:00:41Z. --- Independent AMD RDNA4 (native wave64) test report on exact head `62f372122cb7c5efa8c2e78e4979e310b87dcb61` (clean detached checkout, no local changes). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (`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 in `lower_dxil::tests::{f16,f32}_programs_on_the_gpu` refused 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. - The PR's test passed: `hle::d3d12x::list_x::tests::a_wait_armed_during_the_watchdogs_check_wakes_it`. - The 2 failures (`gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` seed 722 and `fuzz_validate_and_gpu_3` seed 1599) are pre-existing on unmodified `main` on this GPU. **Regression run** (60 s retail-title smoke, `XCL_NETWORK=0`, release) ``` xcl-smoke v1 commit: 62f372122cb7c5efa8c2e78e4979e310b87dcb61 gpu: AMD Radeon RX 9060 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1575 (PresentX 1575) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 14222 MB ``` (Matched `main` `68a284a` baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.) **Not tested** - D3D12 debug layer; Intel GPUs. **AI use** - Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
SlopTart commented 2026-11-25 21:05:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T21:00:52Z.


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 two d11_* 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.

<!-- greyfinch-sync:ivall/xcl:comment:7174492077 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2499#issuecomment-7174492077). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-25T21:00:52Z. --- `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 two `d11_*` 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 commented 2026-11-25 21:05:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T21:03:25Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7174550194 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2499#issuecomment-7174550194). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T21:03:25Z. --- 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!
thehollowedone commented 2026-11-27 03:08:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-27T03:08:08Z.


Independent Windows/NVIDIA check of PR head 62f37212 in a clean detached checkout.

  • Windows 11 build 26300, RTX 3080 Ti / NVIDIA 621.35, Ryzen 7 9800X3D, Rust 1.99.1; debug tests.
  • cargo test --offline --locked -p xcl --lib hle::d3d12x::list_x::tests::a_wait_armed_during_the_watchdogs_check_wakes_it -- --exact --test-threads=1: passed in 10 separate runs (10/10).
  • cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4: 1,423 passed, 1 failed, 46 ignored across 37 targets; 25 printed GPU SKIPPED notices are excluded from coverage.

The sole failure was gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk (cached_only console_mesh hit: "DXIL not compiled yet"). It also failed in isolation with the same assertion on the PR's exact parent 6d12f58a, using cargo test --offline --locked -p xcl --lib gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk -- --exact --test-threads=1. This establishes that failure predates this PR on this machine; it does not explain the shader-cache defect.

Not tested: a retail title, AMD or Intel GPUs, and skipped wave64 paths. No game files were used. AI use: Codex (GPT-6.2 Sol) reviewed the test scope, ran the commands and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7208734432 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2499#issuecomment-7208734432). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-27T03:08:08Z. --- Independent Windows/NVIDIA check of [PR head `62f37212`](https://github.com/xcl-dev/xcl/commit/62f372122cb7c5efa8c2e78e4979e310b87dcb61) in a clean detached checkout. - Windows 11 build 26300, RTX 3080 Ti / NVIDIA 621.35, Ryzen 7 9800X3D, Rust 1.99.1; debug tests. - `cargo test --offline --locked -p xcl --lib hle::d3d12x::list_x::tests::a_wait_armed_during_the_watchdogs_check_wakes_it -- --exact --test-threads=1`: passed in 10 separate runs (10/10). - `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4`: **1,423 passed, 1 failed, 46 ignored** across 37 targets; 25 printed GPU `SKIPPED` notices are excluded from coverage. The sole failure was `gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk` (`cached_only console_mesh hit: "DXIL not compiled yet"`). It also failed in isolation with the same assertion on the [PR's exact parent `6d12f58a`](https://github.com/xcl-dev/xcl/commit/6d12f58a229bc73889878a448c64dc3af25eeba0), using `cargo test --offline --locked -p xcl --lib gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk -- --exact --test-threads=1`. This establishes that failure predates this PR on this machine; it does not explain the shader-cache defect. Not tested: a retail title, AMD or Intel GPUs, and skipped wave64 paths. No game files were used. AI use: Codex (GPT-6.2 Sol) reviewed the test scope, ran the commands and drafted this report.
Decodere commented 2026-11-27 03:15:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T03:15:35Z.


Independent desktop NVIDIA verification of PR #2499 at head 62f372122cb7c5efa8c2e78e4979e310b87dcb61 (1 commit; exact parent & merge-base: 6d12f58a229bc73889878a448c64dc3af25eeba0, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted release tests & build (62f37212)

Command Result
cargo test --release -p xcl --lib a_wait_armed_during_the_watchdogs_check_wakes_it -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1324 filtered out × 3 (0.20s × 3, 0 skipped)
cargo test --release -p xcl --lib hle::d3d12x::list_x:: -- --test-threads=1 (3 consecutive runs) 41 passed; 0 failed; 0 ignored; 1284 filtered out × 3 (1.34s, 1.38s, 1.35s, 0 skipped)
cargo build --release -p xcl Clean build (1m 11s, exit 0, 0 new warnings)

Paired quiet 60 s retail smoke (title: 29640639)

Exact parent & merge-base (6d12f58a229bc73889878a448c64dc3af25eeba0, cached baseline on the same machine):

xcl-smoke v1
commit: 6d12f58a229bc73889878a448c64dc3af25eeba0
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1606 (PresentX 1606)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14004 MB

PR #2499 (62f372122cb7c5efa8c2e78e4979e310b87dcb61):

xcl-smoke v1
commit: 62f372122cb7c5efa8c2e78e4979e310b87dcb61
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1590 (PresentX 1590)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13984 MB

Runtime log observations (xcl.log)

  • 9221 log lines, 0 [ERROR] / device-removal / panic lines.
  • Final draw/memory telemetry in log: 19528 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample 13984 MB committed by the process; video memory 6115 MB local, 4654 MB non-local.

Limits of coverage

  • Preventing lost wakeups when a GPU wait is armed concurrently with the watchdog idle check was verified via a_wait_armed_during_the_watchdogs_check_wakes_it (3/3) and hle::d3d12x::list_x:: (41/41 × 3, 0 skipped).
  • The 60 s retail smoke on title: 29640639 confirms zero runtime regression on normal GPU waits (frame-count delta vs. cached parent reflects single-run startup variance, not this PR); an induced GPU hang / watchdog dump was not triggered during the retail run.

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7208838092 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2499#issuecomment-7208838092). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T03:15:35Z. --- Independent desktop NVIDIA verification of **PR #2499** at head `62f372122cb7c5efa8c2e78e4979e310b87dcb61` (`1` commit; exact parent & merge-base: `6d12f58a229bc73889878a448c64dc3af25eeba0`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted release tests & build (`62f37212`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib a_wait_armed_during_the_watchdogs_check_wakes_it -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1324 filtered out` × 3 (`0.20s` × 3, `0` skipped) | | `cargo test --release -p xcl --lib hle::d3d12x::list_x:: -- --test-threads=1` (3 consecutive runs) | `41 passed; 0 failed; 0 ignored; 1284 filtered out` × 3 (`1.34s`, `1.38s`, `1.35s`, `0` skipped) | | `cargo build --release -p xcl` | Clean build (`1m 11s`, exit `0`, `0` new warnings) | ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact parent & merge-base (`6d12f58a229bc73889878a448c64dc3af25eeba0`, cached baseline on the same machine): ``` xcl-smoke v1 commit: 6d12f58a229bc73889878a448c64dc3af25eeba0 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1606 (PresentX 1606) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14004 MB ``` PR #2499 (`62f372122cb7c5efa8c2e78e4979e310b87dcb61`): ``` xcl-smoke v1 commit: 62f372122cb7c5efa8c2e78e4979e310b87dcb61 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1590 (PresentX 1590) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13984 MB ``` ### Runtime log observations (`xcl.log`) - `9221` log lines, `0` `[ERROR]` / device-removal / panic lines. - Final draw/memory telemetry in log: `19528 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped)`; last memory sample `13984 MB committed by the process; video memory 6115 MB local, 4654 MB non-local`. ### Limits of coverage - Preventing lost wakeups when a GPU wait is armed concurrently with the watchdog idle check was verified via `a_wait_armed_during_the_watchdogs_check_wakes_it` (`3/3`) and `hle::d3d12x::list_x::` (`41/41` × 3, `0` skipped). - The 60 s retail smoke on `title: 29640639` confirms zero runtime regression on normal GPU waits (frame-count delta vs. cached parent reflects single-run startup variance, not this PR); an induced GPU hang / watchdog dump was not triggered during the retail run. *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
thehollowedone commented 2026-11-28 10:12:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-28T10:12:07Z.


merge-check
base: e429936c10
head: 62f372122c
merge: clean
build: cargo build --offline --locked -j 4 --workspace -> ok
tests: cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4 -> 2,126 passed, 10 failed, 48 ignored; 25 GPU SKIPPED notices. The same ten tests fail on this base: dispatch_chain_oversized_loop_matches_whole, dispatch_chain_wave32_live_loops, dispatch_chain_wave64_live_loops_and_exchange, gpu_heap_flat_reads_match_guarded_and_root_output, console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, gpu_compute_mode_dispatch_abi, gpu_float_cas_uses_ieee_equality, test_title_runs_and_game_folder_is_untouched, test_title_runs_under_the_debug_layer_with_dred, and test_title_draws_with_a_root_signature_under_the_debug_layer. Focused a_wait_armed_during_the_watchdogs_check_wakes_it: 1 passed, 0 failed.
review: No blocker found in the full merged diff. The notifier now acquires the watchdog pair mutex across notify_one, closing the interval between the watchdog's idle check and its condition-variable wait. The watchdog releases that mutex before acquiring SYNC_GRAPH; the arming path releases SYNC_GRAPH before notifying, so this does not invert the lock order. The 200 ms regression pause covers the missed-wake schedule, although a single successful timing test is not proof against all scheduling variations. The author's clean-head paired smoke blocks and independent exact-head test reports are in the PR.
performance: One short mutex acquisition per armed-wait notification; the 50 ms watchdog poll and GPU work are unchanged. Frame-time cost was not measured in this check.
verdict: safe to merge
hardware / tool and model: Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), DXC 1.8.2502.11; Codex (GPT-6.2 Sol) ran the build and tests and reviewed the merged diff; Codex (GPT-6.2 Astra) independently reviewed the synchronization and lock order.

<!-- greyfinch-sync:ivall/xcl:comment:7237740257 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2499#issuecomment-7237740257). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-28T10:12:07Z. --- merge-check base: e429936c10a5b8aa09470ff99dfc8c8d3d8c56fd head: 62f372122cb7c5efa8c2e78e4979e310b87dcb61 merge: clean build: `cargo build --offline --locked -j 4 --workspace` -> ok tests: `cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4` -> 2,126 passed, 10 failed, 48 ignored; 25 GPU `SKIPPED` notices. The same ten tests fail on this base: `dispatch_chain_oversized_loop_matches_whole`, `dispatch_chain_wave32_live_loops`, `dispatch_chain_wave64_live_loops_and_exchange`, `gpu_heap_flat_reads_match_guarded_and_root_output`, `console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk`, `gpu_compute_mode_dispatch_abi`, `gpu_float_cas_uses_ieee_equality`, `test_title_runs_and_game_folder_is_untouched`, `test_title_runs_under_the_debug_layer_with_dred`, and `test_title_draws_with_a_root_signature_under_the_debug_layer`. Focused `a_wait_armed_during_the_watchdogs_check_wakes_it`: 1 passed, 0 failed. review: No blocker found in the full merged diff. The notifier now acquires the watchdog pair mutex across `notify_one`, closing the interval between the watchdog's idle check and its condition-variable wait. The watchdog releases that mutex before acquiring `SYNC_GRAPH`; the arming path releases `SYNC_GRAPH` before notifying, so this does not invert the lock order. The 200 ms regression pause covers the missed-wake schedule, although a single successful timing test is not proof against all scheduling variations. The author's clean-head paired smoke blocks and independent exact-head test reports are in the PR. performance: One short mutex acquisition per armed-wait notification; the 50 ms watchdog poll and GPU work are unchanged. Frame-time cost was not measured in this check. verdict: safe to merge hardware / tool and model: Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), DXC 1.8.2502.11; Codex (GPT-6.2 Sol) ran the build and tests and reviewed the merged diff; Codex (GPT-6.2 Astra) independently reviewed the synchronization and lock order.
throny commented 2026-11-28 13:04:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T13:04:29Z.


merge-check claim
head: 62f372122c

<!-- greyfinch-sync:ivall/xcl:comment:7239670909 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2499#issuecomment-7239670909). Originally posted by [throny](https://github.com/throny) on 2026-11-28T13:04:29Z. --- merge-check claim head: 62f372122cb7c5efa8c2e78e4979e310b87dcb61
throny commented 2026-11-28 13:22:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T13:22:34Z.


merge-check
base: e429936c
head: 62f372122c
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2127 passed, 9 failed, 48 ignored: the base's 9 only (26 SKIPPED lines). The 9 failures are main's own at e429936c on this GPU (#3093); base alone: 2126 passed, 9 failed, 48 ignored.
review: none. The race is real on main: the watchdog checks the armed count under its lock and then waits on the condition variable, while the arming side increments and notifies without the lock, so a notify between the check and the wait is lost. With the PR the notify takes the lock, so it lands either before the check (the watchdog then sees the count) or after the wait has released the lock (it wakes). A spurious wake re-checks and sleeps again, so no spinning; no more wakes than before; the lock is a leaf. (The stored diff no longer applies textually because of a stale context line; the three-way merge is clean and built.)
performance: default path: one uncontended mutex lock per armed GPU wait (reasoned; the PR's own smoke pair shows no cost).
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7239890990 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2499#issuecomment-7239890990). Originally posted by [throny](https://github.com/throny) on 2026-11-28T13:22:34Z. --- merge-check base: e429936c head: 62f372122cb7c5efa8c2e78e4979e310b87dcb61 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2127 passed, 9 failed, 48 ignored: the base's 9 only (26 SKIPPED lines). The 9 failures are main's own at e429936c on this GPU (#3093); base alone: 2126 passed, 9 failed, 48 ignored. review: none. The race is real on main: the watchdog checks the armed count under its lock and then waits on the condition variable, while the arming side increments and notifies without the lock, so a notify between the check and the wait is lost. With the PR the notify takes the lock, so it lands either before the check (the watchdog then sees the count) or after the wait has released the lock (it wakes). A spurious wake re-checks and sleeps again, so no spinning; no more wakes than before; the lock is a leaf. (The stored diff no longer applies textually because of a stale context line; the three-way merge is clean and built.) performance: default path: one uncontended mutex lock per armed GPU wait (reasoned; the PR's own smoke pair shows no cost). verdict: safe to merge hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
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!2489
No description provided.