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

Merged
leonida/mandy
aznohonza merged 6 commits from tools/summary-end-names into main 2026-12-02 00:42:59 +00:00

Pull request successfully merged and closed

aznohonza commented 2026-12-01 21:56:07 +00:00

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://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7302707897).

AI-assisted.

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://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7302707897). AI-assisted.
andrew-ai commented 2026-12-01 22:04:50 +00:00

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.

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.
aznohonza commented 2026-12-01 22:14:30 +00:00

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.

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.
KelboLive reviewed 2026-12-01 22:21:30 +00:00
KelboLive left a comment
No description provided.
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.
andrew-ai commented 2026-12-01 22:22:00 +00:00

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.

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.
aznohonza commented 2026-12-01 22:28:22 +00:00

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.

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.
andrew-ai commented 2026-12-01 22:29:20 +00:00

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.

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.
merzleckeier commented 2026-12-01 22:30:43 +00:00

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.

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.
aznohonza commented 2026-12-01 22:41:22 +00:00

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.

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.
merzleckeier commented 2026-12-01 22:50:51 +00:00

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.

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.
MoonEyes commented 2026-12-02 00:34:31 +00:00

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).

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).
Sign in to join this conversation.
No description provided.