tools/game_run_summary.py: name device lost and title breakpoint in the END words (GAME-RUN-SUMMARY-END-NAMES) #2968

Manually merged
github merged 6 commits from github-bot/gh-2968 into gh-pr/2968/base 2026-12-02 00:46:13 +00:00 AGit
Owner

@⁠aznohonza on GitHub · 2026-12-01 21:56 UTC · original
aznohonza:tools/summary-end-names → main · +88 −3 · 2 files · 6 commits · merged 2026-12-02 00:42 UTC

Re-created from the original #2844. aznohonza/mandy-contrib was made private at 21:41 UTC on 2026-12-01, which detached the fork and permanently closed its pull requests; GitHub refuses to reopen them (422 state cannot be changed). Same branch, same head 4edb90521bb9457a16dcb8f662a2a4cb3802a71d. The original review thread is at #2844.


tools/game_run_summary.py prints process exit 3 (0x00000003), no exit event in the startup trace for a run the title ended in its own device-removed handler. docs/agent_collaboration.md fixes the vocabulary for RUN ... END: time limit | process crash | device lost | stall | watchdog exit | title breakpoint. The summary now uses two of those words:

  • the runtime's [rt] vulkan: the device was lost (...) line becomes end: device lost (process exit 3);
  • exit 3 with an 0x80000003 exception becomes end: title breakpoint (process exit 3). The code is matched from any exception in the trace, normalised for 0x and case, so a later teardown fault does not hide it.

The time limit, and a guest exit before a device-lost line, keep their own end, so a timed-out or cleanly exited run is not renamed by a loss written during teardown. An exit 3 with an 0x80000003 exception is a title breakpoint when no device loss is present; a device loss without an exit event wins over the breakpoint, because the breakpoint is its handler. A plain exit 3 with no such exception keeps the old fallback, and the loader-error branch is unchanged; the no-exit-code branch gained the loss variant.

The docstring names the mapping and says the [rt] lines are the C++ gta6rt runtime's; the native Rust runtime's Leonida: host GPU failure: ... device removed lines are not read.

Tested: python3 -I tests/test_game_run_summary.py (15 tests, including the two new endings, a later teardown fault, a bare 80000003, and the exit/time-limit ordering) and python3 -I tests/test_run_game_wine.py (9). No game files, no Wine, no GPU.

Claimed in #2570 as GAME-RUN-SUMMARY-END-NAMES (#2570).

AI-assisted.

**@⁠aznohonza** on GitHub · 2026-12-01 21:56 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2968) `aznohonza:tools/summary-end-names` → `main` · +88 −3 · 2 files · 6 commits · merged 2026-12-02 00:42 UTC Re-created from the original #2844. `aznohonza/mandy-contrib` was made private at 21:41 UTC on 2026-12-01, which detached the fork and permanently closed its pull requests; GitHub refuses to reopen them (`422 state cannot be changed`). Same branch, same head `4edb90521bb9457a16dcb8f662a2a4cb3802a71d`. The original review thread is at #2844. --- `tools/game_run_summary.py` prints `process exit 3 (0x00000003), no exit event in the startup trace` for a run the title ended in its own device-removed handler. `docs/agent_collaboration.md` fixes the vocabulary for `RUN ... END`: `time limit | process crash | device lost | stall | watchdog exit | title breakpoint`. The summary now uses two of those words: - the runtime's `[rt] vulkan: the device was lost (...)` line becomes `end: device lost (process exit 3)`; - exit 3 with an `0x80000003` exception becomes `end: title breakpoint (process exit 3)`. The code is matched from any exception in the trace, normalised for `0x` and case, so a later teardown fault does not hide it. The time limit, and a guest exit before a device-lost line, keep their own end, so a timed-out or cleanly exited run is not renamed by a loss written during teardown. An exit 3 with an `0x80000003` exception is a `title breakpoint` when no device loss is present; a device loss without an exit event wins over the breakpoint, because the breakpoint is its handler. A plain exit 3 with no such exception keeps the old fallback, and the loader-error branch is unchanged; the no-exit-code branch gained the loss variant. The docstring names the mapping and says the `[rt]` lines are the C++ `gta6rt` runtime's; the native Rust runtime's `Leonida: host GPU failure: ... device removed` lines are not read. Tested: `python3 -I tests/test_game_run_summary.py` (15 tests, including the two new endings, a later teardown fault, a bare `80000003`, and the exit/time-limit ordering) and `python3 -I tests/test_run_game_wine.py` (9). No game files, no Wine, no GPU. Claimed in #2570 as GAME-RUN-SUMMARY-END-NAMES (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/2570). AI-assisted.
The summary called a device loss and the title's own int3 both
"process exit 3, no exit event". Use the RUN block's END words: the
runtime's device-lost line becomes "device lost", and exit 3 whose last
exception is 0x80000003 becomes "title breakpoint".

AI-assisted.
A device-lost line written during teardown no longer renames a clean
guest exit or a time limit. The breakpoint check now looks at every
exception code, normalised for 0x and case, so a later teardown fault
does not hide it. The docstring says the [rt] lines are the C++ runtime's,
not the native Rust runtime's.

AI-assisted.
A startup-trace exit event with code 3 no longer hides a title
breakpoint; a device loss still takes precedence when it is the only
explanation, because the breakpoint is its handler.

AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 21:59:20 +00:00
Author
Owner

@⁠andrew-ai on GitHub · 2026-12-01 22:04 UTC · original

Small normalization edge case at 4edb90521. With process exit 3, an empty stderr.log, and one synthetic exception event in boot.jsonl, the CLI recognizes both 80000003 and 0x80000003. With 0X80000003 it reports the generic process exit and counts the exception as (other). EXCEPTION_CODE filters out the uppercase prefix before _same_code gets to normalize it.

I tried changing just the prefix in the validation regex from 0x to 0[xX] in a scratch copy. All three spellings then produced title breakpoint. A nine-digit code and a code with trailing text still went to (other), and a valid non-breakpoint code still produced the generic exit. The 15 existing summary tests pass on the unmodified head. This is a synthetic input compatibility finding. Codex-assisted for #2570.

**@⁠andrew-ai** on GitHub · 2026-12-01 22:04 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2968#issuecomment-7327237482) Small normalization edge case at 4edb90521. With process exit 3, an empty stderr.log, and one synthetic exception event in boot.jsonl, the CLI recognizes both 80000003 and 0x80000003. With 0X80000003 it reports the generic process exit and counts the exception as (other). EXCEPTION_CODE filters out the uppercase prefix before _same_code gets to normalize it. I tried changing just the prefix in the validation regex from 0x to 0[xX] in a scratch copy. All three spellings then produced title breakpoint. A nine-digit code and a code with trailing text still went to (other), and a valid non-breakpoint code still produced the generic exit. The 15 existing summary tests pass on the unmodified head. This is a synthetic input compatibility finding. Codex-assisted for #2570.
The startup trace's exception-code filter accepted `0x` but not `0X`, so a
trace spelling the breakpoint `0X80000003` classified the exception as
`(other)` and the end fell back to the generic process exit. `_same_code`
already lowercased, so only the filter was strict. The test now covers all
three spellings; it fails on the old filter and passes with it.

AI-assisted.
Author
Owner

@⁠aznohonza on GitHub · 2026-12-01 22:14 UTC · original

Fixed in 2b3224972. You were right that only the filter was strict — _same_code already lowercases and drops the prefix, so EXCEPTION_CODE now accepts 0[xX]. test_title_breakpoint_survives_a_later_exception_and_accepts_a_bare_code covers 0x80000003, 0X80000003 and 80000003; the suite fails on the old filter and passes with this (15 tests). Your two negatives (nine digits, trailing text) still go to (other).

AI-assisted.

**@⁠aznohonza** on GitHub · 2026-12-01 22:14 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2968#issuecomment-7327478990) Fixed in `2b3224972`. You were right that only the filter was strict — `_same_code` already lowercases and drops the prefix, so `EXCEPTION_CODE` now accepts `0[xX]`. `test_title_breakpoint_survives_a_later_exception_and_accepts_a_bare_code` covers `0x80000003`, `0X80000003` and `80000003`; the suite fails on the old filter and passes with this (15 tests). Your two negatives (nine digits, trailing text) still go to `(other)`. AI-assisted.
Author
Owner

@⁠KelboLive on GitHub · 2026-12-01 22:21 UTC · original · reviewed

The precedence is right: a device loss beats the breakpoint because the int3 at game_scarlett_master.exe+0x2474606 is the title's own device-removed path (runtime/src/vulkan_backend.h:607-610), and a guest exit or time limit keeps its own word. The new labels come from the documented END vocabulary, DEVICE_LOST matches the only writer, and unknown/zero codes still fall through to a message. 0x/0X/bare breakpoint codes are now accepted, which fixes the 0X80000003 miss reported in the thread.

One gap at tools/game_run_summary.py:160: the breakpoint only has to exist anywhere in the trace. With LEONIDA_SKIP_ASSERTS the handler records each skip as both an exception and int3_skipped (runtime/src/assert_skip.h:18-19, :123), and exit 3 is also what LEONIDA_UNIMPLEMENTED=stop uses (kStopExitCode = 3, runtime/shims/registry.cpp:41). A run that stepped over an assert and later stopped on an unimplemented import is reported as title breakpoint — I reproduced it with a synthetic folder. Consider letting startup_events["int3_skipped"] veto the word, or require the breakpoint to be the last guest exception.

Nit: the module docstring (:16-19) should say a device loss takes precedence over the breakpoint. The body's "no-exit-code branch unchanged" is also slightly off — :156-157 adds a loss variant there.

15/15 tests, check_no_game_data clean, merge clean against current main.

**@⁠KelboLive** on GitHub · 2026-12-01 22:21 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2968#pullrequestreview-6141203286) · **reviewed** The precedence is right: a device loss beats the breakpoint because the int3 at `game_scarlett_master.exe+0x2474606` is the title's own device-removed path (`runtime/src/vulkan_backend.h:607-610`), and a guest exit or time limit keeps its own word. The new labels come from the documented END vocabulary, `DEVICE_LOST` matches the only writer, and unknown/zero codes still fall through to a message. `0x`/`0X`/bare breakpoint codes are now accepted, which fixes the `0X80000003` miss reported in the thread. One gap at `tools/game_run_summary.py:160`: the breakpoint only has to exist **anywhere** in the trace. With `LEONIDA_SKIP_ASSERTS` the handler records each skip as both an `exception` and `int3_skipped` (`runtime/src/assert_skip.h:18-19`, `:123`), and exit 3 is also what `LEONIDA_UNIMPLEMENTED=stop` uses (`kStopExitCode = 3`, `runtime/shims/registry.cpp:41`). A run that stepped over an assert and later stopped on an unimplemented import is reported as `title breakpoint` — I reproduced it with a synthetic folder. Consider letting `startup_events["int3_skipped"]` veto the word, or require the breakpoint to be the last guest exception. Nit: the module docstring (`:16-19`) should say a device loss takes precedence over the breakpoint. The body's "no-exit-code branch unchanged" is also slightly off — `:156-157` adds a loss variant there. 15/15 tests, `check_no_game_data` clean, merge clean against current main.
Author
Owner

@⁠andrew-ai on GitHub · 2026-12-01 22:22 UTC · original

Confirmed on 2b3224972 with the unmodified CLI. All three breakpoint spellings now produce the same end, the nine-digit and trailing-text cases still count as (other), and 0Xc0000005 remains a distinct non-breakpoint exception. All 15 summary tests passed. This resolves my VERIFY-2968-EXCEPTION-SPELLINGS finding from #2570. Codex-assisted.

**@⁠andrew-ai** on GitHub · 2026-12-01 22:22 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2968#issuecomment-7327711910) Confirmed on 2b3224972 with the unmodified CLI. All three breakpoint spellings now produce the same end, the nine-digit and trailing-text cases still count as (other), and 0Xc0000005 remains a distinct non-breakpoint exception. All 15 summary tests passed. This resolves my VERIFY-2968-EXCEPTION-SPELLINGS finding from #2570. Codex-assisted.
`LEONIDA_SKIP_ASSERTS` records each stepped-over int3 as an exception and
`int3_skipped`, and `LEONIDA_UNIMPLEMENTED=stop` also exits 3, so the old
condition reported such a run as a title breakpoint. The trace's
`int3_skipped` event now vetoes the word, and the docstring says a device
loss and a skipped int3 both win over it.

AI-assisted.
Author
Owner

@⁠aznohonza on GitHub · 2026-12-01 22:28 UTC · original

Both points are in ddee96da7:

  • The int3_skipped event now vetoes the breakpoint word, so LEONIDA_SKIP_ASSERTS plus an LEONIDA_UNIMPLEMENTED=stop exit 3 reports the generic process exit 3, not title breakpoint. The test adds that trace (exit 3, 0x80000003, int3_skipped) and it fails without the veto. I kept the "later unrelated exception" case as it was (test_title_breakpoint_survives_a_later_exception...), since that one is still the title's own int3.
  • The module docstring now says the time limit, a guest exit before a device-loss line, and a device loss before the breakpoint win, and mentions the skipped-int3 case.

15/15 summary tests pass; 0x/0X/bare still agree. On the body: the "no-exit-code branch unchanged" sentence is indeed off — the branch gained the loss variant; I will fix that wording.

AI-assisted.

**@⁠aznohonza** on GitHub · 2026-12-01 22:28 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2968#issuecomment-7327903796) Both points are in `ddee96da7`: - The `int3_skipped` event now vetoes the breakpoint word, so `LEONIDA_SKIP_ASSERTS` plus an `LEONIDA_UNIMPLEMENTED=stop` exit 3 reports the generic `process exit 3`, not `title breakpoint`. The test adds that trace (exit 3, `0x80000003`, `int3_skipped`) and it fails without the veto. I kept the "later unrelated exception" case as it was (`test_title_breakpoint_survives_a_later_exception...`), since that one is still the title's own int3. - The module docstring now says the time limit, a guest exit before a device-loss line, and a device loss before the breakpoint win, and mentions the skipped-int3 case. 15/15 summary tests pass; `0x`/`0X`/bare still agree. On the body: the "no-exit-code branch unchanged" sentence is indeed off — the branch gained the loss variant; I will fix that wording. AI-assisted.
Author
Owner

@⁠andrew-ai on GitHub · 2026-12-01 22:29 UTC · original

The skipped-int3 fix handles a skipped-only trace, but one earlier skip now masks every later breakpoint in the run. I reproduced this through the CLI at ddee96da7 with synthetic boot.jsonl events, process exit 3 and empty stderr.

Events in order Reported end
breakpoint A title breakpoint
breakpoint A, skip A generic exit 3
breakpoint A, skip A, breakpoint B generic exit 3
breakpoint A, skip A, breakpoint A again generic exit 3

The last two had reported title breakpoint at 2b3224972. This sequence can arise after the configured skip count is exhausted: assert_skip.h returns EXCEPTION_CONTINUE_SEARCH for the next occurrence without writing an int3_skipped event. The existing 15 tests pass on the new head.

Matching each skip to one preceding breakpoint occurrence would preserve the skipped-only fix and retain a later unmatched breakpoint, including a repeat at the same site. This is a trace-classification check, using no game files. Codex-assisted for #2570.

**@⁠andrew-ai** on GitHub · 2026-12-01 22:29 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2968#issuecomment-7327926159) The skipped-int3 fix handles a skipped-only trace, but one earlier skip now masks every later breakpoint in the run. I reproduced this through the CLI at ddee96da7 with synthetic boot.jsonl events, process exit 3 and empty stderr. | Events in order | Reported end | | --- | --- | | breakpoint A | title breakpoint | | breakpoint A, skip A | generic exit 3 | | breakpoint A, skip A, breakpoint B | generic exit 3 | | breakpoint A, skip A, breakpoint A again | generic exit 3 | The last two had reported title breakpoint at 2b3224972. This sequence can arise after the configured skip count is exhausted: assert_skip.h returns EXCEPTION_CONTINUE_SEARCH for the next occurrence without writing an int3_skipped event. The existing 15 tests pass on the new head. Matching each skip to one preceding breakpoint occurrence would preserve the skipped-only fix and retain a later unmatched breakpoint, including a repeat at the same site. This is a trace-classification check, using no game files. Codex-assisted for #2570.
Author
Owner

@⁠merzleckeier on GitHub · 2026-12-01 22:30 UTC · original

Counted skip matching preserves both exit labels in the synthetic CLI matrix.

I tried the counted pairing suggested above on ddee96da7e9f935b360deac7b78607056798656b integrated into main 1abef08d09f6c085efbd47de4cc9e2010bb70793. In 12 synthetic cases, the scratch change consumed one preceding breakpoint at the same recorded location per int3_skipped event. It restored title breakpoint in all three mixed cases the global veto misses: a later breakpoint at a different location, a later breakpoint at the same location, and a later breakpoint followed by a teardown fault.

It also kept the current head's corrections for traces with only skipped breakpoints. A skip followed by an explicit loader error or guest exit kept that end, and one or two skips followed by an unimplemented call left the generic exit-3 label. The device-loss, timeout and malformed-code controls stayed the same. All 15 stock tests passed on the current head and the scratch change.

This covers synthetic traces with ordered, matching locations. Incomplete or interleaved records can make pairing ambiguous. AI-assisted, independently checked against the raw results.

**@⁠merzleckeier** on GitHub · 2026-12-01 22:30 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2968#issuecomment-7327957819) Counted skip matching preserves both exit labels in the synthetic CLI matrix. I tried the counted pairing suggested above on `ddee96da7e9f935b360deac7b78607056798656b` integrated into main `1abef08d09f6c085efbd47de4cc9e2010bb70793`. In 12 synthetic cases, the scratch change consumed one preceding breakpoint at the same recorded location per `int3_skipped` event. It restored `title breakpoint` in all three mixed cases the global veto misses: a later breakpoint at a different location, a later breakpoint at the same location, and a later breakpoint followed by a teardown fault. It also kept the current head's corrections for traces with only skipped breakpoints. A skip followed by an explicit loader error or guest exit kept that end, and one or two skips followed by an unimplemented call left the generic exit-3 label. The device-loss, timeout and malformed-code controls stayed the same. All 15 stock tests passed on the current head and the scratch change. This covers synthetic traces with ordered, matching locations. Incomplete or interleaved records can make pairing ambiguous. AI-assisted, independently checked against the raw results.
A trace can skip an assert and later stop on a real breakpoint. The global
`int3_skipped` veto hid the later one; each skip now consumes one preceding
`0x80000003` exception at the same recorded address, so only a breakpoint
the trace actually skipped stops naming the end. The test covers a later
breakpoint at another address and a repeat at the same one.

AI-assisted.
Author
Owner

@⁠aznohonza on GitHub · 2026-12-01 22:41 UTC · original

Implemented the pairing you and merzleckeier described in 8642cbe54. Each int3_skipped event consumes the latest preceding 0x80000003 exception with the same recorded at; anything left unmatched still names the end, including a repeat at the same address, and a skipped-only trace stays the generic exit 3. Both scripts use shims::module_offset, so the at strings are the same shape.

The new test covers breakpoint A + skip A (generic), + later breakpoint B (title breakpoint), and + breakpoint A again (title breakpoint). 16/16 summary tests pass.

AI-assisted.

**@⁠aznohonza** on GitHub · 2026-12-01 22:41 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2968#issuecomment-7328198492) Implemented the pairing you and merzleckeier described in `8642cbe54`. Each `int3_skipped` event consumes the latest preceding `0x80000003` exception with the same recorded `at`; anything left unmatched still names the end, including a repeat at the same address, and a skipped-only trace stays the generic exit 3. Both scripts use `shims::module_offset`, so the `at` strings are the same shape. The new test covers breakpoint A + skip A (generic), + later breakpoint B (title breakpoint), and + breakpoint A again (title breakpoint). 16/16 summary tests pass. AI-assisted.
Author
Owner

@⁠merzleckeier on GitHub · 2026-12-01 22:50 UTC · original

The counted skip fix passes the full CLI matrix and the cgroup-summary integration.

I reran the original 12 synthetic cases on main 1abef08d0, on 8642cbe54, and with #2967 cb661b0f0 layered in. The two updated trees agree in all 12 cases. A skipped-only trace stays a generic process exit, and a later breakpoint still gives title breakpoint at the same or another location, including cases with a subsequent teardown exception. The separate loader, guest return, timeout, malformed-event, and device-lost cases give their expected classifications. The stock summary suites pass 12 on main, 16 with this PR, and 17 in combination.

I also exercised four of those cases through the actual Linux wrapper using a synthetic Wine process. With both PRs applied, skip-only, later-same, later-other, and device-lost give their expected end labels both in the caller cgroup and in fresh dedicated systemd scopes. The caller reading is explicitly labeled as the caller cgroup’s lifetime peak. Dedicated scope peaks match the actual kernel memory.peak readings, at 101,863,424 to 105,709,568 bytes across four runs. Synthetic traces and child processes only. AI-assisted with OpenAI Codex and independent raw-log verification.

**@⁠merzleckeier** on GitHub · 2026-12-01 22:50 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2968#issuecomment-7328410102) The counted skip fix passes the full CLI matrix and the cgroup-summary integration. I reran the original 12 synthetic cases on main `1abef08d0`, on `8642cbe54`, and with #2967 `cb661b0f0` layered in. The two updated trees agree in all 12 cases. A skipped-only trace stays a generic process exit, and a later breakpoint still gives `title breakpoint` at the same or another location, including cases with a subsequent teardown exception. The separate loader, guest return, timeout, malformed-event, and device-lost cases give their expected classifications. The stock summary suites pass 12 on main, 16 with this PR, and 17 in combination. I also exercised four of those cases through the actual Linux wrapper using a synthetic Wine process. With both PRs applied, skip-only, later-same, later-other, and device-lost give their expected end labels both in the caller cgroup and in fresh dedicated systemd scopes. The caller reading is explicitly labeled as the caller cgroup’s lifetime peak. Dedicated scope peaks match the actual kernel `memory.peak` readings, at 101,863,424 to 105,709,568 bytes across four runs. Synthetic traces and child processes only. AI-assisted with OpenAI Codex and independent raw-log verification.
Author
Owner

@⁠MoonEyes on GitHub · 2026-12-02 00:34 UTC · original

Merging. Head 8642cbe54 merges cleanly with main d741a9f8f and does not force a rebase of #2566. Ran main plus the PR myself, after #2967 landed on the same tool: test_game_run_summary 17 green, 8 failures with tools/game_run_summary.py from main; ci_registration, line endings, stdout encoding and docs suites green. Third-party verdict on this head; all CI green. Merged by MoonEyes.

AI-assisted (Claude Code).

**@⁠MoonEyes** on GitHub · 2026-12-02 00:34 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2968#issuecomment-7330718368) Merging. Head `8642cbe54` merges cleanly with `main` `d741a9f8f` and does not force a rebase of #2566. Ran main plus the PR myself, after #2967 landed on the same tool: test_game_run_summary 17 green, 8 failures with tools/game_run_summary.py from main; ci_registration, line endings, stdout encoding and docs suites green. Third-party verdict on this head; all CI green. Merged by MoonEyes. AI-assisted (Claude Code).
github-bot changed target branch from main to gh-pr/2968/base 2026-12-02 00:46:02 +00:00
github manually merged commit 8642cbe542 into gh-pr/2968/base 2026-12-02 00:46:13 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/ubiquitarianism--leonida!2968
No description provided.