game-gate: the frame's walls in summary.json and walls.csv #3507

Code

Clone this repository

Checkout

From your project repository, check out a new branch and test the changes.

git fetch -u  "gate-frame-walls:Otavmacedo-gate-frame-walls"
git switch "Otavmacedo-gate-frame-walls"
Open
leonida/mandy
Otavmacedo wants to merge 1 commit from Otavmacedo/mandy:gate-frame-walls into main

This branch is out-of-date with the base branch

Conversation
Reviewers 0 approvals
  • No reviewers
Details
This pull request is blocked because it's outdated.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'gate-frame-walls:Otavmacedo-gate-frame-walls'
git switch 'Otavmacedo-gate-frame-walls'
First-time contributor

Claimed in the coordination issue as: GAME-GATE-FRAME-WALLS (https://git.leonida.now/leonida/mandy/issues/3312#issuecomment-26715)

Depends on: none. It conflicts with #3424 in two small places (below).

What and why

A gate run's summary.json says how fast the frames came, not which wall held them. docs/measuring_fps.md §4 says the frame stands at the longest of its walls (the card, the submitting thread, the title), and the runtime already writes, every second, the line that tells which. No tool reads it, and the gate's FRAME drops the frame line's split too.

On an RTX 3070 8 GB, my A/B sets of video-memory changes (#3466, #3035, #3496) moved the gate's memory numbers but not its frame time. Only reading these lines by hand showed why: the submitting thread works about 95 % of each frame and hardly ever waits for the card (median 0 ms), which sits idle behind it about a quarter of the frame. A change that takes work off the card cannot show there. With this pull request the summary says so at once.

tools/game_gate.py now reads:

  • the card's clock per frame (host.rs, card_clock_line, every second, in every build): the card's idle time, of it the time behind the submitting thread and the time the title had not submitted, and the submitting thread's wait for the card;
  • that thread worked (queue/behind.rs, every second, with LEONIDA_ASYNC_SUBMIT=1 or LEONIDA_THIN=1): the submitting thread's work and the title's wait at presents;
  • the frame line's preparing / on the GPU / copying back (host.rs, every fifth second, that second's).

They go into:

  • summary.json, a new walls block. It holds medians over the basis of fps (world+60 s to the stop request) and seconds, how many clock lines each wall held. A second is the card's when the card was 90 % busy or more (the runtime's rounded %). Below that it goes to whoever the card stood idle behind longer: the submitting thread or the title (a tie goes to the submitting thread). wall names the one with the most seconds.
  • walls.csv, one row per clock line, beside memory.csv. Its writer and memory.csv's are now one function (write_sidecar), with the same behaviour and messages.

The four runtime strings, and the call that writes the clock line every second, are in SOURCES, so the contract test fails if one is reworded or the call is moved. The change is additive: no existing field changes. It touches the same files as #3424 and #3419. It merges cleanly with #3419. With #3424 it overlaps in two places in tools/game_gate.py: the frame line in Run's log loop (#3424's self.record) and the write_series/summary.json lines of main(). Whichever lands second needs a small rebase, and after it the three new lists should go through self.record too. The --archive ZIP is left as it is; walls.csv could join it later.

On one of my RTX 3070 runs (prison save, -SeriesS -Dlss quality -NoFrameGen, standing, 600 s), walls reads:

"wall": "submit", "seconds": {"card": 8, "submit": 449, "title": 70},
"card_idle_ms": 11.0, "card_busy_pct": 74.0, "card_idle_behind_submit_ms": 10.3, "card_idle_for_title_ms": 0.8,
"submit_stood_for_card_ms": 0.0, "submit_worked_ms": 41.7, "title_at_presents_ms": 12.3,
"preparing_ms": 33.0, "gpu_wait_ms": 0.0, "copying_back_ms": 12.1

Tested

  • python -m unittest discover -s tests -p "test_game_gate*.py": 54 tests, OK.
  • python -I scripts/red_green.py gate-frame-walls --no-cargo: verdict red then green. The 7 new Walls tests fail on main plus the tests and pass with the change, and 44 pass on both.
  • New Walls tests: the submitting thread's run, a busy card and a late title, the per-second rule and its edges, a run without clock lines (and an old walls.csv removed), no world, clock lines with no world still naming the series, and a frame line without the split. All log lines are synthetic, in the runtime's formats. The contract test checks the five new SOURCES entries against the runtime's source.
  • python -m unittest discover -s tests -p "test_docs_*.py": 59 tests, OK.
  • python -I scripts/check_no_game_data.py on the four files: clean; git diff --check clean.
  • Real logs: the parser on the eight measured runs of one ABBA set on the RTX 3070, through game_gate.Run/summary without writing into the run folders: all eight read "wall": "submit" (353-468 of 480-530 seconds each), with every clock line paired with the submitting thread's line except one line in each of two runs.

GPUs tested: NVIDIA GeForce RTX 3070 8 GB, driver 621.47, Windows 11 (existing gate logs read by the parser; no new game run for this change).

AI-assisted: yes. Claude Code (Claude Opus 5.5) wrote the change; a separate read-only Claude Opus 5.5 reviewer agent audited the diff. Its two should-fix findings (pairing in O(n²), series named only with lines in the window) and most of its nits are applied.

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code

Claimed in the coordination issue as: GAME-GATE-FRAME-WALLS (https://git.leonida.now/leonida/mandy/issues/3312#issuecomment-26715) Depends on: none. It conflicts with #3424 in two small places (below). ### What and why A gate run's `summary.json` says how fast the frames came, not which wall held them. `docs/measuring_fps.md` §4 says the frame stands at the longest of its walls (the card, the submitting thread, the title), and the runtime already writes, every second, the line that tells which. No tool reads it, and the gate's `FRAME` drops the frame line's split too. On an RTX 3070 8 GB, my A/B sets of video-memory changes (#3466, #3035, #3496) moved the gate's memory numbers but not its frame time. Only reading these lines by hand showed why: the submitting thread works about 95 % of each frame and hardly ever waits for the card (median 0 ms), which sits idle behind it about a quarter of the frame. A change that takes work off the card cannot show there. With this pull request the summary says so at once. `tools/game_gate.py` now reads: - `the card's clock per frame` (`host.rs`, `card_clock_line`, every second, in every build): the card's idle time, of it the time behind the submitting thread and the time the title had not submitted, and the submitting thread's wait for the card; - `that thread worked` (`queue/behind.rs`, every second, with `LEONIDA_ASYNC_SUBMIT=1` or `LEONIDA_THIN=1`): the submitting thread's work and the title's wait at presents; - the frame line's `preparing` / `on the GPU` / `copying back` (`host.rs`, every fifth second, that second's). They go into: - **`summary.json`, a new `walls` block.** It holds medians over the basis of `fps` (world+60 s to the stop request) and `seconds`, how many clock lines each wall held. A second is the card's when the card was 90 % busy or more (the runtime's rounded %). Below that it goes to whoever the card stood idle behind longer: the submitting thread or the title (a tie goes to the submitting thread). `wall` names the one with the most seconds. - **`walls.csv`**, one row per clock line, beside `memory.csv`. Its writer and `memory.csv`'s are now one function (`write_sidecar`), with the same behaviour and messages. The four runtime strings, and the call that writes the clock line every second, are in `SOURCES`, so the contract test fails if one is reworded or the call is moved. The change is additive: no existing field changes. It touches the same files as #3424 and #3419. It merges cleanly with #3419. With #3424 it overlaps in two places in `tools/game_gate.py`: the frame line in `Run`'s log loop (#3424's `self.record`) and the `write_series`/`summary.json` lines of `main()`. Whichever lands second needs a small rebase, and after it the three new lists should go through `self.record` too. The `--archive` ZIP is left as it is; `walls.csv` could join it later. On one of my RTX 3070 runs (prison save, `-SeriesS -Dlss quality -NoFrameGen`, standing, 600 s), `walls` reads: ``` "wall": "submit", "seconds": {"card": 8, "submit": 449, "title": 70}, "card_idle_ms": 11.0, "card_busy_pct": 74.0, "card_idle_behind_submit_ms": 10.3, "card_idle_for_title_ms": 0.8, "submit_stood_for_card_ms": 0.0, "submit_worked_ms": 41.7, "title_at_presents_ms": 12.3, "preparing_ms": 33.0, "gpu_wait_ms": 0.0, "copying_back_ms": 12.1 ``` ### Tested - `python -m unittest discover -s tests -p "test_game_gate*.py"`: 54 tests, OK. - `python -I scripts/red_green.py gate-frame-walls --no-cargo`: verdict `red then green`. The 7 new `Walls` tests fail on `main` plus the tests and pass with the change, and 44 pass on both. - New `Walls` tests: the submitting thread's run, a busy card and a late title, the per-second rule and its edges, a run without clock lines (and an old `walls.csv` removed), no world, clock lines with no world still naming the series, and a frame line without the split. All log lines are synthetic, in the runtime's formats. The contract test checks the five new `SOURCES` entries against the runtime's source. - `python -m unittest discover -s tests -p "test_docs_*.py"`: 59 tests, OK. - `python -I scripts/check_no_game_data.py` on the four files: clean; `git diff --check` clean. - Real logs: the parser on the eight measured runs of one ABBA set on the RTX 3070, through `game_gate.Run`/`summary` without writing into the run folders: all eight read `"wall": "submit"` (353-468 of 480-530 seconds each), with every clock line paired with the submitting thread's line except one line in each of two runs. GPUs tested: NVIDIA GeForce RTX 3070 8 GB, driver 621.47, Windows 11 (existing gate logs read by the parser; no new game run for this change). AI-assisted: yes. Claude Code (Claude Opus 5.5) wrote the change; a separate read-only Claude Opus 5.5 reviewer agent audited the diff. Its two should-fix findings (pairing in O(n²), `series` named only with lines in the window) and most of its nits are applied. ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Read the runtime's card's clock line (host.rs card_clock_line, every
second), the submitting thread's work line (queue/behind.rs, with
LEONIDA_ASYNC_SUBMIT=1 or LEONIDA_THIN=1) and the frame line's split of
the submitting thread's time into a `walls` block: medians over the basis
of `fps`, and the seconds each wall held (card, submitting thread, title;
docs/measuring_fps.md section 4). One row per clock line in walls.csv,
written by a sidecar writer memory.csv now shares. Additive: no existing
field changes.

Claimed as GAME-GATE-FRAME-WALLS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
First-time contributor

Independent local verification of this change (I changed no code).

  • Head 5d2b2e4d, merge base f4b0404e. The new tests are absent on the base: git grep -F test_the_wall_of_a_second f4b0404e -- tests/test_game_gate.py -> exit 1 (same for the other six new cases).
  • On the PR head: python -I -m unittest discover -s tests -p test_game_gate.py -> Ran 51 tests in 15.2 s, OK. The 2 skips are Script.test_a_poll_stops_for_the_target_before_the_memory_stop and Script.test_the_dlss_preflight_follows_the_switch_powershell_binds, both skipped with no PowerShell 7 here and neither among the new cases. Synthetic log fixtures only; no game run and no card.
  • git diff --check f4b0404e 5d2b2e4d -> clean. python -I scripts/check_no_game_data.py on tools/game_gate.py, tests/test_game_gate.py, docs/game_gate.md and docs/measuring_fps.md -> clean.

GPUs tested: none (pure Python log parsing on synthetic inputs). Driver: n/a. No game data, assets or extracted shaders were used or attached.

AI-assisted: yes, Hy4 flash (verification only). No approval implied; this is a local test report.

Independent local verification of this change (I changed no code). - Head `5d2b2e4d`, merge base `f4b0404e`. The new tests are absent on the base: `git grep -F test_the_wall_of_a_second f4b0404e -- tests/test_game_gate.py` -> exit 1 (same for the other six new cases). - On the PR head: `python -I -m unittest discover -s tests -p test_game_gate.py` -> Ran 51 tests in 15.2 s, OK. The 2 skips are `Script.test_a_poll_stops_for_the_target_before_the_memory_stop` and `Script.test_the_dlss_preflight_follows_the_switch_powershell_binds`, both skipped with `no PowerShell 7 here` and neither among the new cases. Synthetic log fixtures only; no game run and no card. - `git diff --check f4b0404e 5d2b2e4d` -> clean. `python -I scripts/check_no_game_data.py` on tools/game_gate.py, tests/test_game_gate.py, docs/game_gate.md and docs/measuring_fps.md -> clean. GPUs tested: none (pure Python log parsing on synthetic inputs). Driver: n/a. No game data, assets or extracted shaders were used or attached. AI-assisted: yes, Hy4 flash (verification only). No approval implied; this is a local test report.
Sign in to join this conversation.
No description provided.