xcl run: XCL_STALL_DUMP dumps every thread and ends the title when frames stop #1656
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!1656
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1656"
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?
@ThiagoAlexsander on GitHub · 2026-11-24 18:49 UTC · original
ThiagoAlexsander:xcl-stall-dump→main· +65 −0 · 2 files · 1 commits · openXCL_STALL_DUMP=n: once a title has presented frames and then presents none for n seconds, XCL dumps every thread to the log. It dumps twice, a second apart, so a stuck thread can be told from a moving one, then ends the title the wayXCL_RUN_SECONDSdoes. A stalled frame loop is caught while it is stalled, without guessing a time forXCL_THREAD_DUMP_ATand without waiting for the title's own watchdog. On the retail title in #846, that watchdog fires about 26–30 s after presents stop. Part of #846.On that title this showed what the stall is on an NVIDIA GPU. The title's threads were in
pso_asyncbinds that wait for compute pipelines, while XCL's PSO workers were inside the driver's compiler. The dumps are in my comment on #1273.What is in it
crates/xcl/src/host.rs: the switch is a thread that watchespresent::presents()every 250 ms and uses the existingeh::dump_threadsandreal::end_title. Without the variable nothing starts.README.md: one entry next to the other run switches.stall_dump_takes_a_positive_number_of_seconds(the variable's parsing) anda_stall_needs_a_presented_frame_and_the_full_wait(when the watcher fires).Tested
cargo test --workspace -- --test-threads=4on this head: 742 passed, 1 failed, 25 ignored.test_title_runs_and_game_folder_is_untouched(e2e.rs:93), fails the same way onmainb7aa9f3on this machine.gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64).XCL_STALL_DUMP=6and an A press throughXCL_PRESS_AT.main'sdump_threads, 1 run in 3 faulted inside ntdll's unwinder during the dump (read at address 0xac8), and the process then hung. That is the fault #253 fixes (the stack unwound after the thread was resumed).Update: rebased onto
main689f2db(head8510ca0). Since480a683: the README entry, and the parsing and stall check moved into two small functions with the two tests above../scripts/test.ps1 --skip test_title_runs_and_game_folder_is_untouched(CI's command): 976 passed, 0 failed, 45 ignored in 20 suites, including both new tests.XCL_STALL_DUMP=6(without #253, which is still open): no frame after frame 1401, so the switch fired at 77.6 s. Both dumps (126 threads each) are in the log, and the title ended without a crash or hang.The regression run below is from
480a683, before the rebase.Regression run
main:
this PR:
(Both runs are of the first-run start screen with no input; the switch is not set in either.)
Not tested
dump_threads's existing behaviour withXCL_THREAD_DUMP_ATtoo (#106), not new code.AI use
🤖 Generated with Claude Code
@eizispark on GitHub · 2026-11-24 19:01 UTC · original
Hardware test report — commit
480a683Verified
480a683c37ebf8aa2e2aa64506785ec02e1b3207(clean merge withmainc160d86ef2efe3a07e4dfb473e4fa72eafb413c0): pass.Tested
32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 x64,rustc 1.100.0 (0ef1bc386 2026-11-09), debug tests + release smokecargo test --workspace --no-fail-fast -- --test-threads=4:770 passed, 0 failed, 41 ignored(GPU tests skipped on this adapter:none)test_title_runs_and_game_folder_is_untouchedand both native RDNA4 wave64 GPU tests (gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware, plusconsole_wave64_compute_through_the_pso_hook_dispatch_and_read_back) passed cleanlyRegression run (
scripts/smoke.ps1, 60 s, warm shader/driver cache,XCL_STALL_DUMPunset as default)main(c160d86ef2efe3a07e4dfb473e4fa72eafb413c0):PR (
480a683c37ebf8aa2e2aa64506785ec02e1b3207):Not tested
XCL_STALL_DUMP=<n>, NVIDIA/Intel GPUs, Wine/vkd3d-proton, gameplay past the menusAI use
@DavidM1911 on GitHub · 2026-11-24 21:16 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.Thanks!
@minimalhipster990 on GitHub · 2026-11-24 23:20 UTC · original · edited 2026-11-25 12:02 UTC
Tested
8510ca0on an RTX 4090 (NVIDIA 621.24, Windows 11 build 26300), using the same world-entry sequence as in #1834. I ran the same executable first with the stall diagnostic unset, then withXCL_STALL_DUMP=15. Both runs reached the loading spinner and stopped presenting before the world appeared.The watchdog fired at 184.216 s, 15 seconds after frame 3,692. It captured the same 146 thread IDs twice, 1.065 s apart, then exited with code 0.
WaitForSingleObjectExfrom game caller+0x56a0din both snapshots. The snapshots do not identify the object it was waiting for.execute_indirect → pso_async::resolve_wait → Condvar::waitin both snapshots. Two more game threads moved fromnvgpucomp64.dllinto that same XCL wait by the second snapshot. XCL logged 12 compute PSO completions between snapshots.q1timed out waiting forq0on cell0xc416fe68, the same cell seen in #1834. XCL released the wait on the CPU. No further frame was presented before the 240 s limit.For #1269, this gives us a specific PSO wait to investigate. Its connection to the presenter’s wait and the later GPU timeout is still open. Would it be more useful to trace the presenter’s wait handle and its signaling thread first, or to capture the pending PSO keys alongside the
q0/q1fence values?AI assistance: OpenAI Codex ran the tests, compared the snapshots using the matching XCL release symbols, and prepared this report.
Follow-up on the RTX 4090 — the coordinator’s 82nd event
I repeated world entry on two locally instrumented builds based on
8510ca0, using the same inputs and fresh XCL profiles and DXIL caches. The first run ended at 240 s and the second at 600 s. On both runs the game coordinator returned successfully from its first 81 event waits at title offset+0x43c3d5d. Its 82nd wait was still outstanding at the cutoff. The handle differed between runs (0x1a18and0x1a10).The longer run logged successful
SetEventcalls from five workers even before the coordinator started waiting on their handles. I matched all 81 completed waits to worker signals from game offset+0x43c431d; 75 signals were logged before the corresponding wait began. For event 82, the coordinator started waiting at 221.697 s. There was no matching worker signal or wait return through 600.001 s (at least 378.304 s).The presenting thread was on a different Windows object, a semaphore, from 221.793 s through the cutoff. At 226.800 s, q1 timed out waiting for q0 on cell
0xc416fe68; XCL released the fence on the CPU and later read back its target value,0xe70. Presentation did not resume. The last two-second interval with presents ended at 168.063 s; the run ended normally with 3,692 PresentX calls. After the presenter’s final wait began, two of the workers still logged 80 and 90 compute PSO completions respectively.This narrows the next trace to the point where the game associates a queued job with its completion event. We can identify the signalers of the first 81 events. The current trace does not identify which worker or shader, if any, was assigned event 82. One run per duration, NVIDIA 621.24, Windows 11 build 26300, direct DXIL and heap windows enabled. The NVIDIA driver cache was uncontrolled. Related: #1269 and #1834.
AI assistance: OpenAI Codex instrumented the local XCL builds, ran the tests and correlated the wait, signal and pipeline logs.
Event 82 traced from the queue to worker 3
In a further 600-second world-entry run on the RTX 4090, worker 3 (TID 21940) picked up the job for event 82 before the coordinator began waiting. I used the same instrumented
8510ca0binary and inputs, with a fresh XCL profile and DXIL cache. The NVIDIA driver cache was uncontrolled.An external sampler observed descriptor
0x149c3cd90(job slot 81, completion handle0x1ac4) in the pending ring at process age 171.491 s. By 183.549 s the same descriptor and payload matched worker 3’s stack and thread-local state. The worker ran game callback+0x15b4aa0. The game callsSetEventon the descriptor’s handle only after the job runner returns. As a cross-check, all 37 earlier jobs for which the sampler captured ownership matched the thread that signaled completion.On XCL’s clock, coordinator TID 20168 began its 82nd wait at 191.784 s. The first 81 waits had succeeded. During the next 408.217 s, worker 3 completed the following work.
ExecuteIndirectFor #1269, two compute records are now directly tied to this job.
ScreenProbes_ActivateProbes(56c0cd3b82a00c6e), the shader tested in #1834, took 122.373 s in the driver.ScreenProbes_ActivateRays(95cc13288a27a96e) took 34.047 s. Both finished. At 599.000 s, worker 3 entered another driver call for a cascaded-shadow pipeline (73fb752d7f62c3a5). It was still outstanding at the 600.001 s cutoff.Worker 3 was still executing the callback when the trace ended, before it reached the completion signal for event 82. The presenter remained on a separate semaphore, and the world never appeared (3,676
PresentXcalls, exit code 0 at the time limit). Whether completing this job lets presentation resume remains open. A warm-cache repeat could check the worker signal, the coordinator’s wait return and the first subsequent present separately.AI assistance: OpenAI Codex (GPT-6) ran the test and correlated the queue samples, worker stacks and pipeline timings.
RTX 4090 on NVIDIA 621.40 — partial compute cache during world entry
Reusing the compute pipelines saved by a 600 s control run took
ActivateProbesfrom 128.084 s to 23 ms in the driver andActivateRaysfrom 35.550 s to 15 ms. The worker handling event 82 completed 171 compute pipelines during the warm wait, up from 81 in the control. Both runs reached the 600 s limit with the coordinator still waiting and the loading spinner as the last sampled image.Tested
8510ca0218344018c5348e125a966a2bcb67573e, the same locally instrumented release build as in the earlier report. Both runs launched the same executable from the same path. SHA-2565084ad4c51f6f26671e69e5621defcf04414413a1e3dfa28508dc693f986406a.xcl run <game folder>per condition, in cold-then-warm order. Fresh title profile and DXIL directory each time,XCL_DIRECT_DXIL=1,XCL_HEAP_WINDOWS=1,XCL_NETWORK=0,XCL_RUN_SECONDS=600, same scripted inputs, every 60th frame sampled and the same nine thread-dump times. In the second leg only, the initial DXIL directory contained the first leg’sdriver/*.psofiles. All 193 files (75,182,458 bytes) matched their source SHA-256 hashes.ActivateProbes/ActivateRaysBoth traces associate slot 81 with the same callback RVA (
+0x15b4aa0) through the queue, worker stack and payload. The handles were local to each run (0x1aaccold,0x1a14warm). Neither trace records a successful workerSetEventon that handle or a return from the coordinator’s wait. In both runs the last activity window with any presents ended before wait 82 started. There was no subsequent PresentX through 600.001 s, no logged device removal or crash, and each run exited 0 at the configured limit.The warm run passed the cold run’s last unfinished compute record (
6f3a2502a8d6b129, completed in 5.343 s without a blob). On the warm worker, 40 of the 171 compute completions reported reuse of a driver blob. At 540.054 s its stack was inresolve_for_bind → resolve_wait. At 590.046 s it was in NVIDIA’s compiler, and at 591.073 s it finished record60fe6f59d8ec6ee4in 8.416 s without a blob. The sampler still found the callback active at the final sample. The process-wide disk-cache counters count successful loads, including repeat loads. The warm leg wrote 131 additional blobs.Not tested
A complete precompile of all compute or graphics pipelines, waits longer than 600 s, repeat pairs, other adapters and a clean build of current main. NVIDIA’s internal cache was left under driver control across the two runs. These measurements establish progress within the callback and a lower bound on each wait. They do not establish a permanent deadlock or isolate the driver update’s effect on performance.
AI use
OpenAI Codex (GPT-6) ran the measurements, correlated the saved traces, checked the final sampled images and drafted this report.
@Toons29 on GitHub · 2026-11-25 13:50 UTC · original
Regression run of
8510ca02on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon1a0bbe3a, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 100 % of
main's frames, 102 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; a script posted this right after the run, with both blocks exactly as printed.@DavidM1911 on GitHub · 2026-11-26 06:09 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: 1 failure under parallel scheduling; clean on--test-threads=1rerun (1305 passed, 0 failed, 27 ignored, 78s). Intermittent single-test flake — tracked in #1978.Thanks!
— Devin
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.