d3d12: keep a minimum of the game in memory on PCs with little RAM (D3D12-MIN-WORKING-SET) #3198
Code
Clone this repository
Checkout
From your project repository, check out a new branch and test the changes.
git fetch -u origin "github-pr/3198:github-pr/3198" git switch "github-pr/3198"
Open
leonida/mandy
pranjalprateek6 wants to merge 5 commits from
github-pr/3198 into main
pull from: github-pr/3198
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
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
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!3198
Loading…
Reference in a new issue
No description provided.
Delete branch "github-pr/3198"
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?
This pull request has changes conflicting with the target branch.
Merge manually to resolve the conflicts.
Reviewers 0 approvals
Details
This pull request has changes conflicting with the target branch.
Merge manually to resolve the conflicts.
d3d12/docs/findings.mdView command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Claimed in the coordination issue as: D3D12-MIN-WORKING-SET (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7354390440)
Related claim, no pull request yet: D3D12-WORKING-SET-TRIM (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7330366858) trims the working set under pressure. Both are opt-in; with both on, this minimum is a floor under any trim. Also related: #3332 (D3D12-ROLLING-TRIM), which lets go of pages nobody touches.
What and why
The problem. On a 16 GB laptop the game holds about 21 GB of private memory a minute into the world, and Windows keeps about 5 GB of it in memory; the PC reads pages in at about 110 MB/s. Walking, the frame stalls in bursts that follow the scene: in them the submitting thread runs 10 to 17 % of the time it records preludes. A Windows Performance Recorder capture of 78 s shows page-ins as part of it:
The details are in the new section of
d3d12/docs/findings.md.The change.
LEONIDA_MIN_WORKING_SET_MB(unset or 0: off, as before) asks Windows once, when the host device is made (host()), for a hard minimum working set:SetProcessWorkingSetSizeExwithQUOTA_LIMITS_HARDWS_MIN_ENABLE(residency::keep_working_set_minimum).GetProcessWorkingSetSizeEx; the maximum, and whether it is enforced, stay as they are.residency::pressuredcomes sooner (it limits texture prefetch).Not changed. No launcher default. To try it:
-More @{LEONIDA_MIN_WORKING_SET_MB='6144'}.d3d12/docs/findings.mdgets the measurements, andd3d12/docs/switches.mdis regenerated withtools/d3d12_switches.py.Tested
The in-game numbers below were taken with the first form of the call, which also set the maximum to the PC's physical memory, not enforced. With the maximum kept they have not been taken again, so they do not show the effect of the minimum alone (
findings.mdand the function's comment say so too). The runs of others in the comments were made on80a627bb1, before this change.In game, on the hardware below: the diag build with DLSS, Series S, no frame generation, the same scripted walk in a circle from one save, a web browser closed.
Within one run. By turns of 15 s (
LEONIDA_AB, 49 phases), using a scratch switch around the same call, since the setting itself is read once:The submitting thread and the card show it; the frame's median does not clear 0 within the run. The phases without the minimum keep what the phases with it kept in memory, which narrows the difference.
Across separate starts (medians of the frame lines' 5 s windows):
Pages read in on the PC (
Memory\Pages Input/sec, medians over minutes 2 to 6 of the walk, one run each): 105 MB/s without it, 94 with it flipped every 15 s, 81 with it throughout.No errors in any run. The setting's log line showed the value applied (6,144 MB, not cut).
residency::tests::a_working_set_minimum_is_what_is_asked_and_at_most_half_the_memorypins: nothing asked, a size below the cap, exactly half (not cut), cut to half, huge values (no wrap), and a memory too small to keep anything.a_minimum_keeps_the_maximum_and_its_enforcementanda_minimum_is_in_force_when_windows_holds_at_least_that_hard(the decisions, without Windows) andwindows_takes_a_minimum_and_keeps_the_maximum(against Windows, on a command prompt started for the test, so the test process's own limits stay; it passed without any privilege enabled).cargo test -p leonida-gpu --lockedon this branch withmain09273248cmerged: 733 passed, 0 failed, 59 ignored.cargo clippy -p leonida-gpu --all-targets --locked: nothing inresidency.rs. Clippy with-D warningsalready fails onmain, per.github/workflows/d3d12.yml.python -I scripts/check_no_game_data.pyon the four files: clean.python -I tests/test_d3d12_switches.py: OK.python -m unittest discover -s tests -p "test_docs_*.py": 59 tests OK.texture::alias_cast_tests::committed_and_placed_r32_uint_textures_cast_to_r9g9b9e5_under_legacy_barriersis flaky under the parallel test runner on unchanged code (it failed 1 of 3 fullcargo test -p leonida-gpu --features diagnostics --libruns ona252854a2, and passes alone). No game files are needed to see it; seen on the hardware below.GPUs tested: NVIDIA GeForce RTX 5060 Laptop GPU 8 GB, driver 621.40, Windows 11 Home 26300 (Intel Core Ultra 7 255HX, 16 GB RAM)
AI-assisted: yes (AI coding assistant). A separate, read-only AI reviewer checked the diff before opening; the findings section and the code comment were rewritten after that check. Two more such reviews, on 3 December, checked the rewritten text with
mainmerged, and the corrections they asked for are in this version. The change that keeps the maximum was checked by another one before it was pushed, and again after its findings were worked in.Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)RUN (in game) -- unit tests + 300 s render-path verification for PR #3198:
80a627bb1mainSHA:f1a559851(git merge --no-ff, clean merge)python -I scripts/check_no_game_data.pyPASSpython -I tools/d3d12_switches.py --check d3d12/docs/switches.mdPASScargo test -p leonida-gpu --features diagnostics --lib --locked residency::-- 4 passed, 0 failed (includinga_working_set_minimum_is_what_is_asked_and_at_most_half_the_memory)diagprofile (diagnostics,dlss,mimalloc), Series S profile, DLSS on, Frame Gen off,LEONIDA_MIN_WORKING_SET_MB=4096, same restored save snapshot80a627bb1onf1a559851,MIN_WORKING_SET_MB=4096)mainalone (f1a559851)Loaded cleanly into the world with
LEONIDA_MIN_WORKING_SET_MB=4096, stayed up past 300 s in-world with 0 device lost / 0 crashes / 0ERRORlines, and closed cleanly. Rendered FPS matchesmain(26.9vs27.2fps).Verdict: PASS.
AI-assisted: yes (Antigravity).
RUN (in-game RTX 3090 300 s stress gate, 14-PR combined batch) — PASS covering exact head
80a627bb19421c51a5c04ab3caaf675b12a07554.git merge --no-ffontomainb41763227(diagnostics,dlss,mimalloc,exe_sha16 = c47eeb717f761d9d; changed-file clean-room scan exit0; workspace test targets compiled).14PRs):#3200d1a91afd1,#319880a627bb1,#319193b47ac9d,#3189c182fc392,#3176ae0075d9a,#3168337388052,#31641065952da,#3146ebc0253ff,#312464600ef0c,#3069311d33a40,#30318df1bfce7,#3029e49404808,#3054ff53fd8b9,#3010d645712a3.610.88, Series X profile,2560x1440,-NoFrameGen,scripts/game-gate.ps1(301.3 sin world) with downtown street-level teleport + 8-leg dynamic sprint/turn/strafe stress mod (GATE CONTROL moved=2.51 m,max_from_ctrl=5,053.9 m).c47eeb717f761d9d)mainb41763227baseline (cf499737bf684f6a)clean,0reasons,0warnings)clean,0reasons,0warnings)301.3 s(4,504frames)305.6 s0/0/00/0/020.10 FPS/69.76 ms19.13 FPS/74.01 ms8,048/5.222 s7,983/2.358 s35,619 MB/15,251 MB37,803 MB/16,220 MBVerdict: PASS for the 300 s in-game stability gate on
80a627bb1. (Single combined-batch stability check on a 32 GB RAM host, not a low-RAM/single-PR isolated measurement; if the head changes, this run no longer covers it.)(AI-assisted verification:
gemini-4-neon+gpt-6.2-astra.)VERIFY-3198 — Windows nativo: el test nuevo muerde y la suite sigue igual
(this PR)b41763227= currentmainmain— cleanRan
The one failure is this machine's, unchanged all day:
descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in(the iGPU artefact ofD3D12CreateDevice(None, ..)that #2995 addresses).Negative control (synthetic, the test ships with the change): I removed the half-memory cap in a copy (
let bytes = asked), rebuilt and ran →FAILED: a_working_set_minimum_...,assertion left == right failed: cut to half. The test bites, and it covers the edges I would want: 0 = none, exactly half is not cut, over half is cut,u64::MAXdoes not wrap, and a 1-byte PC asks for nothing.The design reads safely:
LEONIDA_MIN_WORKING_SET_MBis opt-in (unset or 0 → as before), parsed with a warning on a non-number, capped at half ofullTotalPhys, asked for once when the host device is made,QUOTA_LIMITS_HARDWS_MIN_ENABLE | QUOTA_LIMITS_HARDWS_MAX_DISABLE(a hard minimum, a soft maximum), and a refusal is atracing::warn!that changes nothing. The docs are the honest kind:findings.mdhas the 16 GB laptop case (RTX 5060, WARP capture, hard faults) and names the cost — that memory is not other programs' while the game runs, sopressuredcomes sooner.What I could not test
SetProcessWorkingSetSizeExcall on a real device: the test covers the arithmetic, not the API's acceptance on this machine (it would needLEONIDA_MIN_WORKING_SET_MBset at start and a device — not exercised).Written with an AI assistant.
This pull request has a merge conflict with current
main(d9b618f10), so it can't be run in game or merged as it is. Could you merge the latestmaininto it (or rebase onto it) and resolve the conflict? Once the head is updated, the in-game gate run can be done on the new head.AI-assisted (Claude Code).
#3198rebasada y empujada:pr-3198-rebased=8903c6967— y las dos secciones defindings.mdque chocaban eran distintas, así que van las dosEs el primer conflicto de esta serie que no era una sola línea, y por eso lo resuelvo de otra forma y lo digo:
Y la decisión de
findings.mdno es una estrategia, es una lectura:findings.mdes un registro cronológico de medidas — cada sección es una medición con su fecha, su tarjeta y su driver — y dos entradas distintas no se pisan: se suman. Si hubieran sido el mismo título, habría tenido que leer cuál manda.Los números:
Y
716contra los715demain: un test nuevo, en los 2 ficheros.rsque toca.Rama
pr-3198-rebaseden el fork, y con esta van trece de los 22.Lo que me queda por delante, y es lo honesto: los cinco que chocan en código Rust de verdad (
#2567,#2856,#3115,#3197,#3205) y los cinco de varios commits con código (#2580,#3124,#3130,#3209,#3214) — esos no los toco con un script, y decir que «se rebasan» sin haberlos mirado sería exactamente el error de esta noche.RUN (in game, 8 alternating runs A B B A A B B A, 32 GB desktop): no gain here. Windows already keeps about 28 GB of the game in memory, and the tool's verdict is "B slower" by 0.4 ms (1 %), at the edge of the noise.
diagbuild (diagnostics,dlss,mimalloc,d3d12/scripts/build-nvidia.ps1) ofmainf99e479fwith this PR's head80a627bbmerged. The only conflict was ind3d12/docs/switches.md, which was taken frommain. The code merged cleanly.LEONIDA_MIN_WORKING_SET_MB=12288, the same share of RAM as your 6,144 of 16 GB. Every B log has the lineat least this much of the game is kept in the PC's memory ... mb=12288 cut_to_half_the_memory=false.-NoFrameGen.LEONIDA_KEYS_FILE, and each run was closed withWM_SYSCOMMAND/SC_CLOSE, asscripts/game-gate.ps1does.python -I tools/d3d12_ab_compare.py abba, world median frame time:Memory, sampled every ~5 s in the world. Each figure is a run's median, given as the range over that side's 4 runs:
Memory\Pages Input/secresidencyreported the PC's memory as under pressure in 98 % of its one-second looks on both sides (248 to 261 of 252 to 266 per run), with no difference between A and B.What this says:
residencyreports pressure equally often on both sides. The frame time also rose through the series (39.6 → 42.5 ms), and the ABBA order only removes a straight-line drift. So I read it as "no gain, at most about 1 % lost" rather than as a measured cost.Only numbers are quoted here: no logs, captures or game data.
AI-assisted: yes (Claude Code, Claude Opus 5.5). The runs were driven and analysed by the assistant on the submitter's machine.
Done in d17b595b6, thank you. The limits are read first with
GetProcessWorkingSetSizeEx, and only the minimum changes:Three new unit tests, one of them against Windows on a process of its own. The old call fails two of them; the third covers the read-back.
You are right that the measurements changed two settings: they were taken with the first form of the call and have not been taken again. The description,
findings.mdand the function's comment say so.main(09273248c) is merged.AI-assisted: yes (AI coding assistant).
TAKEN | Otavmacedo | ETA 2026-12-04 07:00 UTC | AI-assisted: Claude Code (Claude Opus 5.5)
The 16 GB desktop this was written for and the A/B above lacked (it ran on 32 GB, where Windows already kept about 28 GB of the game in memory): NVIDIA RTX 3070 8 GB, Ryzen 7 5700X, 16 GB RAM, fixed 24 GB page file (commit limit 40.9 GB), Windows 11, driver 621.47. Here the game runs at about 23 GB private with 12 GB of it in memory.
main4d9e4d05d+ this PR's headc176e9716(clean merge),diagnostics,dlss,mimalloc.-SeriesS -Resolution 540 -NoFrameGen -NoSmoothMotion,LEONIDA_FPS_CAP=30): on this PC it kept the device in 2 of 2 runs tonight, where the DLSS recipe lost it in 5 of 6 (#2821), so the arms are not cut short by that. Gate runs from one save,mods/gate_driveridle, 600 s in the world, memory stops widened (private 32000, commit left 1500, video memory 900 s).LEONIDA_MIN_WORKING_SET_MB| A = 0 | B = 6144 (your value for 16 GB). A discarded warm-up, then A B B A.DONE | the A/B taken above | AI-assisted: Claude Code (Claude Opus 5.5)
Short: on this 16 GB desktop with an 8 GB card,
LEONIDA_MIN_WORKING_SET_MB=6144lost the device in 3 of 3 runs, at 303-356 s in the world; the same executable without it reached 600 s in 3 of 3. It did not raise how much of the game Windows kept in memory either (about 12.6-12.9 GB with and without, one B run 14.8 GB): here the game already holds about twice the minimum. I would not make it a default for 16 GB PCs on this evidence. PROVISIONAL (n=3 per arm).main4d9e4d05d+ this PR's headc176e9716(clean merge),diagnostics,dlss,mimalloc.-SeriesS -Resolution 540 -NoFrameGen -NoSmoothMotion,LEONIDA_FPS_CAP=30); gate runs from one save,mods/gate_driveridle (LEONIDA_GAME_ACTIONS=1),-WorldSeconds 600, memory stops widened (private 32000 MB, commit left 1500 MB, video memory over budget 900 s). Order: a discarded warm-up (B, 300 s), then A B B A, then B A. Caches warm.at least this much of the game is kept in the PC's memory (LEONIDA_MIN_WORKING_SET_MB) mb=6144 cut_to_half_the_memory=false maximum_mb=6144 … maximum_enforced=false; no such line in the A runs.(fps from presents after 60 s in the world, as
summary.jsongives them.tools/d3d12_ab_compare.py abbaleaves the B runs out because their gate failed, so there is no verdict from the tool; these are the per-run values.)What the runs say, each tagged:
mainreached 600 s in 2 of 2 runs (#2821), so without the minimum it is 0 losses in 5.leonida_gpu::drawwhile textures picked by index were made ready (B2), and a small buffer that could not be placed (B3). This build does not have #3385, so the reason (REMOVED, HUNG, RESET) is not named.residency.rs:418,QUOTA_LIMITS_HARDWS_MIN_ENABLE), which makes 6 GB of the process unavailable to trim while the card's spilled memory (5.6-5.8 GB shared at the peaks of the B runs) also needs the PC's physical pages; on 16 GB that leaves the video memory manager little to move. A run with a smaller value (2048) would say whether it scales.Not watched: the screen (no one looked during these runs). The A runs past the story transition show the stuck-scene signature reported in #3434; that happens on plain
maintoo (2 of 5 runs there), and with the minimum at 0 this PR does nothing (READ IN CODE:residency.rs:290returns before any call).GPUs tested: NVIDIA GeForce RTX 3070 8 GB, 621.47, Windows 11, profile M.
The figures were recomputed from the run records by a separate read-only agent before posting.
Note on my DONE above (comment 25302) | AI-assisted: Claude Code (Claude Opus 5.5)
Later runs on this PC showed that the device loss rate depends on the folder the game runs from (same executable bytes: 2 of 2 lost from a worktree made that night, 2 of 2 kept from my main checkout; #2821, comment 25546). Both arms here ran the same executable from one worktree, so A against B is still a fair comparison: with the minimum 3 of 3 lost, without it 3 of 3 kept (p = 0.05, one-sided Fisher). But the "0 losses in 5 without the minimum" I added from the plain
mainruns mixed folders, and across all the no-variable runs of the night 10 of 22 lost the device, so read the result as a lead to repeat (ideally the same bytes from a second folder, and the 2048 value), not as settled.CORRECTION to my DONE above (comment 25302) and my note (comment 25552) | AI-assisted: Claude Code (Claude Opus 5.5)
The device losses I reported for
LEONIDA_MIN_WORKING_SET_MB=6144came from the folder, not the minimum: the same A/B, same executable, run from the folder where the device holds here, kept the device in all six runs, with and without it. I withdraw "I would not make it a default for 16 GB PCs on this evidence": on this PC the minimum shows no measurable effect either way.Same executable as the first A/B (
main4d9e4d05d+ this PR's headc176e9716,exe_sha166a581c…), copied into my main checkout's folder for these runs (why: #2821, comment 25546); same recipe (-SeriesS -Resolution 540 -NoFrameGen -NoSmoothMotion,LEONIDA_FPS_CAP=30, gate from one save,mods/gate_driveridle, 600 s); a discarded warm-up (B), then A B B A B A. The minimum's line (at least this much of the game is kept in the PC's memory … mb=6144) is in every B run.Apologies for the noise on this PR.