Scripts: align world-load stalls with logged compiles and GPU waits #2529
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!2529
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@razormontana on GitHub · 2026-11-25 21:47 UTC · original
razormontana:scripts/analyze-world-load-stalls→main· +397 −0 · 3 files · 3 commits · openPart 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
@GreemSC on GitHub · 2026-11-25 21:48 UTC · original
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.
@DavidM1911 on GitHub · 2026-11-25 22:08 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!
@RavenCurseBurg on GitHub · 2026-11-25 22:05 UTC · original · edited 2026-11-26 09:57 UTC
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.@DavidM1911 on GitHub · 2026-11-26 01:36 UTC · original
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
@luckyteagirl on GitHub · 2026-11-26 07:09 UTC · original · reviewed
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.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.