Scripts: align world-load stalls with logged compiles and GPU waits #2519
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2529"
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?
Imported from ivall/xcl. Originally posted by razormontana on 2026-11-25T21:47:12Z.
Part of #505 and #1833. A saved XCL log can show a world-load pause while driver builds are in progress and GPU waits are being logged. The script finds the terminal zero-present samples and aligns both types of observation with the same time window, so a tester can see where to inspect the trace.
What is in it
scripts/world_load_stall.pyreads a single saved runtime log. It summarizes the activity samples, joins numbered driver compile starts and finishes, merges their overlap with the sample window, and reports the logged Wait64 bridges and GPU wait watchdog releases.--title-exe NAME.exe, the script inspects the latest timestamped thread dump after the last sample with presents through the closing zero-present sample. It reports dump coverage and the visible XCL offsets above each thread's first matching title frame, using case-insensitive module names. For a renamed XCL build,--host-exe NAME.exeselects the host basename. The default isxcl.exe. The candidates describe sampled stacks.scripts/test_world_load_stall.pyandREADME.mdcover the sampled boundaries, optional thread-dump parsing, and limits of the captured events.Tested
92e99a3on Windows with Python 3.14.3.python -B -m unittest discover -s scripts -p "test_*.py" -vpassed all 36 tests. On a synthetic saved dump,c9c531efound the title thread and zero candidates. The follow-up found its single XCL frame with a mixed-case--host-exe. The implicit and explicit default host reports matched, and passing a path returned the basename error.c9c531ee5bce18f64fe63844502fc449a884c451, based on6d12f58a229bc73889878a448c64dc3af25eeba0. Python 3.14.3 on Windows 11 build 22631.5335, Core i7-10700K and GeForce RTX 3070 with driver 32.0.16.1742.python -B -m unittest discover -s scripts -vpassed all 35 tests. Negative controls for dump selection failed when the closing timestamp was excluded, file order took precedence over timestamp, or an unterminated row counted as complete. Earlier controls caught discarded compiles already in progress at the opening sample and activity incorrectly kept after a shutdown request.cargo build --offline --locked --workspacesucceeded. The debug workspace run,cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-output, passed 1,423 tests across 37 test targets, with 0 failed and 46 ignored. It used Rust 1.100.0 MSVC, the Windows SDK DXC andXCL_ADAPTER=3070. Cargo's pass count includes 26SKIPPEDnotices (21 native-wave64 checks, 3 unsupported per-lane forms, 1 reserved cube with mips and 1 heap-window check).c9abd1fbyte for byte on a synthetic CRLF log and two saved RTX 3070 captures. The68a284acapture showed four submits and 2.001 s of logged compile overlap during the final zero-present window. The89bbbb4capture resumed presents after an earlier pause.c9abd1f. Independent reportNot tested
AI use
Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-25T22:05:22Z.
Rechecked
c9c531ee5bce18f64fe63844502fc449a884c451with the new thread-dump option. The earlier interval oracle still matched 512 shuffled synthetic logs and 16 saved-log CLI replays. For the new option, I independently generated 192 logs with timestamp ties, partial/empty dumps, bare addresses, mixed-case module names, and XCL frames on either side of a title frame. Parsed row counts, visible-title counts, thread IDs and offset lists matched the generated expectations in every case. I checked 12 of those saved logs via the CLI both with and without--title-exe(24 CLI runs).Focused tied-timestamp regression. Two dumps have the closing sample’s millisecond timestamp. The later, incomplete dump wins, and only its XCL offset above the first title frame appears. Choosing the first tied dump or scanning past that first title frame each failed the new assertion.
python -B -m unittest discover -s scripts -p "test_*.py"passed 35 tests on this head and 36 with the fixture. The earlier endpoint fixture also combined cleanly; all 12 focused stall tests passed with both additions.Windows 11 26100.9711, i7-13700, Python 3.14.3. Synthetic log text only. OpenAI Codex (GPT-6) wrote the fixture and ran the checks.
Earlier compile-overlap and endpoint checks
I checked
c9abd1fe0518063504907baddde78ab44792ff10against an independent quarter-second occupancy calculation. For 512 shuffled synthetic logs (seed 2529), I counted occupied ticks directly for completed compiles and for the upper bound including unfinished ones. The matched duration, upper bound, intersecting counts and wait-event counts agreed in every case. I sent 16 of the logs throughpython -B scripts/world_load_stall.py <saved-log>; the full reports matched the in-process results.Focused regression fixture. A compile ending at the opening sample and a compile starting at the closing sample contribute zero duration. A point event at the closing sample counts. The fixture failed independently when I excluded that endpoint or counted a zero-duration intersection.
python -B -m unittest discover -s scripts -p "test_*.py"passed all 31 tests with the fixture.Windows 11 26100.9711, Core i7-13700, Python 3.14.3. This tests the arithmetic and saved-log CLI with synthetic events. OpenAI Codex (GPT-6) prepared the fixture, ran the checks and wrote this report.
Follow-up on review feedback
I tested the renamed-host review using the saved-log CLI. A complete three-thread dump contained frames for
XCL.EXE,XCL-MAIN.exeand an unrelated module above the same synthetic title. The current CLI reported the default host's offset and had no way to select the renamed executable.With the candidate,
python -B scripts/world_load_stall.py saved.log --title-exe demo.exe --host-exe xCl-MaIn.EXEselected only thread 2 at0xc. The frame below its title frame and the other modules' offsets were excluded. Omitting the option and specifyingXCL.EXEboth returned only thread 1 at0xa. Omitting title analysis preserved the existing output mode. A path supplied as the host name exited 2 with a basename diagnostic. All 36 Python script tests passed. I used a synthetic UTF-8 BOM log with Windows line endings.Parent of the PR-based candidate:
c9c531ee5bce18f64fe63844502fc449a884c451. OpenAI Codex (GPT-6) prepared the changes and ran the Windows CPU fixtures. No game, Rust workspace build or GPU workload.Rechecked the adopted change at
92e99a3f0bd935a63b6ff344bd558718325ba992. Its complete Git tree matches candidate290f6404cd58(0dde8cedaeb35cba854a7b43b14791d1df68bcc9). On that PR head,python -B scripts/world_load_stall.py saved.log --title-exe DEMO.exe --host-exe xCl-MaIn.EXEselected only the renamed host’s leading frame. The default and explicit default selected the original host, an executable path returned status 2, and the run without a title filter emitted no thread candidates.python -B -m unittest discover -s scripts -p "test_*.py"passed all 36 tests. Windows build 26100, Core i7-13700, Python 3.14.3. OpenAI Codex (GPT-6) wrote and ran the synthetic tests. Input was a synthetic saved log; I did not run a game.I prepared a README-only commit on PR head
92e99a3fto resolve the conflict with maine429936c. It moves the saved-log instructions within the diagnostics list and preserves their wording, including the renamed-host example. Git merged the candidate cleanly. Removing those instructions from the merged README produced main’s README byte for byte.On the merged tree, all 11 tests in
test_world_load_stall.pypassed. I also ran the documented command on a synthetic thread dump with both the default host and--host-exe xcl-main.exe. Each selected the expected offset. AI use — OpenAI Codex (GPT-6) moved the documentation and ran the checks.Imported from ivall/xcl. Originally posted by GreemSC on 2026-11-25T21:48:43Z.
One addition that found both of our world-load stops, if you want it in the script: the last
XCL_THREAD_DUMP_ATdump, and in it every title thread with XCL frames above its first game frame. That is a title thread XCL is holding (a compile, a readback, a CPU wait), and it is the line that named the cause each time:bind::execute_indirect → dispatch_chain::whole → driver_psobefore #2404,pso_async::resolve_for_bind → build_computeafter it. It needs dumps deeper than 14 frames (#1734), or the XCL callers under the driver frames are cut off.(
dump_linesare thethread N 'name': a < b < …lines after athread dump (N threads):line.) The offsets symbolize withllvm-symbolizer --obj=xcl.exe --pdb=xcl.pdb <0x140000000 + offset>(the image base) against the build that ran. With #2244'sWait64 cells behindline next to it, a cell whose recorded value is above what was submitted points at the same held thread.AI use: Claude Code (Claude Opus 5.5) wrote the function (from our own run analysis) and this comment.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T22:08:24Z.
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!
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T01:36:33Z.
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
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T07:09:46Z.
Review: COMMENTED
Could the thread-dump analysis accept the XCL host executable basename, defaulting to
xcl.exe? The runtime logs the actual module basename, so a renamed comparison build can show a visible title frame while silently omitting the host frames above it.I ran the exact parser source at
c9c531ee5bce18f64fe63844502fc449a884c451on a synthetic stall withxcl-main.exe+0x123 < Game.exe+0x456. With--title-exe Game.exe, it reported one visible title frame and zero candidates. Changing only the host basename toxcl.exeproduced one candidate at0x123. An optional--host-exe NAMEand a renamed-host fixture would preserve the current default and cover this case. AI-assisted review with Codex.Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-29T01:18:53Z.
The default runtime can report a slow driver build only at completion:
D3D12.X: slow driver compile #N: … PSO, … B DXIL, … ms on THREAD. Current main emits this inreal.rswhen tracing/size does not select the start/finish pair and the build takes at least one second. On92e99a3f, those records disappear from the saved-log report.I ran the regular CLI on a synthetic four-second zero-present window (8–12 s). A graphics completion at 10 s reported 3,000 ms; a compute completion at 12 s reported 2,500 ms. The stock CLI reported 0 logged overlapping compiles and 0.000 s matched overlap, with no mention of either observed completion. A local change retained the paired overlap and reported the two completions separately, with 5.500 s cumulative driver duration. This number can exceed the window, includes work that began earlier, and does not identify a title-thread stall or critical path.
The candidate below handles optional record/blob fields. Its regression also checks the open/closed window endpoints and a genuine paired build whose matched union remains 2.000 s. All 12 tests in this PR's script-specific suite passed, including the new control. No retail log or GPU was used.
AI assistance: OpenAI Codex traced the runtime format, ran the stock and candidate CLI, and prepared the patch and report.
Candidate and regression
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:17:30Z.
Triage (#1607) – head
92e99a3No open or merged PR adds a world-load stall analyser; the log lines it parses (
activity (2 s),driver compile start/finish #N,Wait64BitValueX ... bridged to GPU queue.Wait,thread dump (N threads):,XCL_RUN_SECONDS ... ending the title) still exist on main.One stale pattern:
scripts/world_load_stall.pycountsGPU queue.Wait at ... released on CPU to prevent GPU hang, but main commitdd84e0ad(fail closed on unproven wait timeouts) removed that message; main now logs... did not complete within N ms (...)with no release, so the "GPU wait watchdog releases" line always reports 0. Match the current message or drop that line (README text too).The branch conflicts with main and needs a rebase.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.