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

Manually merged
github merged 1 commit from github-bot/gh-2810 into gh-pr/2810/base 2026-12-01 06:46:41 +00:00 AGit
Owner

@⁠TheGeogeo on GitHub · 2026-12-01 00:33 UTC · original
TheGeogeo:d3d12-gate-memory-peaks → main · +74 −0 · 3 files · 1 commits · merged 2026-12-01 06:45 UTC

Claimed in the coordination issue as: D3D12-GATE-MEMORY-PEAKS (#2570)

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)
**@⁠TheGeogeo** on GitHub · 2026-12-01 00:33 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2810) `TheGeogeo:d3d12-gate-memory-peaks` → `main` · +74 −0 · 3 files · 1 commits · merged 2026-12-01 06:45 UTC Claimed in the coordination issue as: D3D12-GATE-MEMORY-PEAKS (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/2570) ### 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)
Testers could not use the gate daily without memory figures, and a memory pile-up took a 3090's Windows
down twice. The parser now reads the runtime's memory line and video memory line (every 5 s in builds with
diagnostics) and 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 then, the seconds over that budget, and the most shared memory in use. The video
memory is what the system counts for the process, so it works on any card. The five runtime strings it reads
join the contract test.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 00:38:38 +00:00
Author
Owner

@⁠OreoFR on GitHub · 2026-12-01 00:35 UTC · original

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

**@⁠OreoFR** on GitHub · 2026-12-01 00:35 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2810#issuecomment-7296515821) 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
Author
Owner

@⁠fiestorra on GitHub · 2026-12-01 01:17 UTC · original

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.

**@⁠fiestorra** on GitHub · 2026-12-01 01:17 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2810#issuecomment-7297341509) **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.
github-bot changed target branch from main to gh-pr/2810/base 2026-12-01 06:46:35 +00:00
github manually merged commit f806537a8c into gh-pr/2810/base 2026-12-01 06:46:41 +00:00
Author
Owner

@⁠MoonEyes on GitHub · 2026-12-01 06:44 UTC · original

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

**@⁠MoonEyes** on GitHub · 2026-12-01 06:44 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2810#issuecomment-7303225769) 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).
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/ubiquitarianism--leonida!2810
No description provided.