tools: dump threads when a run stops presenting (X2W_DUMP_ON_STALL) #3676
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3676
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3674"
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?
@Jess-Doit on GitHub · 2026-11-30 23:59 UTC · original
Jess-Doit:startup/dump-on-stall→main· +167 −0 · 6 files · 1 commits · merged 2026-12-01 01:17 UTCRefs #870.
Problem
X2W_DUMP_AT=<seconds>writes every thread's stack at fixed times. A stall that ends a run often starts at a time that changes from run to run, because it depends on how fast the load goes. On a GTX 1060 host, ten fixed dump times between 600 and 900 s all missed one: that run stopped presenting at about 1,006 s.Change
X2W_DUMP_ON_STALL=<seconds>makes the startup debugger (tools/startup/debug_launch.py) readtrap.logabout once a second, from the end of the previous read, and follow the stand-in'sx2w-d3d12 heartbeat: <n> frames presentedcount.threads_stall_<seconds into the run>.txtand logsno new frame for <s> s (last heartbeat <n> frames): threads dumped.tools/startup/stall_watch.py, a small module without Windows imports, so it can be checked anywhere.docs/startup-runtime.mdhas a row next toX2W_DUMP_AT.Tests
tests/startup_stall_watch_check.pyis registered intests/cmake/startup_stall_watch.cmakeand intests/checks/python-linux. It checks:Two controls must fail:
--mutate no-resetkeeps timing from the first heartbeat after frames move on. It fails 2 cases.--mutate earlydumps before the first heartbeat. It fails 1 case.python -B tests/startup_stall_watch_check.py... --mutate no-reset/... --mutate earlytests/startup_debug_launch_args_check.py(runsdebug_launch.py, so the new import is loaded)tests/startup_tools_lint_check.py,tests/docs_links_check.py,tests/run_checks_parallel_check.py,git diff --checkUse on a package run
Before this was split into a module, the same logic ran in two package runs on a GTX 1060 6 GB (Windows 10 19045):
🤖 Generated with Claude Code
github-bot referenced this pull request2026-12-01 00:37:29 +00:00
github-bot referenced this pull request2026-12-01 00:55:04 +00:00
@R0Y00 on GitHub · 2026-12-01 01:14 UTC · original · approved these changes
Reviewed the opt-in stall watcher. It waits for the first heartbeat, restarts the interval when the frame count changes, and caps dumps.
ctest --test-dir <build> --no-tests=error -j1 -R '^startup_stall_watch' --output-on-failurepassed all three cases, including the early-dump and no-reset controls.github-bot referenced this pull request2026-12-03 17:11:37 +00:00