gate: summary.json gets the run's memory peaks (D3D12-GATE-MEMORY-PEAKS) #2810

Merged
TheGeogeo merged 1 commit from upstream-pr/2810 into main 2026-12-01 06:45:00 +00:00
TheGeogeo commented 2026-12-01 00:33:04 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-12-01T00:33:04Z.


Claimed in the coordination issue as: D3D12-GATE-MEMORY-PEAKS (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7296394544)

What and why

Testers asked for memory figures in the gate's summary.json (#2782): without them they cannot use the gate daily. A memory pile-up has also taken a 3090's Windows down twice. This is the first of three PRs: the peaks here, then a safety stop, then a time series.

tools/game_gate.py now reads two lines the runtime already writes every 5 s in builds with diagnostics (the gate's builds):

  • the memory line (memory: N MB private (...; the PC has ... MB free and ... MB left to commit));
  • the video memory line (video memory as the system counts it, ...: the card's own: budget ... MB, in use ... MB, ...). This is DXGI's count for the process, so it works on any card.

From them it writes a memory block:

  • the private bytes at their most, and when;
  • the most of them in physical memory;
  • the least the PC had left to commit, and when;
  • the card's video memory in use at its most, and when, with the budget the system gave then;
  • the seconds spent over that budget;
  • the most of the PC's memory shared with the card in use.

A build without diagnostics gives source: null and no peaks. The five runtime strings it reads join the contract test, so a reworded line fails the test. docs/game_gate.md describes the block.

Tested

On Windows 11 Pro 10.0:

  • tests/test_game_gate.py: 23 tests OK. The two new ones (peaks and times from synthetic lines, including time over budget; no lines gives nulls) fail with main's game_gate.py.

  • The contract test finds the new strings in copystat.rs and host.rs.

  • The docs tests and scripts/check_no_game_data.py on the changed files are clean.

  • On a real run: I re-summarized a copy of a 124 s gate run from this week's ABBA validation (RTX 3080 10 GB, driver 32.0.16.2140, Series S profile). The block read 37 memory lines:

    • private 24,222 MB at most;
    • video memory 6,806 MB in use at most, against a budget of 8,835 MB, never over it;
    • shared memory 7,102 MB in use at most;
    • the PC had 267 MB left to commit at its lowest.

    A separate sampler on that run saw private bytes of 23 to 24 GB. nvidia-smi showed 7.4 to 7.8 GB, because it counts the whole card.

GPUs tested: NVIDIA GeForce RTX 3080 10 GB, driver 32.0.16.2140

AI-assisted: yes

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)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5576423483 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2810). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-12-01T00:33:04Z. --- Claimed in the coordination issue as: D3D12-GATE-MEMORY-PEAKS (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7296394544) ### What and why Testers asked for memory figures in the gate's `summary.json` (#2782): without them they cannot use the gate daily. A memory pile-up has also taken a 3090's Windows down twice. This is the first of three PRs: the peaks here, then a safety stop, then a time series. `tools/game_gate.py` now reads two lines the runtime already writes every 5 s in builds with diagnostics (the gate's builds): - the memory line (`memory: N MB private (...; the PC has ... MB free and ... MB left to commit)`); - the video memory line (`video memory as the system counts it, ...: the card's own: budget ... MB, in use ... MB, ...`). This is DXGI's count for the process, so it works on any card. From them it writes a `memory` block: - the private bytes at their most, and when; - the most of them in physical memory; - the least the PC had left to commit, and when; - the card's video memory in use at its most, and when, with the budget the system gave then; - the seconds spent over that budget; - the most of the PC's memory shared with the card in use. A build without diagnostics gives `source: null` and no peaks. The five runtime strings it reads join the contract test, so a reworded line fails the test. `docs/game_gate.md` describes the block. ### Tested On Windows 11 Pro 10.0: - `tests/test_game_gate.py`: 23 tests OK. The two new ones (peaks and times from synthetic lines, including time over budget; no lines gives nulls) fail with `main`'s `game_gate.py`. - The contract test finds the new strings in `copystat.rs` and `host.rs`. - The docs tests and `scripts/check_no_game_data.py` on the changed files are clean. - On a real run: I re-summarized a copy of a 124 s gate run from this week's ABBA validation (RTX 3080 10 GB, driver 32.0.16.2140, Series S profile). The block read 37 memory lines: - private 24,222 MB at most; - video memory 6,806 MB in use at most, against a budget of 8,835 MB, never over it; - shared memory 7,102 MB in use at most; - the PC had 267 MB left to commit at its lowest. A separate sampler on that run saw private bytes of 23 to 24 GB. `nvidia-smi` showed 7.4 to 7.8 GB, because it counts the whole card. GPUs tested: NVIDIA GeForce RTX 3080 10 GB, driver 32.0.16.2140 AI-assisted: yes ### 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)
OreoFR commented 2026-12-01 00:35:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-01T00:35:53Z.


Verified by OreoFR on macOS 27.2.1, Apple M5, Python 3.12, head f806537a8, main b7a1be296. CPU only, no game.

MEASURED

  • Red (main + only this PR's tests/test_game_gate.py): 2 failed, 21 passed. The failures are the two new tests, test_memory_peaks_come_from_the_runtimes_memory_lines and test_a_build_without_memory_lines_gives_no_memory_peaks.
  • Green (main + this PR, merge-tree): 23 passed.

READ IN CODE

  • The phrases the parser reads exist on main where SOURCES says they are:
    • memory: … MB private (… MB of it in memory; the PC has … MB free and … MB left to commit); host copies… at leonida-gpu/src/copystat.rs:860-861;
    • h.log_video_memory("with the memory line") at copystat.rs:752;
    • video memory as the system counts it, …: the card's own: budget … MB, in use … MB at host.rs:13641.
      The contract test that passes on green covers the rest.
  • memory_block() returns all-None with source: None when a run has no memory lines (a build without diagnostics). That is the second new test.
  • vram_over_budget_s adds up each video line's interval to the next one while in-use is above budget. The last line has no successor, so time over budget after the final line isn't counted. That's at most one 5 s step, and it's fine for a peak summary; just worth knowing when reading short runs.

ASSUMED

  • The real 124 s run figures (24.2 GB private, 6.8 / 8.8 GB VRAM) are from your RTX 3080. Not reproduced here.

AI-assisted: Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7296515821 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2810#issuecomment-7296515821). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-12-01T00:35:53Z. --- Verified by OreoFR on macOS 27.2.1, Apple M5, Python 3.12, head `f806537a8`, main `b7a1be296`. CPU only, no game. **MEASURED** - Red (main + only this PR's `tests/test_game_gate.py`): 2 failed, 21 passed. The failures are the two new tests, `test_memory_peaks_come_from_the_runtimes_memory_lines` and `test_a_build_without_memory_lines_gives_no_memory_peaks`. - Green (main + this PR, merge-tree): 23 passed. **READ IN CODE** - The phrases the parser reads exist on main where `SOURCES` says they are: - `memory: … MB private (… MB of it in memory; the PC has … MB free and … MB left to commit); host copies…` at `leonida-gpu/src/copystat.rs:860-861`; - `h.log_video_memory("with the memory line")` at `copystat.rs:752`; - `video memory as the system counts it, …: the card's own: budget … MB, in use … MB` at `host.rs:13641`. The contract test that passes on green covers the rest. - `memory_block()` returns all-`None` with `source: None` when a run has no memory lines (a build without diagnostics). That is the second new test. - `vram_over_budget_s` adds up each video line's interval to the next one while in-use is above budget. The last line has no successor, so time over budget after the final line isn't counted. That's at most one 5 s step, and it's fine for a peak summary; just worth knowing when reading short runs. **ASSUMED** - The real 124 s run figures (24.2 GB private, 6.8 / 8.8 GB VRAM) are from your RTX 3080. Not reproduced here. AI-assisted: Claude Code
fiestorra commented 2026-12-01 01:17:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-01T01:17:59Z.


Verified on Windows, with the control that matters: the tests fail when the change is reverted.

Cherry-picked onto main d920d850d in a clean worktree, Python 3.13.14:

python -m pytest tests/test_game_gate.py -q with this pull request: 23 passed with tools/game_gate.py from main: 2 failed

So the new tests are tied to the change and not to each other's fixtures. No part of this needed a GPU, a display or game data, which is what the gate tests are built for.

What I could not test: the script against a real run folder - game-abba.ps1 drives one, and this machine has the game but not the gate harness the other contributors used, so the shape is proven and the run is not.

AI-assisted: yes - DeepSeek v4.1 (flash), applied and ran both arms on the machine above.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7297341509 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2810#issuecomment-7297341509). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-01T01:17:59Z. --- **Verified on Windows, with the control that matters: the tests fail when the change is reverted.** **Cherry-picked onto `main` `d920d850d` in a clean worktree, Python 3.13.14:** ` python -m pytest tests/test_game_gate.py -q with this pull request: 23 passed with tools/game_gate.py from main: 2 failed ` **So the new tests are tied to the change and not to each other's fixtures.** **No part of this needed a GPU, a display or game data, which is what the gate tests are built for.** **What I could not test:** **the script against a real run folder** - `game-abba.ps1` drives one, **and this machine has the game but not the gate harness the other contributors used**, so the shape is proven and the run is not. **AI-assisted:** yes - DeepSeek v4.1 (flash), applied and ran both arms on the machine above. Written with an AI assistant.
MoonEyes commented 2026-12-01 06:44:57 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-01T06:44:57Z.


Merging. Head f806537a8 merges cleanly with main aefb25084 and does not force a rebase of #2566. CI green on this head. Red/green by OreoFR (macOS) and fiestorra (Windows) on it; I ran it on main + PR (Windows, Python 3.14): 23 tests OK, the two new ones error without the change, docs tests OK. A parser of the runtime's own memory lines: nothing in the game changes, no in-game run needed. Merged by MoonEyes.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7303225769 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2810#issuecomment-7303225769). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-01T06:44:57Z. --- Merging. Head `f806537a8` merges cleanly with `main` `aefb25084` and does not force a rebase of #2566. CI green on this head. Red/green by OreoFR (macOS) and fiestorra (Windows) on it; I ran it on main + PR (Windows, Python 3.14): 23 tests OK, the two new ones error without the change, docs tests OK. A parser of the runtime's own memory lines: nothing in the game changes, no in-game run needed. Merged by MoonEyes. AI-assisted (Claude Code).
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
ProjectLeonida/mandy!2810
No description provided.