tooling: add --assert-sites to the startup debugger #2916
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2916"
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 pigalot on 2026-11-26T19:42:24Z.
--continue-asserts Nsteps over the first N main-imageint3hits in total. A soft assert that repeats uses that budget up, so a long run needs an ever larger number (runs on #870 pass-ContinueAsserts 200000), and once the budget runs out the next repeat of a known site stops the run.--assert-sites N(run.ps1 -AssertSites N,run.sh --assert-sites N) counts distinct sites instead. Every hit at up to N distinct main-imageint3sites is stepped over, however long the run is. The first hit at one more site still stops the run, so a new assert is still caught, andX2W_STOP_ATsites still stop. A hit is stepped over when either budget allows it, and each budget counts only the hits it covers: the site budget keeps its own set of admitted sites (the first N distinct ones), and--continue-assertscounts the hits at other sites. Used alone,--continue-assertskeeps its meaning.run.ps1andrun.shpass--assert-sites 0by default, so their behavior does not change.Refs #870
Tests
tests/startup_debug_check.py(core group), onstartup_debug_probewith its third site repeated 20 times:--assert-sites 3exits 0 and logs all 20 hits at the repeated site.--continue-asserts 3stops at the repeated site's second hit.--assert-sites 2stops at the first hit of the third site.X2W_STOP_ATon the second site still stops there under--assert-sites 3.--assert-sites -1is rejected.STARTUP_DEBUG_PROBE_REVISIT=1, so the hits are A, B, A):--assert-sites 1 --continue-asserts 2exits 0 with the breakpoints logged in that order. Control:--continue-asserts 2alone stops at A's second hit.startup_run_ps1_check.pyandstartup_run_sh_check.pycheck that-AssertSites/--assert-sitesreach the debugger.At
3d4460f7(onfa754b0f), rebased on main98007de5after cpp-migration merged (#3039). The one conflict, intests/startup_run_ps1_check.py, kept main's new-NativeShaderslines and added-AssertSites 2to the shared command. Windows 11 Pro 10.0.26200.startup_run_shskipped on this host (no wine).Negative control: with the site rule in
debug_launch.pydisabled,startup_debugfails at the--assert-sites 3case, because the run stops at the repeated site instead of exiting 0. With the predicate from the first commit (fa754b0f) (both budgets readingasserts_seen),startup_debugfails at the combined case: the run stops at A's second hit (startup_debug_probe.exe+0x199c).This change was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-26T20:24:38Z.
Review: COMMENTED
tooling: add --assert-sites to the startup debugger
This is a clean, well-structured addition. The new
--assert-sites Nflag is a practical complement to--continue-asserts N— counting distinct sites instead of total hits will save users from running out of budget on repeat-hit assert paths like texture streaming.Minor typo fix needed
File:
tools/startup/debug_launch.pyThe error message string on the continuation of the print call has a missing leading space:
Consider ensuring the second line starts with a space for consistent formatting.
Everything looks good
assert_sites < 0properly guardedX2W_STOP_ATusage()in both run.ps1 and run.shVerdict: LGTM once the minor typo is addressed. Ready to merge.
Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-26T20:27:19Z.
Thanks for the review. The first string already ends with a space (
"... --continue-asserts and "), so the two parts join as... integer --continue-asserts and --assert-sites values. I have left the line as it is.This reply was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-27T05:30:54Z.
Review: COMMENTED
PR #2916 by @pigalot -- tooling: add --assert-sites to the startup debugger
What works
Issues
Recommendations
Overall
A well-researched, well-tested implementation. The linear layout extension is cleanly separated from tiled modes. Minor concern about BC format handling in linear mode, but the existing refusal behavior is safe. Ready for merge.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T06:20:39Z.
Review: CHANGES_REQUESTED
The two budgets share
asserts_seen, so the total-hit allowance can revoke a site that the distinct-site allowance already covers. I evaluated the exact predicate from06b3df15with sites A, B, A and--assert-sites 1 --continue-asserts 2. It continued A, continued B, then stopped at A. A is the first admitted site and should keep continuing under the stated rule that either budget can permit a hit.Please keep the sites admitted by the site budget separately from the total-hit bookkeeping and add a combined-budget fixture that revisits A after using the total-hit allowance on B. The existing tests cover each allowance on its own.
Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T09:17:24Z.
Thanks, confirmed. B went into
asserts_seenthrough the hit budget, so at A's second hit the site count was already 2.9de38269keeps the two budgets apart: the site budget has its own set of admitted sites, and--continue-assertscounts only the hits at other sites. Either option on its own behaves as before.The probe can now revisit its first breakpoint (
STARTUP_DEBUG_PROBE_REVISIT=1). The newassert-sites-combinedcase checks that A, B, A with--assert-sites 1 --continue-asserts 2runs to exit 0 with the breakpoints in that order. Its control,--continue-asserts 2alone, stops at A's second hit.ctest --preset dev --no-tests=error -R '^(startup_debug|startup_run_ps1|startup_run_sh|docs_links)': 7 of 7 passed (startup_run_shskipped, no wine). With the old predicate and the new test,startup_debugstops at A's second hit.This reply was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-27T21:53:33Z.
This PR no longer merges cleanly with main. Conflicting files:
tools/startup/debug_launch.py,tools/startup/run.ps1,tools/startup/run.sh. Please merge main into the branch.R0Y00's change request (the two budgets sharing
asserts_seen) looks addressed by9de38269(site budget kept apart, combined-budget fixture). It still shows CHANGES_REQUESTED, so R0Y00 needs to re-review after the merge of main.AI-assisted; commands listed were executed locally. (Trial merge against origin/main.)
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-27T23:57:53Z.
Merged main into this branch (merge commit
1b87eb236, no rebase); the launcher and debugger conflicts were resolved by keeping main's capture options next to --assert-sites. R0Y00: the combined-budget point from your review looks fixed by9de38269(site budget kept apart from the hit count, A, B, A with --assert-sites 1 --continue-asserts 2 now continues all three, with a control run). Please re-review when you can; I will not merge while the change request is open.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-28T03:24:14Z.
I merged
main(0637fced) into this branch as43b02d08. It's a plain merge commit; I didn't rebase or force-push. It was needed becausemainchanged the samedebug_launch.pycall intools/startup/run.ps1again after the earlier merge at1b87eb23.Conflict.
mainnow runs that call inside a script block with$ErrorActionPreference = "Continue", so Windows PowerShell 5.1 no longer stops the launcher on redirected stderr. I keptmain's block and added this branch's--assert-sites $AssertSitesafter--continue-asserts $ContinueAsserts.tests/startup_run_ps1_check.pyanddocs/startup-runtime.mdmerged without conflicts.git diff --check origin/main...HEADreports no problems.Testing on
43b02d08:devandrelease.ctest --no-tests=error -j 4 -E '(_hardware$|startup_audio_)' -R '^(startup_run_ps1|startup_debug.*|startup_assert.*|startup_triage.*|startup_run_sh)$'. All 8 tests pass, includingstartup_run_ps1andstartup_debug.dev(-j 6 -E '(_hardware$|startup_audio_)'). All 2000 tests pass.mainhas moved on tobf1bc769, but none of the new commits touch this PR's files, and the branch still merges cleanly. R0Y00's changes request still stands and needs a re-review.Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10.
This reply was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-28T04:31:01Z.
I merged
main(fbef6381) into this branch again, asb2b40747. It's a plain merge commit; I didn't rebase or force-push. After #1251 merged,mainadds@mapArgsto the samedebug_launch.pycall intools/startup/run.ps1that this branch extends with--assert-sites.Conflict. The resolution passes both arguments:
--continue-asserts $ContinueAsserts --assert-sites $AssertSites @mapArgs @traceArgs @captureArgs, still insidemain's script block. Intools/startup/debug_launch.py,--assert-sitesand--map-drivemerged without a conflict, and each is read on its own.git diff --check origin/main...HEADreports no problems.Testing on
b2b40747:devandrelease.ctest --no-tests=error -j 4 -E '(_hardware$|startup_audio_)' -R '^(startup_run_ps1|startup_debug.*|startup_map_drive.*|startup_hook.*|startup_launch.*|startup_host_cpu_debug.*|startup_triage.*|startup_run_sh)$'. All 15 tests pass, includingstartup_run_ps1,startup_debug,startup_map_driveandstartup_map_drive_overlap.dev(-j 6 -E '(_hardware$|startup_audio_)'). All 2020 tests pass.mainis now at240e0fb9. None of its new commits touch this PR's files, and the branch still merges cleanly. R0Y00's changes request still stands and needs a re-review.Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10.
This reply was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T04:45:15Z.
Review: APPROVED
Re-reviewed
b2b40747. Admitted sites and counted hits now have independent state. The source-built A, B, A probe exits successfully with the combined budgets, while the hit-only control stops on the returning A. The PowerShell merge keeps--assert-sitesand the separate drive-map, trace and capture arguments in the guarded debugger invocation.On Windows 11 build 26200, MSVC 19.51, I built
startup_debug_probein Debug and Release and ranctest --preset <preset> --no-tests=error --output-on-failure -R '^(startup_debug|startup_debug_launch_args|startup_run_ps1|startup_run_sh)$'. Debug and Release each reported three passes and the expected Windows skip for the POSIX launcher check. The hosted Linux Python check is green. The requested change is resolved.