Skip to content

xcl run: XCL_STALL_DUMP dumps every thread and ends the title when frames stop - #1656

Open
ThiagoAlexsander wants to merge 1 commit into
xcl-dev:mainfrom
ThiagoAlexsander:xcl-stall-dump
Open

ThiagoAlexsander wants to merge 1 commit into
xcl-dev:mainfrom
ThiagoAlexsander:xcl-stall-dump

Conversation

@ThiagoAlexsander

@ThiagoAlexsander ThiagoAlexsander commented Nov 24, 2026 •

Copy link
Copy Markdown

XCL_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 way XCL_RUN_SECONDS does. A stalled frame loop is caught while it is stalled, without guessing a time for XCL_THREAD_DUMP_AT and 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_async binds 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 watches present::presents() every 250 ms and uses the existing eh::dump_threads and real::end_title. Without the variable nothing starts.
  • README.md: one entry next to the other run switches.
  • Two unit tests: stall_dump_takes_a_positive_number_of_seconds (the variable's parsing) and a_stall_needs_a_presented_frame_and_the_full_wait (when the watcher fires).

Tested

  • Windows 11 Pro 26300, RTX 5080 16 GB (driver 32.0.16.1088, 32-lane waves), Ryzen 7 9800X3D, 62 GB. Rust 1.100.0, release (tests in the default debug profile).
  • cargo test --workspace -- --test-threads=4 on this head: 742 passed, 1 failed, 25 ignored.
    • The one failure, test_title_runs_and_game_folder_is_untouched (e2e.rs:93), fails the same way on main b7aa9f3 on this machine.
    • SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64).
  • Retail title 1.0.2.1, with XCL_STALL_DUMP=6 and an A press through XCL_PRESS_AT.

Update: rebased onto main 689f2db (head 8510ca0). Since 480a683: 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.
  • One title run on this head with XCL_STALL_DUMP=6 (without xcl run: thread dumps unwind a copy of each stopped thread's stack #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:

xcl-smoke v1
commit: b7aa9f3bd212088e0d927439284dc5ed325ce3c7
gpu: NVIDIA GeForce RTX 5080
title: b6841dce
seconds: 60
exit: 0x0
frames shown: 1647 (PresentX 1647)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15740 MB

this PR:

xcl-smoke v1
commit: 480a683c37ebf8aa2e2aa64506785ec02e1b3207
gpu: NVIDIA GeForce RTX 5080
title: b6841dce
seconds: 60
exit: 0x0
frames shown: 1614 (PresentX 1614)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15641 MB

(Both runs are of the first-run start screen with no input; the switch is not set in either.)

Not tested

AI use

  • Claude Code (Claude Opus 5.5) wrote the change, ran the tests and the title runs, and wrote this description. I approved opening the PR.

🤖 Generated with Claude Code

@eizispark

Copy link
Copy Markdown

Hardware test report — commit 480a683

Verified 480a683c37ebf8aa2e2aa64506785ec02e1b3207 (clean merge with main c160d86ef2efe3a07e4dfb473e4fa72eafb413c0): pass.

Tested

  • Hardware: AMD Radeon RX 9070 XT (RDNA4, native wave32 + wave64, driver 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 smoke
  • cargo 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_untouched and both native RDNA4 wave64 GPU tests (gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware, plus console_wave64_compute_through_the_pso_hook_dispatch_and_read_back) passed cleanly

Regression run (scripts/smoke.ps1, 60 s, warm shader/driver cache, XCL_STALL_DUMP unset as default)
main (c160d86ef2efe3a07e4dfb473e4fa72eafb413c0):

xcl-smoke v1
commit: c160d86ef2efe3a07e4dfb473e4fa72eafb413c0
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1671 (PresentX 1671)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14861 MB

PR (480a683c37ebf8aa2e2aa64506785ec02e1b3207):

xcl-smoke v1
commit: 480a683c37ebf8aa2e2aa64506785ec02e1b3207
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1675 (PresentX 1675)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14862 MB

Not tested

  • triggering an actual stalled frame loop with XCL_STALL_DUMP=<n>, NVIDIA/Intel GPUs, Wine/vkd3d-proton, gameplay past the menus

AI use

  • Verified and formatted with Antigravity (Google DeepMind, Gemini 4 Carbon).

@DavidM1911

Copy link
Copy Markdown
Contributor

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.

Thanks!

@ivall ivall added the goal:world-load Bears on the retail title getting past world loading label Nov 24, 2026
…ames stop

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@minimalhipster990

minimalhipster990 commented Nov 24, 2026 •

Copy link
Copy Markdown

Tested 8510ca0 on 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 with XCL_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.

  • The thread that had presented frames (20496) was in WaitForSingleObjectEx from game caller +0x56a0d in both snapshots. The snapshots do not identify the object it was waiting for.
  • A separate game thread (20832) was in execute_indirect → pso_async::resolve_wait → Condvar::wait in both snapshots. Two more game threads moved from nvgpucomp64.dll into that same XCL wait by the second snapshot. XCL logged 12 compute PSO completions between snapshots.
  • In the control run, at 215.241 s, queue q1 timed out waiting for q0 on cell 0xc416fe68, the same cell seen in dxil: collapse forward s_cbranch_execz regions and make read-only loads branchless #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/q1 fence 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 (0x1a18 and 0x1a10).

The longer run logged successful SetEvent calls 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 8510ca0 binary 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 handle 0x1ac4) 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 calls SetEvent on 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.

Work on worker 3 Time within the coordinator’s wait
60 distinct graphics pipelines resolved through ExecuteIndirect 110.579 s
Driver creation time for 83 completed compute pipelines 278.148 s
Total in these non-overlapping operations 388.727 s (95.2%)

For #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 PresentX calls, 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 ActivateProbes from 128.084 s to 23 ms in the driver and ActivateRays from 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

  • XCL 8510ca0218344018c5348e125a966a2bcb67573e, the same locally instrumented release build as in the earlier report. Both runs launched the same executable from the same path. SHA-256 5084ad4c51f6f26671e69e5621defcf04414413a1e3dfa28508dc693f986406a.
  • GeForce RTX 4090, NVIDIA 621.40 (Windows 32.0.16.2140), Ryzen 7 5800X3D, 32 GB RAM, Windows 11 build 26300, DXC 1.9.2602.17. Retail title 1.0.2.1. The archived control used 621.24, so both legs below were run again on 621.40.
  • One 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’s driver/*.pso files. All 193 files (75,182,458 bytes) matched their source SHA-256 hashes.
Measurement Empty XCL cache Seeded compute cache
Coordinator’s first 81 waits returned successfully 81/81 81/81
Start of wait 82, seconds on XCL’s clock 193.522 201.497
Observed wait through cutoff, seconds ≥406.479 ≥398.504
Worker index, descriptor slot 2, 81 0, 81
Graphics pipeline resolutions on this worker overlapping the wait, time spent 60, 112.462 s 39, 54.435 s
Compute pipelines completed on this worker during the wait, total driver time 81, 272.180 s 171, 225.081 s
Driver time for ActivateProbes / ActivateRays 128,084 / 35,550 ms 23 / 15 ms
Accepted disk-cache loads / rejected loads across the process 0 / 0 194 / 0
Total PresentX calls at cutoff 3,297 3,721
Last sampled image Spinner, frame 3,260 Spinner, frame 3,680
Peak sampled process private memory 33.37 GiB 32.65 GiB

Both traces associate slot 81 with the same callback RVA (+0x15b4aa0) through the queue, worker stack and payload. The handles were local to each run (0x1aac cold, 0x1a14 warm). Neither trace records a successful worker SetEvent on 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 in resolve_for_bind → resolve_wait. At 590.046 s it was in NVIDIA’s compiler, and at 591.073 s it finished record 60fe6f59d8ec6ee4 in 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

Toons29 commented Nov 25, 2026

Copy link
Copy Markdown

Regression run of 8510ca02 on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 1a0bbe3a, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1628 (PresentX 1628)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14561 MB
xcl-smoke v1
commit: 8510ca0218344018c5348e125a966a2bcb67573e
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1634 (PresentX 1634)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14815 MB

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants