D3D12.X: track Write64 fence highs and keep the sync watchdog awake after CPU releases #1419

Open
gridoe wants to merge 1 commit from upstream-pr/1429 into main
gridoe commented 2026-11-24 15:53:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gridoe on 2026-11-24T15:53:04Z.


On native Windows D3D12, an older in-flight GPU queue.Signal(&fence, v - 1) on a slower queue can retire after a higher GPU completion or a CPU fence.Signal(v) (from a cycle-break or watchdog release) and rewind ID3D12Fence::GetCompletedValue() backwards. Two gaps in list_x.rs let those rewinds stick and stall later queue.Wait calls:

  1. prune_completed_waits did not track the highest observed GetCompletedValue() on a SyncCell or restore a fence that dropped below cpu_signaled_max.max(highest_completed).
  2. When a CPU cycle-break or watchdog release cleared the last pending wait, ARMED_GPU_WAITS dropped to 0 and xcl-sync-watchdog went straight back to cv.wait, so an older in-flight GPU Signal retiring milliseconds later rewound the fence with nothing awake to restore it.

This change records SyncCell::highest_completed, restores rewound fences in prune_completed_waits, and adds a short REWIND_GUARD_UNTIL window (10 s, polling at 20 ms while ARMED_GPU_WAITS == 0) armed whenever a CPU release or rewind repair occurs so xcl-sync-watchdog catches post-release GPU rewinds.

What is in it

  • crates/xcl/src/hle/d3d12x/list_x.rs: track SyncCell::highest_completed, detect/restore fence rewinds in prune_completed_waits, add REWIND_GUARD_UNTIL / arm_rewind_guard / rewind_guard_active for xcl-sync-watchdog, and add sync_watchdog_and_prune_repair_fence_rewind_with_zero_armed_waits.

Tested

  • Hardware / OS / toolchain: NVIDIA GeForce RTX 3080 (10053 MiB VRAM, driver 617.42, wave32), AMD Ryzen 7 5700X3D (16 logical CPUs), 32 GB RAM, Windows 11 IoT Enterprise LTSC 2024 26H2 (Build 26300.9974), DXC 1.9.2602.17, rustc 1.99.1 (58cf8f9c3 2026-10-13) (stable-x86_64-pc-windows-msvc), debug (tests) and release (smoke).
  • Rebased onto main (9633138) as dd5ea20: cargo +stable-x86_64-pc-windows-msvc test -p xcl --lib hle::d3d12x::list_x::tests — 35 passed, 0 failed (including sync_watchdog_and_prune_repair_fence_rewind_with_zero_armed_waits); cargo +stable-x86_64-pc-windows-msvc build --release -p xcl clean.
  • Original head 3ea5ef4: cargo +stable-x86_64-pc-windows-msvc test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored (SKIPPED on this adapter: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, test_title_draws_with_a_root_signature_under_the_debug_layer, uploads_start_from_each_subresources_state).
  • Retail title (<game folder>): 60 s regression run below; in longer bring-up runs past the opening title card on this machine, multi-queue Write64 rewinds (0x6df -> 0x6de, 0x6e1 -> 0x6e0, 0x795 -> 0x794) were caught and repaired, cutting GPU queue.Wait timeouts from 166 to 0 in the compared run.

Regression run

main:

xcl-smoke v1
commit: 9aec53df7004bd9018ef3df67532f85d66ee261c
gpu: NVIDIA GeForce RTX 3080
title: d2d324b7
seconds: 60
exit: 0x0
frames shown: 1581 (PresentX 1581)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17039 MB

PR:

xcl-smoke v1
commit: b14487f442d91f33e8640bddfc91fe1eb1261773
gpu: NVIDIA GeForce RTX 3080
title: d2d324b7
seconds: 60
exit: 0x0
frames shown: 1441 (PresentX 1441)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15182 MB

Not tested

  • AMD / Intel GPUs, native wave64 hardware, D3D12 debug layer (d3d12SDKLayers.dll not installed), Wine / vkd3d-proton.
  • Other retail titles and sample-data tests requiring XCL_SAMPLE_* env vars.
  • The 60 s smoke run stays on the menu where multi-queue Write64 rewinds do not occur; the zero-armed-waits rewind repair path is covered directly by the unit test and by longer local bring-up runs.

AI use

  • Antigravity with Gemini 4 Neon: helped diagnose the post-release rewind from logs/minidumps, wrote the fix, unit test, rebase resolution, and PR description; all builds, tests, and smoke runs were executed locally on the hardware listed above.
<!-- greyfinch-sync:ivall/xcl:issue:5475593382 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1429). Originally posted by [gridoe](https://github.com/gridoe) on 2026-11-24T15:53:04Z. --- On native Windows D3D12, an older in-flight GPU `queue.Signal(&fence, v - 1)` on a slower queue can retire after a higher GPU completion or a CPU `fence.Signal(v)` (from a cycle-break or watchdog release) and rewind `ID3D12Fence::GetCompletedValue()` backwards. Two gaps in `list_x.rs` let those rewinds stick and stall later `queue.Wait` calls: 1. `prune_completed_waits` did not track the highest observed `GetCompletedValue()` on a `SyncCell` or restore a fence that dropped below `cpu_signaled_max.max(highest_completed)`. 2. When a CPU cycle-break or watchdog release cleared the last pending wait, `ARMED_GPU_WAITS` dropped to `0` and `xcl-sync-watchdog` went straight back to `cv.wait`, so an older in-flight GPU `Signal` retiring milliseconds later rewound the fence with nothing awake to restore it. This change records `SyncCell::highest_completed`, restores rewound fences in `prune_completed_waits`, and adds a short `REWIND_GUARD_UNTIL` window (10 s, polling at 20 ms while `ARMED_GPU_WAITS == 0`) armed whenever a CPU release or rewind repair occurs so `xcl-sync-watchdog` catches post-release GPU rewinds. **What is in it** - `crates/xcl/src/hle/d3d12x/list_x.rs`: track `SyncCell::highest_completed`, detect/restore fence rewinds in `prune_completed_waits`, add `REWIND_GUARD_UNTIL` / `arm_rewind_guard` / `rewind_guard_active` for `xcl-sync-watchdog`, and add `sync_watchdog_and_prune_repair_fence_rewind_with_zero_armed_waits`. **Tested** - Hardware / OS / toolchain: NVIDIA GeForce RTX 3080 (10053 MiB VRAM, driver 617.42, wave32), AMD Ryzen 7 5700X3D (16 logical CPUs), 32 GB RAM, Windows 11 IoT Enterprise LTSC 2024 26H2 (Build 26300.9974), DXC 1.9.2602.17, `rustc 1.99.1 (58cf8f9c3 2026-10-13)` (`stable-x86_64-pc-windows-msvc`), debug (tests) and release (smoke). - Rebased onto `main` (`9633138`) as `dd5ea20`: `cargo +stable-x86_64-pc-windows-msvc test -p xcl --lib hle::d3d12x::list_x::tests` — **35 passed, 0 failed** (including `sync_watchdog_and_prune_repair_fence_rewind_with_zero_armed_waits`); `cargo +stable-x86_64-pc-windows-msvc build --release -p xcl` clean. - Original head `3ea5ef4`: `cargo +stable-x86_64-pc-windows-msvc test --workspace -- --test-threads=4`: **752 passed, 0 failed, 41 ignored** (`SKIPPED` on this adapter: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `test_title_draws_with_a_root_signature_under_the_debug_layer`, `uploads_start_from_each_subresources_state`). - Retail title (`<game folder>`): 60 s regression run below; in longer bring-up runs past the opening title card on this machine, multi-queue `Write64` rewinds (`0x6df -> 0x6de`, `0x6e1 -> 0x6e0`, `0x795 -> 0x794`) were caught and repaired, cutting `GPU queue.Wait` timeouts from 166 to 0 in the compared run. **Regression run** main: ``` xcl-smoke v1 commit: 9aec53df7004bd9018ef3df67532f85d66ee261c gpu: NVIDIA GeForce RTX 3080 title: d2d324b7 seconds: 60 exit: 0x0 frames shown: 1581 (PresentX 1581) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17039 MB ``` PR: ``` xcl-smoke v1 commit: b14487f442d91f33e8640bddfc91fe1eb1261773 gpu: NVIDIA GeForce RTX 3080 title: d2d324b7 seconds: 60 exit: 0x0 frames shown: 1441 (PresentX 1441) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15182 MB ``` **Not tested** - AMD / Intel GPUs, native wave64 hardware, D3D12 debug layer (`d3d12SDKLayers.dll` not installed), Wine / `vkd3d-proton`. - Other retail titles and sample-data tests requiring `XCL_SAMPLE_*` env vars. - The 60 s smoke run stays on the menu where multi-queue `Write64` rewinds do not occur; the zero-armed-waits rewind repair path is covered directly by the unit test and by longer local bring-up runs. **AI use** - Antigravity with Gemini 4 Neon: helped diagnose the post-release rewind from logs/minidumps, wrote the fix, unit test, rebase resolution, and PR description; all builds, tests, and smoke runs were executed locally on the hardware listed above.
futurepro62 commented 2026-11-24 16:07:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T15:57:48Z.


Full-suite run, since this PR has no test report yet. Tested exact head 3ea5ef4 (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: sync_watchdog_and_prune_repair_fence_rewind_with_zero_armed_waits.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7136900608 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1429#issuecomment-7136900608). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T15:57:48Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `3ea5ef4` (on its base `930e8b4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **752 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `sync_watchdog_and_prune_repair_fence_rewind_with_zero_armed_waits`. - Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **752 passed, 0 failed, 41 ignored**, no skips. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
gut0to commented 2026-11-24 19:02:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gut0to on 2026-11-24T19:02:11Z.

Review: COMMENTED


AI-assisted review; I checked the guard lifetime against the D3D12 queue ordering described in the PR.

<!-- greyfinch-sync:ivall/xcl:review:6045520804 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1429#pullrequestreview-6045520804). Originally posted by [gut0to](https://github.com/gut0to) on 2026-11-24T19:02:11Z. **Review:** COMMENTED --- AI-assisted review; I checked the guard lifetime against the D3D12 queue ordering described in the PR.
DavidM1911 commented 2026-11-24 19:07:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T18:52:18Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7141268730 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1429#issuecomment-7141268730). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T18:52:18Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
gut0to commented 2026-11-24 19:08:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gut0to on 2026-11-24T19:02:11Z.

Code review location: crates/xcl/src/hle/d3d12x/list_x.rs; line 1101

@@ -1088,8 +1091,32 @@ impl SyncGraph {
 static SYNC_GRAPH: Mutex<Option<SyncGraph>> = Mutex::new(None);
 static ARMED_GPU_WAITS: AtomicUsize = AtomicUsize::new(0);
 static SYNC_WATCHDOG_WAKE: OnceLock<(Mutex<()>, Condvar)> = OnceLock::new();
+/// Keeps `xcl-sync-watchdog` polling briefly after any CPU release or rewind repair even once
+/// `ARMED_GPU_WAITS` drops to 0, so older in-flight GPU `Signal`s that retire right after a CPU
+/// `fence.Signal` cannot leave the fence rewound while the watchdog is asleep on `cv.wait`.
+static REWIND_GUARD_UNTIL: Mutex<Option<Instant>> = Mutex::new(None);
 static QUEUE_IDS: Mutex<Vec<usize>> = Mutex::new(Vec::new());
 
+fn arm_rewind_guard() {
+    let until = Instant::now() + Duration::from_secs(10);

The rewind guard expires after 10 seconds, but a queued ID3D12CommandQueue::Signal has no completion deadline: it can remain behind stalled or long-running work and retire after this window. Once the guard expires with no armed waits, the watchdog returns to cv.wait, so that late lower signal can rewind the fence without repair until some later event happens to wake the watchdog. Could the guard remain active while older signals are in flight, or otherwise track their completion rather than use a fixed timeout? AI-assisted review; I verified the fixed window and idle branch.

<!-- greyfinch-sync:ivall/xcl:review-comment:4685068929 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1429#discussion_r4685068929). Originally posted by [gut0to](https://github.com/gut0to) on 2026-11-24T19:02:11Z. **Code review location:** `crates/xcl/src/hle/d3d12x/list_x.rs`; line 1101 ~~~~diff @@ -1088,8 +1091,32 @@ impl SyncGraph { static SYNC_GRAPH: Mutex<Option<SyncGraph>> = Mutex::new(None); static ARMED_GPU_WAITS: AtomicUsize = AtomicUsize::new(0); static SYNC_WATCHDOG_WAKE: OnceLock<(Mutex<()>, Condvar)> = OnceLock::new(); +/// Keeps `xcl-sync-watchdog` polling briefly after any CPU release or rewind repair even once +/// `ARMED_GPU_WAITS` drops to 0, so older in-flight GPU `Signal`s that retire right after a CPU +/// `fence.Signal` cannot leave the fence rewound while the watchdog is asleep on `cv.wait`. +static REWIND_GUARD_UNTIL: Mutex<Option<Instant>> = Mutex::new(None); static QUEUE_IDS: Mutex<Vec<usize>> = Mutex::new(Vec::new()); +fn arm_rewind_guard() { + let until = Instant::now() + Duration::from_secs(10); ~~~~ --- The rewind guard expires after 10 seconds, but a queued `ID3D12CommandQueue::Signal` has no completion deadline: it can remain behind stalled or long-running work and retire after this window. Once the guard expires with no armed waits, the watchdog returns to `cv.wait`, so that late lower signal can rewind the fence without repair until some later event happens to wake the watchdog. Could the guard remain active while older signals are in flight, or otherwise track their completion rather than use a fixed timeout? AI-assisted review; I verified the fixed window and idle branch.
gridoe commented 2026-11-25 12:06:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gridoe on 2026-11-25T11:19:06Z.


Rebased onto current main (9633138) as dd5ea20, resolving the two additive conflicts in crates/xcl/src/hle/d3d12x/list_x.rs alongside #1926, #2078, and #2163.

Tested

  • Hardware / OS / toolchain: NVIDIA GeForce RTX 3080 (driver 617.42, wave32), AMD Ryzen 7 5700X3D, Windows 11 IoT Enterprise LTSC 2024 26H2 (Build 26300.9974), rustc 1.99.1 (stable-x86_64-pc-windows-msvc).
  • cargo +stable-x86_64-pc-windows-msvc test -p xcl --lib hle::d3d12x::list_x::tests — 35 passed, 0 failed (including sync_watchdog_and_prune_repair_fence_rewind_with_zero_armed_waits, sync_watchdog_pair_is_set_before_the_thread_starts, and cpu_cycle_break_publishes_value_to_title_memory_and_keeps_it_monotonic).
  • cargo +stable-x86_64-pc-windows-msvc test -p xcl --lib -- --test-threads=4 — 1,173 passed, 2 unrelated pre-existing failures on main 9633138 (gpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator and hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa), 26 ignored.

AI use: Rebase conflict resolution and test verification assisted by Antigravity with Gemini 4 Neon.

<!-- greyfinch-sync:ivall/xcl:comment:7160885896 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1429#issuecomment-7160885896). Originally posted by [gridoe](https://github.com/gridoe) on 2026-11-25T11:19:06Z. --- Rebased onto current `main` (`9633138`) as `dd5ea20`, resolving the two additive conflicts in `crates/xcl/src/hle/d3d12x/list_x.rs` alongside `#1926`, `#2078`, and `#2163`. **Tested** - Hardware / OS / toolchain: NVIDIA GeForce RTX 3080 (driver 617.42, wave32), AMD Ryzen 7 5700X3D, Windows 11 IoT Enterprise LTSC 2024 26H2 (Build 26300.9974), `rustc 1.99.1` (`stable-x86_64-pc-windows-msvc`). - `cargo +stable-x86_64-pc-windows-msvc test -p xcl --lib hle::d3d12x::list_x::tests` — **35 passed, 0 failed** (including `sync_watchdog_and_prune_repair_fence_rewind_with_zero_armed_waits`, `sync_watchdog_pair_is_set_before_the_thread_starts`, and `cpu_cycle_break_publishes_value_to_title_memory_and_keeps_it_monotonic`). - `cargo +stable-x86_64-pc-windows-msvc test -p xcl --lib -- --test-threads=4` — 1,173 passed, 2 unrelated pre-existing failures on `main` `9633138` (`gpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator` and `hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa`), 26 ignored. **AI use:** Rebase conflict resolution and test verification assisted by Antigravity with Gemini 4 Neon.
ClosetPie107 commented 2026-11-25 13:09:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-25T13:09:23Z.


Update for head b14487f4 (earlier results for dd5ea20 below)

Same RX 9070 / RADV / Proton Experimental machine, patched vkd3d-proton (master ec207194 without the allocator / command-list lpVtbl checks), Rust 1.96.0, x86_64-pc-windows-gnu. Head merged onto main 83b00818, test commit ff73a5f9.

Tests (debug, XCL_REQUIRE_GPU=wave64, --test-threads=1)

  • hle::d3d12x::list_x::: 41 passed, 0 failed (main: 40 passed, 0 failed), including sync_watchdog_and_prune_repair_fence_rewind_with_zero_armed_waits
  • cargo test --workspace --no-fail-fast -- --test-threads=4, lib binary: 1322 passed, 8 failed, 27 ignored (main the same run: 1320 passed, 9 failed, 27 ignored). The failures are all among main's.

Retail title, 300 s (release, every run from a copy of the same warm-cache snapshot; XCL_DIRECT_DXIL=1 XCL_PREPARE=1 XCL_PSO_PRELOAD=1 XCL_PSO_WAIT_MS=50 XCL_TEXTURE_LEVEL_PAGES=1 XCL_COHERENT_MB=1024 VKD3D_CONFIG=ignore_shared_fence, A pressed every 10 s)

  • 3 runs: 2 clean (exit 0, 2,018 and 1,875 presents). 1 ended with 0xc0000005 in the title (game_scarlett_master.exe+0x23cf683, a write at address 0) at 305.7 s, after the 300 s, while the title was being stopped; it had 2,046 presents. main, 4 runs: all clean, 1,892–2,122. It is not this PR's: the same crash (same offset, a write at address 0) happened in 16 earlier runs on this machine on trees without this PR (11-24 and 11-26, at ~110–130 s), and on #3011 a skip file of the title's ray-tracing programs is reported to remove it.

Not tested

  • Native Windows, NVIDIA/Intel
  • A fence rewind on this machine (the log shows none)

AI use

  • Claude Code (Claude Opus 5.5) wrote the test scripts, ran the tests and runs on this machine and wrote this update.

Linux / AMD RDNA4 (RADV) test report for head dd5ea20 merged locally onto main 1a0bbe3 (clean merge).

Environment

  • AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS
  • Proton Experimental (experimental-11.0-20261112), vkd3d-proton v3.1 (#257 + dxil-spirv master 694cc674), DXVK v3.1.1-209, DXC 1.9.2609.5, x86_64-pc-windows-gnu cross-compile

Tested (debug test binary under Wine, XCL_ADAPTER=9070 XCL_REQUIRE_GPU=wave64, --test-threads=1 --nocapture)

  • hle::d3d12x::list_x: 35 passed, 0 failed, 0 ignored, 0 skipped (0.34 s), including sync_watchdog_and_prune_repair_fence_rewind_with_zero_armed_waits.
  • hle::d3d12x::real: 56 passed, 0 failed, 0 ignored, 0 skipped.

Not tested: full workspace suite, retail title run, native Windows.

AI use: T3 Code / Antigravity (Gemini 4 Neon) merged, built, ran the tests on this machine, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7163370368 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1429#issuecomment-7163370368). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-25T13:09:23Z. --- **Update for head `b14487f4`** (earlier results for `dd5ea20` below) Same RX 9070 / RADV / Proton Experimental machine, patched vkd3d-proton (master `ec207194` without the allocator / command-list `lpVtbl` checks), Rust 1.96.0, `x86_64-pc-windows-gnu`. Head merged onto `main` `83b00818`, test commit `ff73a5f9`. **Tests** (debug, `XCL_REQUIRE_GPU=wave64`, `--test-threads=1`) - `hle::d3d12x::list_x::`: 41 passed, 0 failed (`main`: 40 passed, 0 failed), including `sync_watchdog_and_prune_repair_fence_rewind_with_zero_armed_waits` - `cargo test --workspace --no-fail-fast -- --test-threads=4`, lib binary: 1322 passed, 8 failed, 27 ignored (`main` the same run: 1320 passed, 9 failed, 27 ignored). The failures are all among `main`'s. **Retail title, 300 s** (release, every run from a copy of the same warm-cache snapshot; `XCL_DIRECT_DXIL=1 XCL_PREPARE=1 XCL_PSO_PRELOAD=1 XCL_PSO_WAIT_MS=50 XCL_TEXTURE_LEVEL_PAGES=1 XCL_COHERENT_MB=1024 VKD3D_CONFIG=ignore_shared_fence`, `A` pressed every 10 s) - 3 runs: 2 clean (exit 0, 2,018 and 1,875 presents). 1 ended with `0xc0000005` in the title (`game_scarlett_master.exe+0x23cf683`, a write at address 0) at 305.7 s, after the 300 s, while the title was being stopped; it had 2,046 presents. `main`, 4 runs: all clean, 1,892–2,122. It is not this PR's: the same crash (same offset, a write at address 0) happened in 16 earlier runs on this machine on trees without this PR (11-24 and 11-26, at ~110–130 s), and on #3011 a skip file of the title's ray-tracing programs is reported to remove it. **Not tested** - Native Windows, NVIDIA/Intel - A fence rewind on this machine (the log shows none) **AI use** - Claude Code (Claude Opus 5.5) wrote the test scripts, ran the tests and runs on this machine and wrote this update. --- Linux / AMD RDNA4 (RADV) test report for head `dd5ea20` merged locally onto `main` `1a0bbe3` (clean merge). **Environment** - AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS - Proton Experimental (`experimental-11.0-20261112`), vkd3d-proton v3.1 (`#257` + `dxil-spirv` `master` `694cc674`), DXVK `v3.1.1-209`, DXC `1.9.2609.5`, `x86_64-pc-windows-gnu` cross-compile **Tested** (debug test binary under Wine, `XCL_ADAPTER=9070 XCL_REQUIRE_GPU=wave64`, `--test-threads=1 --nocapture`) - `hle::d3d12x::list_x`: **35 passed, 0 failed, 0 ignored, 0 skipped** (0.34 s), including `sync_watchdog_and_prune_repair_fence_rewind_with_zero_armed_waits`. - `hle::d3d12x::real`: **56 passed, 0 failed, 0 ignored, 0 skipped**. **Not tested:** full workspace suite, retail title run, native Windows. **AI use:** T3 Code / Antigravity (Gemini 4 Neon) merged, built, ran the tests on this machine, and drafted this report.
gridoe commented 2026-11-25 18:04:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gridoe on 2026-11-25T17:39:20Z.


Rebased onto current main (68a284a) as b14487f, resolving the additive test conflict at the end of crates/xcl/src/hle/d3d12x/list_x.rs.

Tested

  • Hardware / OS / toolchain: NVIDIA GeForce RTX 3080 (driver 617.42, wave32), AMD Ryzen 7 5700X3D, Windows 11 IoT Enterprise LTSC 2024 26H2 (Build 26300.9974), rustc 1.99.1 (stable-x86_64-pc-windows-msvc).
  • cargo +stable-x86_64-pc-windows-msvc test -p xcl --lib hle::d3d12x::list_x::tests — 37 passed, 0 failed (0.63 s), including sync_watchdog_and_prune_repair_fence_rewind_with_zero_armed_waits, sync_watchdog_pair_is_set_before_the_thread_starts, and cpu_cycle_break_publishes_value_to_title_memory_and_keeps_it_monotonic.

AI use: Rebase conflict resolution and test verification assisted by Antigravity with Gemini 4 Neon.

<!-- greyfinch-sync:ivall/xcl:comment:7169811918 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1429#issuecomment-7169811918). Originally posted by [gridoe](https://github.com/gridoe) on 2026-11-25T17:39:20Z. --- Rebased onto current `main` (`68a284a`) as `b14487f`, resolving the additive test conflict at the end of `crates/xcl/src/hle/d3d12x/list_x.rs`. **Tested** - Hardware / OS / toolchain: NVIDIA GeForce RTX 3080 (driver 617.42, wave32), AMD Ryzen 7 5700X3D, Windows 11 IoT Enterprise LTSC 2024 26H2 (Build 26300.9974), `rustc 1.99.1` (`stable-x86_64-pc-windows-msvc`). - `cargo +stable-x86_64-pc-windows-msvc test -p xcl --lib hle::d3d12x::list_x::tests` — **37 passed, 0 failed** (0.63 s), including `sync_watchdog_and_prune_repair_fence_rewind_with_zero_armed_waits`, `sync_watchdog_pair_is_set_before_the_thread_starts`, and `cpu_cycle_break_publishes_value_to_title_memory_and_keeps_it_monotonic`. **AI use:** Rebase conflict resolution and test verification assisted by Antigravity with Gemini 4 Neon.
DavidM1911 commented 2026-11-26 06:06:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T05:13:10Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7183287568 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1429#issuecomment-7183287568). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T05:13:10Z. --- 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
pickles976 commented 2026-11-27 14:36:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-27T14:36:21Z.


Wine/NVIDIA verification of exact head b14487f442d91f33e8640bddfc91fe1eb1261773:

  • Linux 6.17, Wine 11.0, RTX 4060 Laptop GPU / NVIDIA 590.48.1, Rust 1.98.1, x86_64-pc-windows-msvc, DXVK_CONFIG='dxgi.hideNvidiaGpu = False'.
  • Diagnostic vkd3d-proton 3.2.0 build 2576c0b4adfae4a+ (two local console-vtable assertion relaxations used throughout this lab; not stock-vkd3d certification).
  • Fresh intended-worktree compilation confirmed: Compiling xcl v0.1.0 (.../xcl-pr1429/crates/xcl).
  • Command: cargo test --locked --target x86_64-pc-windows-msvc -p xcl --lib sync_watchdog_and_prune_repair_fence_rewind_with_zero_armed_waits -- --nocapture --test-threads=1 through the Wine wrapper, with a 9 GiB memory / 512 MiB swap scope.
  • Result: 1 passed, 0 failed, 0 ignored in 0.76 s. The physical NVIDIA adapter opened. The log observed and repaired both synthetic rewinds: 0x7 -> 0x4 and 0xa -> 0x9.

This closes the PR's listed Wine/vkd3d test gap for the focused rewind fixture only. No title was launched, and this does not establish correction of our separately observed Game-Init cpu_writes legacy fallback (fence at 0, wanted 1).

<!-- greyfinch-sync:ivall/xcl:comment:7220995376 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1429#issuecomment-7220995376). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-27T14:36:21Z. --- Wine/NVIDIA verification of exact head `b14487f442d91f33e8640bddfc91fe1eb1261773`: - Linux 6.17, Wine 11.0, RTX 4060 Laptop GPU / NVIDIA 590.48.1, Rust 1.98.1, `x86_64-pc-windows-msvc`, `DXVK_CONFIG='dxgi.hideNvidiaGpu = False'`. - Diagnostic vkd3d-proton 3.2.0 build `2576c0b4adfae4a+` (two local console-vtable assertion relaxations used throughout this lab; not stock-vkd3d certification). - Fresh intended-worktree compilation confirmed: `Compiling xcl v0.1.0 (.../xcl-pr1429/crates/xcl)`. - Command: `cargo test --locked --target x86_64-pc-windows-msvc -p xcl --lib sync_watchdog_and_prune_repair_fence_rewind_with_zero_armed_waits -- --nocapture --test-threads=1` through the Wine wrapper, with a 9 GiB memory / 512 MiB swap scope. - Result: **1 passed, 0 failed, 0 ignored** in 0.76 s. The physical NVIDIA adapter opened. The log observed and repaired both synthetic rewinds: `0x7 -> 0x4` and `0xa -> 0x9`. This closes the PR's listed Wine/vkd3d test gap for the focused rewind fixture only. No title was launched, and this does **not** establish correction of our separately observed Game-Init `cpu_writes` legacy fallback (`fence at 0, wanted 1`).
Foniass commented 2026-12-01 05:43:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:43:11Z.


Triage (#1607) – head b14487f

No open or merged PR makes the same change: #906 handles rewinds of the fence_x.rs completed-value mirrors, and #2499 (merged) only fixed the watchdog's lost wake-up; neither tracks a highest_completed floor per Write64 cell or keeps the watchdog polling after a CPU release.
The PR conflicts with main: wake_sync_watchdog now sleeps through sync_watchdog_sleep_if_idle (#2499), so the REWIND_GUARD_UNTIL check has to move into that helper's idle condition when rebasing.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7302064871 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1429#issuecomment-7302064871). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T05:43:11Z. --- **Triage (#1607)** – head b14487f No open or merged PR makes the same change: #906 handles rewinds of the fence_x.rs completed-value mirrors, and #2499 (merged) only fixed the watchdog's lost wake-up; neither tracks a highest_completed floor per Write64 cell or keeps the watchdog polling after a CPU release. The PR conflicts with main: wake_sync_watchdog now sleeps through sync_watchdog_sleep_if_idle (#2499), so the REWIND_GUARD_UNTIL check has to move into that helper's idle condition when rebasing. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1429:upstream-pr/1429'
git switch 'upstream-pr/1429'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1429'
git switch 'upstream-pr/1429'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1429'
git switch 'upstream-pr/1429'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1429'
git switch 'main'
git merge --squash 'upstream-pr/1429'
git switch 'main'
git merge --ff-only 'upstream-pr/1429'
git switch 'main'
git merge 'upstream-pr/1429'
git push origin 'main'
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!1419
No description provided.