tooling: add a run end-point section to the startup triage report #1940
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1947"
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 tedin7 on 2026-11-24T21:59:02Z.
Refs #1758, #870.
A report of a startup run is only comparable with another one if both say how far the run got and how it ended: the memory cap is not enough (#1758 asks for cap, peak commit and end exception). Today the triage report reads none of that, so reports on #870 mix the runs by hand. This adds a
Run End-Pointsection totools/startup/triage_run.py.Change
The section is built from the same kind of allowlisted values as the rest of the tool:
commit peak=N MiBof thex2w-dstorage heartbeatlines (not the last one)Nheartbeat N s:secondNfailed requests by causeline of #1781 (the later second wins)... first-chancelines ofdebug_launch.py'sevents.txt`Exceptions that
debug_launch.pysteps over (loader and assertion breakpoint, single step, thread name, debug print) are not stop events. A value the log does not carry isnot reported. A code that is not exactly eight hex digits, a count that is not decimal and a cause name outside the fixed eight are ignored. Module names, paths, addresses and exception parameters are never copied. The new reads never replace the existing classification of a line:RunEndpoint.observeonly reads, and the line is classified as before.The tool still has no dependency outside the standard library.
debug_launch.pyand the producers are not edited.Tests (
tests/startup_triage_run_check.py, synthetic logs only)events.txtwith a loader breakpoint, a thread name, a first-chance C++ exception and a second-chance access violation. Checks the maximum peak, the last second, the last cause counts, the first and last stop and the stop count.commit peak=(cause line only; acommit unknownheartbeat; an empty directory):not reported._keep_peakand_is_later_samplein the source by hand and the check failed each time (1 and 3 failures); both were restored.Verified (Linux only)
python3 -B tests/startup_triage_run_check.py: 0 failed.git diff --check origin/main,tests/docs_links_check.py,tests/bidi_controls_check.py: pass.git merge-tree --write-treeagainst the head of all 119 open PRs (among them #1408, #1801, #1794, #1251, #1229): no conflict that does not already exist between that PR andorigin/main(38 PRs already conflict withmain), and no conflict withorigin/mainitself. No open PR touchedtriage_run.pyor the check when I looked.Not run
xcrdapi.cpp(heartbeat and cause line),startup_heartbeat_check.pyanddebug_launch.py. If a producer changes a format, the section reportsnot reportedinstead of a wrong value.AI-assisted; commands listed were executed locally.
Replaces closed draft #1816 (rebased cleanly on origin/main).
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T22:05:11Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
ef9a0798fcℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T22:02:08Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
ef9a079ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T22:16:14Z.
Ran it, broke three rules, two caught
Windows 11 build 26300.9974:
Mutations to
tools/startup/triage_run.py, each reverted:_keep_peak:max(old, new)→new(last peak wins)NON_STOP_EXCEPTIONS→set()(first-chance codes counted as run stops)_is_later_sample:new_second >= old_second→TrueThe peak case is covered by design — the fixture already carries
HEARTBEAT_COMMIT.format(second=299, peak=14000, …)with thecomment "a lower peak after a higher one", which is exactly the line that catches it.
The survivor: no case has a heartbeat that goes backwards
_is_later_sampleguards updating the recorded second, peak and failure cause from heartbeat lines, and the fixture feeds seconds20 → 290 → 299, i.e. monotonic. With the guard forced toTrue, a log whose lines are not in time order lets an earliersample overwrite the run's end second, so the report says the run got less far than it did — and since the end second is what a
reader uses to compare two runs (#1758's whole purpose), that is a wrong number rather than a missing one.
One case closes it, in the shape the file already uses:
Without the guard,
299is replaced by290.What the section gets right
\d{1,10}), and only decimal counts, the fixedFAILURE_CAUSESnames and the 32-bit exception codewith its chance are copied — the module names, paths, addresses and exception parameters are dropped, which is the right
allowlist direction for a report that gets pasted into an issue.
NON_STOP_EXCEPTIONSis a named set with the reason in the comment, so a later reader can check the four codes againstdebug_launch.pyinstead of guessing why 0x80000003 is excluded._keep_peakand_is_later_sampleinto two named helpers is what let me test them apart; please keep it that way.What this does not establish
Nothing about a real run: the fixture is synthetic stderr and an events file. Whether
debug_launch.pyemits the heartbeat linesin order is not something this test checks, and that is precisely why the backwards case is worth pinning rather than assuming.
Verdict
Reviewed. Two of the three rules are pinned and the allowlist is careful; the ordering guard has no case.
Notes
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T22:05:11Z.
Code review location:
tools/startup/triage_run.py; line 101When a run ends on a main-image breakpoint, this blacklist drops its terminal
0x80000003event along with the loader breakpoint. The inspectedtools/startup/debug_launch.py:608–615only continues main-image breakpoints while the configured assertion budget remains; otherwise they stop the run, andtools/startup/run.ps1:21defaults that budget to zero. A synthetic log containing the loader breakpoint followed by the stopping breakpoint consequently reports both stop events asnot reportedand a stop count of zero. If earlier exceptions exist, the report instead leaves an unrelated exception as the last stop. Distinguish continued breakpoint events from the actual stopping event rather than excluding the exception code unconditionally.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T23:50:35Z.
I pushed a follow-up for the existing breakpoint finding and ChazY11’s out-of-order heartbeat control. The debugger now emits the code and chance only when it actually stops. The triage script distinguishes that result from observed exceptions and can also read the existing legacy summary. The source-built Windows debugger fixture confirms exactly one terminal breakpoint marker and none for its continue-to-exit control. The triage and documentation checks passed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T23:55:27Z.
The main merge is now on this branch. I kept both the existing shader-reason coverage and the new endpoint cases. The synthetic triage suite, docs links and combined Windows debugger probe passed, including default-disabled call hooks and the explicit terminal breakpoint.