tooling: add a run end-point section to the startup triage report #1809

Closed
tedin7 wants to merge 1 commit from upstream-pr/1816 into main
tedin7 commented 2026-11-24 19:07:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T19:07:30Z.


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-Point section to tools/startup/triage_run.py.

Change

The section is built from the same kind of allowlisted values as the rest of the tool:

Item Source Copied
Peak commit the largest commit peak=N MiB of the x2w-dstorage heartbeat lines (not the last one) the decimal N
Last heartbeat the highest heartbeat N s: second the decimal N
Failed requests by cause the last failed requests by cause line of #1781 (the later second wins) the second, and the count of each of the eight fixed cause names
First and last stop event the `exception ... first-chance second-chancelines ofdebug_launch.py's events.txt`

Exceptions that debug_launch.py steps over (loader and assertion breakpoint, single step, thread name, debug print) are not stop events. A value the log does not carry is not 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.observe only reads, and the line is classified as before.

The tool still has no dependency outside the standard library. debug_launch.py and the producers are not edited.

Tests (tests/startup_triage_run_check.py, synthetic logs only)

  • A complete run: several heartbeats with a lower peak after a higher one, two cause lines, an events.txt with 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.
  • A run with no commit peak= (cause line only; a commit unknown heartbeat; an empty directory): not reported.
  • A run with a second stop: the same code first-chance then second-chance.
  • Hostile lines: a path, a link, an address inside the exception line, a nine-or-more digit code, a non-decimal peak, a cause value that is an address, an unknown cause name. None of it may appear.
  • Four mutations are applied in the test and each must be caught: the peak taken from the last line, an earlier cause line replacing a later one, a code pattern that is not limited to 32 bits, and every exception counted as a stop. I also broke _keep_peak and _is_later_sample in 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-tree against the head of all 119 open PRs (among them #1408, #1801, #1794, #1251, #1229): no conflict that does not already exist between that PR and origin/main (38 PRs already conflict with main), and no conflict with origin/main itself. No open PR touched triage_run.py or the check when I looked.

Not run

  • No real run log: the line formats come from xcrdapi.cpp (heartbeat and cause line), startup_heartbeat_check.py and debug_launch.py. If a producer changes a format, the section reports not reported instead of a wrong value.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6589339421 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1816). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T19:07:30Z. --- 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-Point` section to `tools/startup/triage_run.py`. ## Change The section is built from the same kind of allowlisted values as the rest of the tool: | Item | Source | Copied | |---|---|---| | Peak commit | the largest `commit peak=N MiB` of the `x2w-dstorage heartbeat` lines (not the last one) | the decimal `N` | | Last heartbeat | the highest `heartbeat N s:` second | the decimal `N` | | Failed requests by cause | the last `failed requests by cause` line of #1781 (the later second wins) | the second, and the count of each of the eight fixed cause names | | First and last stop event | the `exception <code> ... first-chance|second-chance` lines of `debug_launch.py`'s `events.txt` | the 32-bit code, lowercase, and the chance | Exceptions that `debug_launch.py` steps over (loader and assertion breakpoint, single step, thread name, debug print) are not stop events. A value the log does not carry is `not 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.observe` only reads, and the line is classified as before. The tool still has no dependency outside the standard library. `debug_launch.py` and the producers are not edited. ## Tests (`tests/startup_triage_run_check.py`, synthetic logs only) - A complete run: several heartbeats with a lower peak after a higher one, two cause lines, an `events.txt` with 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. - A run with no `commit peak=` (cause line only; a `commit unknown` heartbeat; an empty directory): `not reported`. - A run with a second stop: the same code first-chance then second-chance. - Hostile lines: a path, a link, an address inside the exception line, a nine-or-more digit code, a non-decimal peak, a cause value that is an address, an unknown cause name. None of it may appear. - Four mutations are applied in the test and each must be caught: the peak taken from the last line, an earlier cause line replacing a later one, a code pattern that is not limited to 32 bits, and every exception counted as a stop. I also broke `_keep_peak` and `_is_later_sample` in 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-tree` against the head of all 119 open PRs (among them #1408, #1801, #1794, #1251, #1229): no conflict that does not already exist between that PR and `origin/main` (38 PRs already conflict with `main`), and no conflict with `origin/main` itself. No open PR touched `triage_run.py` or the check when I looked. ## Not run - No real run log: the line formats come from `xcrdapi.cpp` (heartbeat and cause line), `startup_heartbeat_check.py` and `debug_launch.py`. If a producer changes a format, the section reports `not reported` instead of a wrong value. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-24 20:00:45 +00:00
tedin7 commented 2026-11-24 20:01:17 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T19:14:58Z.


Closing this draft for now to help keep the open PR queue manageable; the branch stays preserved on the fork so it can be reopened once the queue clears.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7141820883 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1816#issuecomment-7141820883). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T19:14:58Z. --- Closing this draft for now to help keep the open PR queue manageable; the branch stays preserved on the fork so it can be reopened once the queue clears.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!1809
No description provided.