tooling: end a startup debugger run when <logdir>/stop appears #2468
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2476"
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 R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-25T17:52:18Z.
What
tools/startup/debug_launch.pycan only be ended early by killing it, and killing it skips the final thread dump. With this change, the launcher checks twice a second for a file namedstopin the log directory.threads.txt,X2W_DUMPruns, and the rip histogram is printed. The summary andfinished.txtsaystopped by request after X s (stop file)instead oftimeout after X s, andevents.txtlogsstop file found.trap.logandfinished.txt.Test
tests/startup_debug_check.py(the existingstartup_debugCTest) gains two cases on the source-built probe. The probe waits 3 s before it exits.<logdir>/stop1.5 s into the run. The run reportsstopped by request, notprocess exited.events.txtlogs it, andthreads.txtholds stacks.main'sdebug_launch.py, the stop-file case fails, because the probe runs to its own exit.Environment
allbuilds (Ninja Release, MSVC Build Tools 18).Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T18:40:27Z.
Review: COMMENTED
Review of head
da6342a(tooling only, 2 files, +44/-3). No startup-progress claim, so nothing here needs a game result.Code (
tools/startup/debug_launch.py)trap.logandfinished.txt, so a reused log dir starts clean.breaks into the same post-loop path as the timeout. The process is still alive there, so it reaches theelsebranch (thread dump,X2W_DUMP, rip histogram). Only the summary text differs. Correct.Test (
tests/startup_debug_check.py)startup_debugcheck on the source-built probe, with no new CTest. It has a stop case and a stale-file control. The PR text also describes a negative control againstmain's launcher.run_with_stopwrites<logdir>/stopafter a fixed 1.5 s sleep. If the launcher has not created<logdir>yet (slow Python start on a loaded runner),write_textraises FileNotFoundError. Alogdir.mkdir(exist_ok=True)before the write removes that flake.docs/startup-runtime.mddocuments the launcher but does not mention the stop file.Windows results
startup_debug: PASS) in the PR body. The body gives no head SHA, so I cannot say which head it covers. I did not re-run it.Commands I ran locally (Linux worktree at the head SHA)
git diff --check origin/main...HEAD: cleanpython3 -I -m py_compileon both files: OKpython3 tests/docs_links_check.py: passpython3 tests/bidi_controls_check.py: passNo duplicate PR found (searched "debug_launch stop file"). No Windows VM was used and no merge action is taken here.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T19:05:26Z.
Review: COMMENTED
Review of head
79093c7b(same change asda6342a7plus a merge of main).tools/startup/debug_launch.py: the stop file is polled every 0.5 s, the loop breaks into the same path as the timeout (thread dump,X2W_DUMP, histogram), and a stalestopis removed at start. Message andevents.txtline match the description.tests/startup_debug_check.py: new stop-file case (file created 1.5 s into a 3 s probe, expectsstopped by request,events.txtline andthreads.txtstacks) and a stale-file control. This extends the existingstartup_debugCTest, no new test target.Commands run locally:
python3 tests/docs_links_check.py,python3 tests/bidi_controls_check.py,git diff --check origin/main...HEAD,python3 -m py_compileon both files (all OK). Win2025:ctest -R '^startup_debug'dev 1/1 and release 1/1 passed (receipt below). I did not re-run the negative control against main's launcher myself; the PR body states it.No blocking findings.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T19:05:24Z.
Win2025 WARP receipt for head
79093c7bafter updating with main.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
79093c7b82bf5cfa8867692f7eded84bc22cadad:--preset dev):cmake --build --preset dev --target startup_debug_calls startup_debug_probe -- -j 2):0.13s(configure2.40s)ctest --preset dev -R '^startup_debug' --parallel 2 --no-tests=error --output-on-failure): 1/1 passed (53.12s:startup_debug52.95s)/O2(--preset release):cmake --build --preset release --target startup_debug_calls startup_debug_probe -- -j 2):53.14s(configure2.81s)ctest --preset release -R '^startup_debug' --parallel 2 --no-tests=error --output-on-failure): 1/1 passed (53.94s:startup_debug53.80s)tests/startup_run_ps1_check.pyok (12.7s)sccache: 241/947 hits; wall132.4sAI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T19:06:04Z.
Update: after #1794 landed on main, this branch conflicts in
tools/startup/debug_launch.py(gh pr update-branchrefuses). The change itself reviewed fine (see review above). @denn0x, please merge main into the branch and resolve that file. After that it needs a fresh Win2025 receipt on the new head before merge.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T20:21:55Z.
Review: COMMENTED
Review of head
fa8197f5against current main (comment only).Checked:
tools/startup/debug_launch.py: the stop file is polled every 0.5 s inside the existing main loop and breaks out the same way the timeout does, sothreads.txt,X2W_DUMPand the rip histogram still run. The summary andfinished.txttext switch tostopped by requestonly when the flag is set. A stalestopis removed withtrap.logandfinished.txt. Works with--timeout 0.tests/startup_debug_check.py: extends the existingstartup_debugcheck (no new CTest). The stop case creates the file only after the probe is logged as running, so it cannot pass by the probe exiting on its own (process exitedis asserted absent). The stale-file control asserts a normal exit and that the file is gone.Commands run (Linux):
python3 -I -m py_compile tools/startup/debug_launch.py tests/startup_debug_check.pyOKpython3 tests/docs_links_check.pyOKpython3 tests/bidi_controls_check.pyOKgit diff --check origin/main...HEADcleanNot run here: the check itself needs the Windows probe exe, so it is exercised by the Win2025 run and CI.
AI-assisted; commands listed were executed locally.
upstream-sync referenced this pull request2026-11-25 21:01:24 +00:00
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T20:25:06Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
fa8197f5a1dc6eeaa0a066c66f3931ea47badcad:--preset dev):cmake --build --preset dev --target startup_debug_calls startup_debug_probe -- -j 2):0.12s(configure0.00s)ctest --preset dev -R '^startup_debug$' --parallel 2 --no-tests=error --output-on-failure): 1/1 passed (67.90s:startup_debug67.76s)/O2(--preset release):cmake --build --preset release --target startup_debug_calls startup_debug_probe -- -j 2):67.91s(configure0.00s)ctest --preset release -R '^startup_debug$' --parallel 2 --no-tests=error --output-on-failure): 1/1 passed (54.94s:startup_debug54.84s)tests/startup_run_ps1_check.pyok (10.9s),tests/startup_run_sh_check.pyskipped (0.1s)sccache: 0/-5 hits; wall144.4sAI-assisted; commands listed were executed locally.