Repository navigation
tools: dump threads when a run stops presenting (X2W_DUMP_ON_STALL) - #3674
Merged
Merged
Conversation
X2W_DUMP_AT needs the stall time in advance. X2W_DUMP_ON_STALL=<s> has the startup debugger watch the stand-in's heartbeat frame count in trap.log and write every thread's stack once it has not changed for that long, at most three times. The decision is in stall_watch.py, with a device-free check and two controls that must fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R0Y00
approved these changes
Dec 1, 2026
R0Y00
left a comment
Owner
There was a problem hiding this comment.
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-failure passed all three cases, including the early-dump and no-reset controls.
R0Y00
pushed a commit
that referenced
this pull request
Dec 1, 2026
… control The real_log_error control copies debug_launch.py plus a hard-coded list of local modules into a scratch tree. #3674 (58352a6) added 'from stall_watch import StallWatch' to debug_launch.py and did not update that list, so the copied launcher died with ModuleNotFoundError before reaching the events.txt open. The control then reported that the debugger log error was not captured, because the summary held the missing module instead of the PermissionError it looks for. Derive the list from debug_launch.py's own imports so the next addition cannot break the control the same way.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #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