Repository navigation
Conversation
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.
…ORY-STOP) A memory pile-up has taken a PC's whole Windows down, not only the device, and a fixed 80 GB cap never triggers on a PC with a 40 GB commit limit. The supervisor now asks `game_gate.py state` for a memory stop, read from the runtime's latest memory lines: the game's private bytes past -StopPrivateMB (default 90 % of this PC's commit limit), the PC under -StopCommitLeftMB left to commit for 20 s (default the larger of 128 MB and 0.25 % of the limit), or video memory over the system's budget for -StopOverBudgetSeconds (60). 0 turns one off. The run then stops the same clean way, with the reason `memory`; the limits go into run.json and the summary, the limit passed into `stop.memory_why`, and the verdict is FAIL `memory_stop`. `start` forwards the limits to the detached run.
|
Verified by OreoFR on macOS 27.2.1, Apple M5, Python 3.12, head MEASURED
READ IN CODE
ASSUMED
AI-assisted: Claude Code |
With a large page file the commit limit is far above what a PC survives: two Windows crashes (0x10E) came at about 100 GB private on a PC with 64 GB of memory and a 175 GB limit, where 90 % of the limit is 158 GB. The default is now the lower of 90 % of the commit limit and 1.25 x the physical memory (80 GB there, 36 GB here); the video memory stop stays on by default.
|
Thanks, checked and agreed. With a large page file the commit limit is far above what a PC survives. Your two Windows crashes (0x10E) came at about 100 GB private, on 64 GB of memory with a 175 GB limit. 90 % of that limit is 158 GB, which is too late. Fixed in 5323dfa: the default |
|
Re-verified on the new head MEASURED
READ IN CODE (
AI-assisted: Claude Code |
|
Verified on Windows with the control: the suite fails when Cherry-picked onto
So the new cases are tied to the new code and not to fixtures the file already had. They add to the same suite that #2805, #2804 and #2810 touch, and all five together are consistent - I have now run every one of them. #2813 applies on top of this one (its tip cherry-picks cleanly over it), so the merge order is #2812 then #2813. What I could not test: the PowerShell side ( AI-assisted: yes - DeepSeek v4.1 (flash), applied and ran both arms on the machine above. Written with an AI assistant. |
|
I ran the stock PowerShell supervisor with real The harness supplied synthetic CIM values and fed the launcher synthetic log rows. The following are the recorded limits in
Each positive case produced one AI-assisted with OpenAI Codex (GPT-6.2 Sol). |
KelboLive
left a comment
There was a problem hiding this comment.
Re-ran on today's main (7f8bb903): the conflict is only tests/test_game_gate.py — both the #2805 Script test and this PR insert at the same spot — and keeping both gives 27 passed, so this is a one-line rebase. The needs rebase label is still correct, and #2810 (which the branch is stacked on) is already in main, so there is no duplicate work.
The core path holds: limits are read from the machine and written to run.json (scripts/game-gate.ps1:127-132, :149), the alarm is computed in tools/game_gate.py:286-304 and exposed as state.memory_stop (:318), the supervisor stops with reason memory before target/timeout (:207) and closes cleanly (:214-222), and the verdict is FAIL memory_stop with world_not_reached/world_time_short suppressed (:431-433, :438, :440). Deleting and reason != "memory" makes test_a_run_stopped_for_memory_fails_with_its_reason fail, so that guard is covered.
Three things before merge:
- The description is stale after
5323dfa69: it still says the private cap defaults to "90 % of this PC's commit limit", but code and docs now use the lower of that and 1.25 × physical (scripts/game-gate.ps1:131,docs/game_gate.md:30). Update the body. - A test gap on the commit floor: the 20 s boundary is only exercised at 25 s, so
>=→>attools/game_gate.py:298survives the suite. A 20 s case would close it (the 60 s VRAM boundary is covered at exactly 60). docs/game_gate.md:69callsmemory_why"the limit passed", but the code stores the full explanation string — say so.
One question, not a blocker: memory is checked before target (scripts/game-gate.ps1:207-209), so a run that reaches its world time in the same 5 s poll as a limit is reported FAIL memory_stop rather than PASS. If that is intended, it deserves a sentence; if not, check the target first.
Claimed in the coordination issue as: D3D12-GATE-MEMORY-STOP (#2570 (comment))
Depends on: #2810 (it reads the memory lines #2810 parses; this branch holds #2810's commit and will be rebased on
mainonce #2810 is merged)What and why
A memory pile-up has taken a PC's whole Windows down twice, not only the device (bug check 0x10E on a 3090). Testers stop their runs at 80 GB of private bytes or 60 s of full video memory. A fixed 80 GB cap never triggers on a PC whose commit limit is 40 GB. The gate now stops a run before memory runs out, with limits taken from the machine:
The supervisor of
scripts/game-gate.ps1already askstools/game_gate.py stateevery 5 s.statenow also answersmemory_stop, from the runtime's latest memory lines (gate: summary.json gets the run's memory peaks (D3D12-GATE-MEMORY-PEAKS) #2810), so it works on any card. It stops when any of these holds:-StopPrivateMB(default: 90 % of this PC's commit limit);-StopCommitLeftMBleft to commit for 20 s (default: the larger of 128 MB and 0.25 % of the limit). On a PC with no page file, a normal run here left 267 MB at its lowest, so the floor is low and must hold for 20 s;-StopOverBudgetSeconds(60).0 turns a limit off.
The run then stops the same clean way as at the end of its time (title suspended, cache saved), with the reason
memory.The limits go into
run.json(memory_stop) and the summary (memory.stop_limits), and the limit that was passed intostop.memory_why. The verdict is FAILmemory_stop: the run was on its way to running out.world_time_shortandworld_not_reachedare not added on top.startforwards the limits to the detached run.docs/game_gate.mddescribes all of it.Tested
On Windows 11 Pro 10.0:
tests/test_game_gate.py: 26 tests OK. The three new ones fail with gate: summary.json gets the run's memory peaks (D3D12-GATE-MEMORY-PEAKS) #2810's code:startforwards them, andrun.jsongets them.test_tool_stdout_encoding.pyandscripts/check_no_game_data.pyon the changed files are clean. The script parses in PowerShell 7.main8f41d7d code, the driver mod from mods: gate_driver takes a run from the menus into the world (D3D12-GATE-DRIVER-MOD) #2784,-StopPrivateMB 15000(a normal run reaches about 24 GB here).stop_requestedwith reasonmemoryandwhy: private bytes 18766 MB, over 15000 MB, then sent the close.memory_stop,stop_limits{15000, 128, 60}. The 128 MB is the default floor here: this PC's limit is 39.7 GB.GPUs tested: NVIDIA GeForce RTX 3080 10 GB, driver 32.0.16.2140
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)