game_run_summary: record the run cgroup's memory peak #2845
Closed
github-bot
wants to merge 0 commits from
github-bot/gh-2845 into main
AGit
pull from: github-bot/gh-2845
merge into: github:main
github:main
github:perf/darner-title-priority-ceiling
github:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
github:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
github:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
github:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
github:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
github:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
github:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
github:fix/runtime-test-conservative-fixtures
github:ci/shard-semantic-linux
github:docs/fg-limit-fps-switch
github:fix/runtime-test-fixture-paths
github:fix/runtime-test-fixture-readers
github:fix/read-file-hard-link
github:fix/book-slot-heap-never-read
github:fix/depth-resolve-spv-path
github:fix/indirect-unused-batched
github:gh-pr/3358/base
github:fix/xmem-refusal-diagnostics
github:gh-pr/3357/base
github:ci/shorten-ci-time
github:fix/alias-later-queued-submissions
github:claude/gallant-sagan-aamatr
github:gh-pr/3342/base
github:gh-pr/3341/base
github:d3d12/agility-sdk-621
github:gh-pr/3293/base
github:gh-pr/3319/base
github:gh-pr/3318/base
github:gh-pr/3315/base
github:gh-pr/3313/base
github:gh-pr/3314/base
github:claude/fervent-curie-m19lnr
github:gh-pr/3216/base
github:gh-pr/3272/base
github:gh-pr/3276/base
github:gh-pr/3279/base
github:gh-pr/3257/base
github:gh-pr/3258/base
github:gh-pr/3271/base
github:codex/skip-no-hit-ray-passes
github:gh-pr/3230/base
github:gh-pr/3266/base
github:gh-pr/3247/base
github:gh-pr/3246/base
github:gh-pr/3244/base
github:claude/sharp-sagan-1jqnp3
github:t3/preserve-fsr-sdk-restart-path
github:t3/propagate-host-failure-hresult
github:t3/launcher-custom-parameters
github:t3/series-x-2160-startup
github:codex/d3d12-uncapped-simulation
github:ci/less-to-run
github:perf/native-compute-shader-forms
github:claude/blissful-franklin-ukp7ag
github:codex/full-precompile-default
github:gh-pr/3166/base
github:gh-pr/3148/base
github:gh-pr/3138/base
github:gh-pr/3106/base
github:gh-pr/3057/base
github:gh-pr/2756/base
github:gh-pr/2812/base
github:gh-pr/3032/base
github:gh-pr/2992/base
github:notes/card-time-and-plant-flicker
github:gh-pr/2986/base
github:gh-pr/3000/base
github:gh-pr/2966/base
github:gh-pr/2924/base
github:gh-pr/726/base
github:gh-pr/2761/base
github:gh-pr/2663/base
github:gh-pr/2861/base
github:gh-pr/2862/base
github:gh-pr/2820/base
github:gh-pr/2811/base
github:gh-pr/2803/base
github:rt-call-trace
github:gh-pr/2802/base
github:gh-pr/2766/base
github:perf/ahead-split
github:gh-pr/2589/base
github:gh-pr/2699/base
github:gh-pr/2696/base
github:docs/readme-runtime-proposal
github:gh-pr/1346/base
github:codex/coord-claim-check-20261124-7e48
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
area: ci
.github/ workflows and settings
area: d3d12
The D3D12 runtime in d3d12/ (Rust: leonida.exe and its crates)
area: docs
Documentation
area: launcher
The launcher (launcher/)
area: runtime (legacy)
The earlier Vulkan runtime in runtime/
area: shader translator
The shader translator (leonida-shader, tools/rdna2spirv) and its tests
area: tools
tools/ and scripts/
area: viewer
The map viewer (viewer/)
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
missing claim
Needs a claim in #14
needs in-game run
Changes the code a frame runs through: needs the 300 s in-game gate (docs/game_gate.md)
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
wontfix
This will not be worked on
No labels
accessibility
area: ci
area: d3d12
area: docs
area: launcher
area: runtime (legacy)
area: shader translator
area: tools
area: viewer
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs in-game run
needs rebase
needs-triage
question
ready-for-agent
submodules
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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!2845
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2845"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@aznohonza on GitHub · 2026-12-01 07:26 UTC · original
aznohonza:tools/cgroup-memory-peak→main· +60 −8 · 5 files · 4 commits · closed without mergingClaimed in the coordination issue as: WINE-RUN-MEMORY-PEAK
What and why
scripts/run_game_wine.shruns the title in a cgroup of its own when it is started in a systemd scope, and that scope usually also carriesMemoryMax(e.g.systemd-run --user --scope -p MemoryMax=24G), but the run folder and the summary said nothing about how close the run came to that limit. The wrapper now reads the cgroup'smemory.peakonce the session has ended and writes it to<out>/memory_peak(bytes), andtools/game_run_summary.pyprintscgroup memory peak: 23.6 GiBafter the run time.docs/linux_proton.mdsays so.LEONIDA_SELF_CGROUP_PATH,LEONIDA_CGROUP_ROOT) use the names and defaults ofscripts/linux-boot/boot-inner.sh; they are also what the tests point at a fake proc file and cgroup tree.Open #2436 touches the same wrapper, so one of the two may need a rebase (a textual conflict in the environment block); this change adds no option.
Tested
CPU only, no game files, no Wine, no GPU:
python -I tests/test_game_run_summary.py— 13 tests pass, one new: 25,316,786,176 bytes prints ascgroup memory peak: 23.6 GiB, and a folder withoutmemory_peakgets no line.python -I tests/test_run_game_wine.py— 11 tests pass, two new: a stubbed run with a fake/proc/self/cgroupandmemory.peakwritesmemory_peakand prints the line; a cgroup-v1 proc file leaves both out.python -I tests/test_run_game_wine_safety.py— 3 tests pass.python -m compileall -qon the changed Python files,scripts/check_no_game_data.pyon all changed files, and the docs-only checks (tests/test_docs_*.py,tests/test_i18n_index.py,tests/test_design_contract_rows.py).GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)b00296ff30tod9c470cd30@ecox982745 on GitHub · 2026-12-01 08:22 UTC · original
Independent Windows compatibility check with #2844. I combined
4edb90521(#2844) andd9c470cd3(#2845) with maincd73ddab7. Both changes merged without conflicts into treefd4ea35ce.memory.peak, it left the output absent and propagated the stub summary's exit code. Wine and session tooling were stubs.CPU only. This exercises the parser and the wrapper's file handling. Live Linux cgroup sampling is outside this check.
AI-assisted with OpenAI Codex (GPT-6.2 Sol).
@aznohonza on GitHub · 2026-12-01 08:36 UTC · original
Thanks — that matches what can be checked off Linux: on this box
/proc/self/cgroupresolves to the shell's scope, which hasmemory.peak(20546236416 bytes), so the path and the parser agree. A real title run under aMemoryMaxscope was not made.AI-assisted.
@aznohonza on GitHub · 2026-12-01 11:56 UTC · original
Merged current
main(8497337b4) into the branch: #2436 landed meanwhile and also editstests/test_run_game_wine.py. The conflict was only the helper signature — kept #2436'srun_script(..., **extra)and pass the two cgroup overrides as keyword environment variables, as its cache tests do. The code diff againstmainis otherwise unchanged.Re-run after the merge: 13 summary tests, 16 launcher tests (the 5 new #2436 ones included), 3 safety tests, the docs tests and
check_no_game_data.pyall pass. AI-assisted.@aznohonza on GitHub · 2026-12-01 12:11 UTC · original
The
linux-python-and-viewerred is not from this branch:tests/test_chain_check.pyfails on its own here too, and the fragment it pins was changed onmainby7acf84d38("...compute pipeline %s took %.1f s to obtain from %s..." atruntime/shims/d3d12_vulkan_device.cpp:17843), while the test still expects "...to build" (tests/test_chain_check.py:294). Nothing in this PR touchesruntime/ortests/test_chain_check.py; its own three suites (13 summary, 16 launcher, 3 safety) pass on the merged tree, as do the docs tests. The other jobs of this run are green (windows, linux-gpu-tools, semantic-tests).No action from this branch; a one-line update to the test on
mainclears it. AI-assisted.@aznohonza on GitHub · 2026-12-01 12:23 UTC · original
mainnow carries the fix for the stale fragment (#2870), so I merged it in:tests/test_chain_check.pypasses here, as do the three suites and the docs tests. CI is re-running on8a72e40d8. AI-assisted.@aegish-zagi on GitHub · 2026-12-01 14:34 UTC · original
Verification — VERIFY-2845
Verdict: PASS
8a72e40d8793085f31b284c6026ea421ad2f42a4| merge state vs main: clean merge with current maincd0c52fcfin a scratch worktree (docs/linux_proton.md auto-merged, no conflicts)memory.peak(cgroup v2) and prints it in GiB, absent file = no line; scripts/run_game_wine.sh capturesmemory.peakfrom the run's systemd scope into the run folder; docs/linux_proton.md updated. No game data.python -I):AI-assisted: yes (Muse Wonder, Muse by Meta)
@aznohonza on GitHub · 2026-12-01 14:36 UTC · original
Thanks — the red-on-main / green-on-PR pair matches what we see here (the same 13 and 16 tests;
tests/test_run_game_wine_safety.py's 3 also pass). One limit worth restating: the wrapper only has amemory.peakwhen its cgroup is v2 with the file (systemd--user --scopehere, PID 1 of the scope); a plain shell gets the caller's cgroup since creation, and cgroup v1 gets no file and no line, which the second test covers. Nothing further from us on this one. AI-assisted.@KelboLive on GitHub · 2026-12-01 16:26 UTC · original · reviewed
Verified end to end:
scripts/run_game_wine.sh:332-334takes the cgroup-v20::path, reads$CGROUP_ROOT$cg_rel/memory.peakafter teardown, andtools/game_run_summary.py:141,:185-186renders it as GiB only when present. The v1 case writes nothing, as it should. Summary tests 13, launcher tests 16 (run under WSL — they skip on Windows by design), safety 3, all 13 docs test files, i18n and design-contract, pluscheck_no_game_data— all pass. The v2 selection is pinned: mutatings/^0:://ptos/^0://pmakestest_records_the_cgroup_memory_peakerror.Two nits, neither blocking:
docs/linux_proton.mdsays so, but the one-line summary ("cgroup memory peak: 23.6 GiB") reads as if it were the run's peak — a word there would prevent a wrong conclusion in a comparison table.[ -n "$cg_rel" ]guard is untested: removing it still passes the v1 test, because the fake root has nomemory.peakto pick up. A decoymemory.peakat the fake root would make the guard real.Merge-tree against current
origin/mainis clean; the branch is 210 commits behind but the only nearby edit is the adjacent Traces bullet indocs/linux_proton.md, and the merged tree passes the docs and summary tests.@aznohonza on GitHub · 2026-12-01 16:56 UTC · original
Both nits addressed in
ace83ae11:cgroup memory peak: 23.6 GiB (the run's scope, else the caller's cgroup), so a comparison table cannot read a caller-cgroup lifetime peak as the run's own.docs/linux_proton.mdalready explains the two cases; the tests that pin the text (tests/test_game_run_summary.py,tests/test_run_game_wine.py) are updated with it.memory.peakat the fakeLEONIDA_CGROUP_ROOTitself, so an empty v2 path must read nothing. Checked the mutation: with[ -n "$cg_rel" ]dropped, that test errors (it would otherwise record999from the root).Re-run here: 13 summary tests pass, 16 launcher tests pass (
python3 -m unittest tests.test_game_run_summary tests.test_run_game_wine), and the guard mutation gives 1 failure. Nothing else changed; the merge tree against currentorigin/mainstill applies. AI-assisted.@aznohonza on GitHub · 2026-12-01 17:10 UTC · original
One CI note on
ace83ae11: thewindowsjob came back red onloaderonly, and it is the runner's disk/AV timing heuristic, not this change —PE images written to ...\leonida_loader_test\7296 are not readable straight away: writing and reading one back took 71 ms on average (over 25 ms means each is being scanned), with the rest of the 551 tests passing. Nothing in this PR touches the runtime; re-running that job is not possible from here (run 46697161399 cannot be rerun; its workflow file may be broken— main changed the workflow), so the next push or base update will pick it up.Local, on this branch: 13 summary tests and 16 launcher tests pass. AI-assisted.
Pull request closed