D3D12.X: the GPU wait watchdog starts after its wake pair is set #1926
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!1926
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1926/head"
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?
@pvfreis on GitHub · 2026-11-24 23:28 UTC · original
pvfreis:sync-watchdog-start→main· +26 −3 · 1 files · 1 commits · merged 2026-11-25 01:59 UTCThe
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 from8a5643f(#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 #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
@Royalflamejlh on GitHub · 2026-11-25 00:37 UTC · original
A second sighting of the panic
2448457fixes, on Linux (Wine + vkd3d-proton) + NVIDIA: 1 of the 144 title runs on our machines today (to 17:35) that logged a bridged GPU wait has it, and in that run no wait was released on the CPU afterwards.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
mainb8b1f49with several open pull requests (not a cleanmain), release,x86_64-pc-windows-gnu,XCL_PSO_WAIT_MS=50, a retail title into its world load; the first-run screens were completed once, no story progress.Wait64BitValueX … bridged to GPU queue.Waitline is logged, and stderr has, between the lines of that moment:(the same
unwrapas the description's line 1364; the pull requests merged into this tree move it 10 lines down)bridgedlines (97.6 to 118.8 s; XCL writes that line for the first 8 only, so 8 or more waits were bridged) and none was released: there is nodid not complete within 5000 ms … released on CPUline in the run. The last present was in the 2 s before 120.1 s, and the title's null write atgame+0x23cf683came at 149.5 s. I cannot say that a release would have changed that end.xcl.loghas no line of it, which is why it is easy to miss.Tested
cargo test --release -p xcl --lib sync_watchdog_pair_is_setunder Wine, on2448457merged ontomain689f2db+ #684: 1 passed, 0 failed.Read
list_x.rs:1467(sync_watchdog_pair): the pair is in theOnceLockbeforespawnis called, and only the call that made it spawns, so the thread's firstget().unwrap()always finds it. A second caller racing the first gets the pair and does not spawn, as before.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.
@futurepro62 on GitHub · 2026-11-25 00:22 UTC · original · edited 2026-11-25 00:49 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
2448457(on its base689f2db).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 966 passed, 0 failed, 43 ignored. SKIPPED (no wave64):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.sync_watchdog_pair_is_set_before_the_thread_starts.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 975 passed, 0 failed, 45 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out tests that fail on main80f4819too, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651), the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests andconst_and_null_mask_operands_agree_with_hlsl_on_the_gpu(follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
@JJAutoCompare on GitHub · 2026-11-25 01:26 UTC · original
Empirical verification report for PR #1926 (
D3D12.X: the GPU wait watchdog starts after its wake pair is set).2448457c985eb6f09ba7c7a42c7ea9504590b632origin/main:5796cc467d80e3dac5d7d231ec34f1b0bebce169git merge-tree --write-tree origin/main HEAD): clean (exit 0, tree530e410553a5500e3a4e81e25d731166ed95873f)crates/xcl/src/hle/d3d12x/list_x.rs(+26, -3)Tested
32.0.101.9175,2026-11-04,XCL_ADAPTER=A770)10.0.26200(Build26200)rustc 1.100.0 (0ef1bc386 2026-11-09),cargo 1.100.0 (3acc79c0c 2026-11-05), debug (dev/test) profiledxcompiler.dll1.9.2609.5 (01b62ad47)(XCL_DXC_DIR->dxc-1.9.2609\bin\x64)cargo test --workspace --no-runandcargo build --workspace: succeeded (0 errors; 2 pre-existingfetch_updatedeprecation warnings inreal.rsandxgameruntime/mod.rs).cargo test -p xcl --lib sync_watchdog_pair_is_set_before_the_thread_starts -- --show-output: 1 passed, 0 failed, 0 ignored (0.00s).cargo test -p xcl --lib hle::d3d12x::list_x::tests -- --test-threads=4 --show-output: 28 passed, 0 failed, 0 ignored, 0 skipped (0.95s).cargo test --workspace -- --test-threads=4 --show-output: exited 101 onxcl --lib(903 passed, 24 failed, 25 ignored), stopping before integration targets.cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output(all 20 targets: 19 binaries + doc-tests): 951 passed, 25 failed, 45 ignored (of the 951 passing tests, 15 emittedSKIPPEDlines below and are not counted as GPU coverage).xcl --lib: 903 passed, 24 failed, 25 ignoredtests\e2e.rs: 2 passed, 1 failed, 0 ignoredbcpack_parity,console_dlls_e2e,console_shaders,disasm_e2e,gpu_compute_e2e,gpu_pso_e2e,heap_probe,low_va,pls_quota,predication_e2e,rpf_e2e,shaders_e2e,sparse_reinit,texture_states,xg_oracle,xclbin,xcl-testtitlebin, doc-tests): 46 passed, 0 failed, 20 ignored.xcl --libtests failed inCreateComputePipelineStatewith0x80070057:gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_{0..3},gpu::dxil::ops_tests::{doubles_match_cpu,groupshared_barrier_and_atomics_run},gpu::dxil::round_tests::{gpu_direct_f32_round_modes_dynamic_and_denormals,gpu_direct_f32_round_modes_static},gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu,gpu::recomp::tests::{gpu_clamp_and_omod_per_instruction,gpu_f64_class_compare,gpu_f64_compares_with_nan,gpu_f64_literal_high_word,gpu_f64_math_random,gpu_f64_roots,gpu_f64_rounding_and_conversions,gpu_float_compares_random,gpu_frexp_f64_exp_and_mant,gpu_ldexp_f64,gpu_rndne_f64}.xcl --libshader/driver assertion failures on Arc A770:gpu::recomp::tests::gpu_nonfused_mad_and_mac_prevent_fma_contraction,gpu::recomp::tests::gpu_ps_image_sample_offset_implicit_lod_between_mips,gpu::recomp::tests::gpu_valu_16_and_64_bit,gpu::recomp::tests::gpu_wave64_ps_whole_wave_reductions.tests\e2e.rsfailure:test_title_runs_and_game_folder_is_untouched(49/50xcl_testtitlechecks passed, includingD3D12.X: console command list memory methods (writes, timestamp, fill, copy, KickoffX, Wait32/64); onlyD3D12.X: dynamic depth bias via RSSetDepthBiasX (#94)failed on Arc A770).SKIPPEDGPU tests (25SKIPPEDlines across 15 tests; not counted as GPU coverage):gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu:no wave64gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu:no wave64gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu:no wave64gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu:no wave64gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu:no wave64gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu(4 subcases):f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's));f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's));f16 arithmetic, wave64: no wave64;f16 packed, wave64: no wave64gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu(7 subcases):f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's));f32 arithmetic/compares/conversions/rounding/transcendentals/three-source, wave64: no wave64gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu(2 subcases):integer arithmetic, wave64: no wave64;integer carries, wave64: no wave64gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask:no wave64gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware:no wave64shaders::tests::pso_measurement_compiles_an_exact_synthetic_record:cannot disable the driver cache (Windows Developer Mode is required): ... (0x887A002D)placed_title_textures_share_vram_and_preserve_pixels:tiled tier < 2test_title_draws_with_a_root_signature_under_the_debug_layer:no d3d12SDKLayers.dllheap_window_out_of_memory_falls_back_to_the_switch_form:no heap windowsuploads_start_from_each_subresources_state:no D3D12 debug layer (... 0x887A002D)Not tested
scripts/smoke.ps1regression run (no game folder available on this test host)d3d12SDKLayers.dll/ Windows Developer Mode),XCL_HEAP_WINDOWS=1,XCL_SAMPLE_*game-data tests, release profileorigin/maindirectlyAI use
@raylitebull on GitHub · 2026-11-25 01:54 UTC · original
Code review on
2448457:SYNC_WATCHDOG_WAKEinsync_watchdog_pairbefore spawningxcl-sync-watchdogfixes theOnceLock::get().unwrap()startup race cleanly, andsync_watchdog_pair_is_set_before_the_thread_startsdirectly pins the ordering.CIworkflow approved (running); RTX 5070 Ti and Intel Arc A770 passes are already in.Remaining before merge:
Build and testfinishing green plus an AMD verification pass on2448457.@DavidM1911 on GitHub · 2026-11-25 02:33 UTC · original
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!