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

Merged
m0rff merged 2 commits from upstream-pr/314 into main 2026-11-27 11:54:01 +00:00
m0rff commented 2026-11-27 11:02:04 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-27T11:02:04Z.


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
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5525519742 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/314). Originally posted by [m0rff](https://github.com/m0rff) on 2026-11-27T11:02:04Z. --- 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`
LakshanSivakumar commented 2026-11-27 11:54:50 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T11:54:50Z.


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.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7217619806 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/314#issuecomment-7217619806). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T11:54:50Z. --- 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.
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
LakshanSivakumar/Native-Victory-macOS!314
No description provided.