run-summary.sh --compare: a before/after table of two run logs #314

Manually merged
github merged 2 commits from github-bot/gh-314 into main 2026-11-27 12:02:37 +00:00 AGit
Owner

@⁠m0rff on GitHub · 2026-11-27 11:02 UTC · original
m0rff:m0rff/run-summary-compare → main · +300 −7 · 6 files · 2 commits · merged 2026-11-27 11:54 UTC

Refs #310

tools/macos/run-summary.sh --compare <before.log> <after.log> prints the before/after table that is written by hand on #258.

What it prints

  • One aligned table, metric | before | after | change. The rows:
    • commit and console
    • run length and last frame
    • fps: the median and the last over the 64-frame windows (the median of an even count is the mean of the two middle windows)
    • first world frame
    • first binds and prewarm totals
    • refused shaders: lines, and unique reason+shader pairs
    • GPU errors: Timeout and OutOfMemory always, other kinds when present
    • dropped work by template: largest change first, truncated for display only
    • how the run ended
  • Then "refusals by cause": the counts before and after and the change, with code addresses stripped as in the summary. Largest absolute change first, then by name. new and gone are marked.
  • No colour codes, so the output pastes into a fenced block.

How

  • The existing awk pass gets mode=kv and emits kind<TAB>key<TAB>value rows from its parsed state. --compare joins the rows of the two logs.
  • No second log parser. The plain summary printing is unchanged. The test diffs it against the output of the script before this change, for two synthetic logs, and I checked the self-test fixture the same way.

One change outside the script. A host SIGSEGV and the --seconds limit leave no line in the log. run-native.sh printed the exit code only to the terminal. It now appends # exit code N to the log. The timer writes # stopped by --seconds itself, and only when its sleep finished, so a game that exits on its own never gets the marker. I checked this by hand with a stub binary: exit 139 gave only the exit code line, sleeping past --seconds 2 gave the marker and 143, and exit 0 gave only the exit code line. The table reads these as:

  • SIGSEGV (139)
  • time limit
  • fault at <address> (from the unhandled exception line)
  • watchdog/kill line
  • unknown (no exit line) for older logs

Not included: G-buffer coverage (target dumped ... lit=). That can be a follow-up row if wanted. "first world frame" is only logged with VICTORY_CAPTURE_WORLD set. Otherwise the row shows -.

Tests

  • tools/macos/tests/run-summary-compare.sh uses two synthetic logs that differ in refusals, fps, dropped work, GPU errors and ending, and one ends past midnight.
  • It asserts the key rows and changes, the cause order and the new/gone markers, no escape bytes in the output, the SIGSEGV ending, and that the plain summary is unchanged.
  • It is added to the macos-scripts job.

Local runs, all passing:

  • /bin/bash tools/macos/tests/run-summary-compare.sh
  • /bin/bash tools/macos/run-summary.sh --self-test
  • /bin/bash tools/macos/tests/target-directory.sh (Bash 3.2.57)
  • cargo xtask policy
**@⁠m0rff** on GitHub · 2026-11-27 11:02 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/314) `m0rff:m0rff/run-summary-compare` → `main` · +300 −7 · 6 files · 2 commits · merged 2026-11-27 11:54 UTC Refs #310 `tools/macos/run-summary.sh --compare <before.log> <after.log>` prints the before/after table that is written by hand on #258. **What it prints** - One aligned table, metric | before | after | change. The rows: - commit and console - run length and last frame - fps: the median and the last over the 64-frame windows (the median of an even count is the mean of the two middle windows) - first world frame - first binds and prewarm totals - refused shaders: lines, and unique reason+shader pairs - GPU errors: Timeout and OutOfMemory always, other kinds when present - dropped work by template: largest change first, truncated for display only - how the run ended - Then "refusals by cause": the counts before and after and the change, with code addresses stripped as in the summary. Largest absolute change first, then by name. `new` and `gone` are marked. - No colour codes, so the output pastes into a fenced block. **How** - The existing awk pass gets `mode=kv` and emits `kind<TAB>key<TAB>value` rows from its parsed state. `--compare` joins the rows of the two logs. - No second log parser. The plain summary printing is unchanged. The test diffs it against the output of the script before this change, for two synthetic logs, and I checked the self-test fixture the same way. **One change outside the script.** A host SIGSEGV and the `--seconds` limit leave no line in the log. run-native.sh printed the exit code only to the terminal. It now appends `# exit code N` to the log. The timer writes `# stopped by --seconds` itself, and only when its sleep finished, so a game that exits on its own never gets the marker. I checked this by hand with a stub binary: exit 139 gave only the exit code line, sleeping past `--seconds 2` gave the marker and 143, and exit 0 gave only the exit code line. The table reads these as: - `SIGSEGV` (139) - `time limit` - `fault at <address>` (from the unhandled exception line) - `watchdog/kill line` - `unknown (no exit line)` for older logs **Not included:** G-buffer coverage (`target dumped ... lit=`). That can be a follow-up row if wanted. "first world frame" is only logged with `VICTORY_CAPTURE_WORLD` set. Otherwise the row shows `-`. **Tests** - `tools/macos/tests/run-summary-compare.sh` uses two synthetic logs that differ in refusals, fps, dropped work, GPU errors and ending, and one ends past midnight. - It asserts the key rows and changes, the cause order and the new/gone markers, no escape bytes in the output, the SIGSEGV ending, and that the plain summary is unchanged. - It is added to the macos-scripts job. Local runs, all passing: - `/bin/bash tools/macos/tests/run-summary-compare.sh` - `/bin/bash tools/macos/run-summary.sh --self-test` - `/bin/bash tools/macos/tests/target-directory.sh` (Bash 3.2.57) - `cargo xtask policy`
The awk pass that reads a log now also emits key/value rows (mode=kv).
--compare joins the rows of two logs into one table: metric, before,
after and change. Refusals are listed by cause, largest change first,
with new and gone causes marked. The plain summary output is unchanged.
The test checks that against the old script's output for two synthetic
logs.

run-native.sh appends '# exit code N', and '# stopped by --seconds'
when the timer stopped the game. Without these lines, a host SIGSEGV
and the time limit look the same in the log.

Refs #310
Writing it after the wait raced the timer: a run the limit stopped could
miss the marker, and a game that exited by itself could get one. The
marker is now written only when the sleep completes. The SIGSEGV text
match is gone: nothing logs it, so the exit code is the only signal.

Refs #310
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 11:05:33 +00:00
github manually merged commit 92e0cd5b86 into main 2026-11-27 12:02:37 +00:00
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-27 11:54 UTC · original

Thank you. The table is what I write by hand on #258 today, and the exit lines tell a crash from the time limit.

Merged, together with #312. Both added a line at the same place in .github/workflows/ci.yml and in the run-game skill; I kept both.

**@⁠LakshanSivakumar** on GitHub · 2026-11-27 11:54 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/314#issuecomment-7217619806) Thank you. The table is what I write by hand on #258 today, and the exit lines tell a crash from the time limit. Merged, together with #312. Both added a line at the same place in `.github/workflows/ci.yml` and in the run-game skill; I kept both.
This discussion has been locked. Commenting is limited to contributors.
No description provided.