d3d12: keep a minimum of the game in memory on PCs with little RAM (D3D12-MIN-WORKING-SET) #3198
Open
pranjalprateek6 wants to merge 5 commits from
upstream-pr/3198 into main
pull from: upstream-pr/3198
merge into: ProjectLeonida:main
ProjectLeonida:main
ProjectLeonida:claude/loop-total
ProjectLeonida:claude/pops-collision-seed
ProjectLeonida:claude/dstorage-hold-page-reads
ProjectLeonida:claude/host-image-copy-switch
ProjectLeonida:feat/gdk-lifecycle-window-hook
ProjectLeonida:claude/d16s8-uav-nvidia-fallback
ProjectLeonida:feat/mfplat-offline-shim
ProjectLeonida:claude/gameinput-slow-reader
ProjectLeonida:fix/rt-null-barrier-clear
ProjectLeonida:claude/depth-resolve-sample-positions
ProjectLeonida:integration/palmetto-parity
ProjectLeonida:claude/valu-literal-sext
ProjectLeonida:claude/slot74-pool-handle
ProjectLeonida:claude/rgb9e5-uint-alias-view
ProjectLeonida:claude/fssm-root-layout-tables
ProjectLeonida:feat/gdk-speech-display-lifecycle
ProjectLeonida:asset-audio-skip-current
ProjectLeonida:qemmhd/old-9940-rectangle-quad-lists
ProjectLeonida:feat/ws2-offline-shim
ProjectLeonida:qemmhd/rt-d16-unorm-uav
ProjectLeonida:feat/xs-device-stops-7-9
ProjectLeonida:qemmhd/rt-depth-same-base-shapes
ProjectLeonida:qemmhd/rt-lazy-attachment-variant
ProjectLeonida:feat/acphal-xma2-decoder
ProjectLeonida:asset-audio-skip
ProjectLeonida:codex/coord-claim-check-20261124-7e48
ProjectLeonida:feat/xs-frame-pacing-presentx
ProjectLeonida:feat/xs-device-vm-options
ProjectLeonida:old-pr/9844
ProjectLeonida:old-pr/9978
ProjectLeonida:old-pr/9815
ProjectLeonida:old-pr/10057
ProjectLeonida:old-pr/9874
ProjectLeonida:old-pr/9965
ProjectLeonida:old-pr/9863
ProjectLeonida:old-pr/10068
ProjectLeonida:old-pr/10066
ProjectLeonida:old-pr/10067
ProjectLeonida:old-pr/10007
ProjectLeonida:old-pr/10061
ProjectLeonida:old-pr/10065
ProjectLeonida:old-pr/10059
ProjectLeonida:old-pr/10063
ProjectLeonida:old-pr/10055
ProjectLeonida:old-pr/10062
ProjectLeonida:old-pr/10042
ProjectLeonida:old-pr/10041
ProjectLeonida:old-pr/10049
ProjectLeonida:old-pr/10047
ProjectLeonida:old-pr/10046
ProjectLeonida:old-pr/10045
ProjectLeonida:old-pr/10056
ProjectLeonida:old-pr/10043
ProjectLeonida:old-pr/10036
ProjectLeonida:old-pr/10034
ProjectLeonida:old-pr/9984
ProjectLeonida:old-pr/10052
ProjectLeonida:old-pr/10038
ProjectLeonida:old-pr/10033
ProjectLeonida:old-pr/10028
ProjectLeonida:old-pr/10050
ProjectLeonida:old-pr/9891
ProjectLeonida:old-pr/9889
ProjectLeonida:old-pr/10051
ProjectLeonida:old-pr/10019
ProjectLeonida:old-pr/10027
ProjectLeonida:old-pr/10029
ProjectLeonida:old-pr/10031
ProjectLeonida:old-pr/10026
ProjectLeonida:old-pr/9941
ProjectLeonida:old-pr/10030
ProjectLeonida:old-pr/10040
ProjectLeonida:old-pr/9990
ProjectLeonida:old-pr/10021
ProjectLeonida:old-pr/9962
ProjectLeonida:old-pr/10022
ProjectLeonida:old-pr/10020
ProjectLeonida:old-pr/10015
ProjectLeonida:old-pr/10025
ProjectLeonida:old-pr/9886
ProjectLeonida:old-pr/10048
ProjectLeonida:old-pr/10014
ProjectLeonida:old-pr/10011
ProjectLeonida:old-pr/9861
ProjectLeonida:old-pr/10010
ProjectLeonida:old-pr/10008
ProjectLeonida:old-pr/9860
ProjectLeonida:old-pr/10006
ProjectLeonida:old-pr/9920
ProjectLeonida:old-pr/9995
ProjectLeonida:old-pr/10000
ProjectLeonida:old-pr/10016
ProjectLeonida:old-pr/10004
ProjectLeonida:old-pr/10023
ProjectLeonida:old-pr/9982
ProjectLeonida:old-pr/9981
ProjectLeonida:old-pr/9983
ProjectLeonida:old-pr/9970
ProjectLeonida:old-pr/9969
ProjectLeonida:old-pr/9968
ProjectLeonida:old-pr/9971
ProjectLeonida:old-pr/9972
ProjectLeonida:old-pr/9942
ProjectLeonida:old-pr/9963
ProjectLeonida:old-pr/9960
ProjectLeonida:old-pr/9964
ProjectLeonida:old-pr/9985
ProjectLeonida:old-pr/9973
ProjectLeonida:old-pr/9862
ProjectLeonida:old-pr/9953
ProjectLeonida:old-pr/10017
ProjectLeonida:old-pr/9952
ProjectLeonida:old-pr/9955
ProjectLeonida:old-pr/9946
ProjectLeonida:old-pr/9954
ProjectLeonida:old-pr/9938
ProjectLeonida:old-pr/9956
ProjectLeonida:old-pr/9856
ProjectLeonida:old-pr/9947
ProjectLeonida:old-pr/9924
ProjectLeonida:old-pr/9961
ProjectLeonida:old-pr/9927
ProjectLeonida:old-pr/9979
ProjectLeonida:old-pr/10032
ProjectLeonida:old-pr/9926
ProjectLeonida:old-pr/5237
ProjectLeonida:old-pr/9951
ProjectLeonida:old-pr/9931
ProjectLeonida:old-pr/9902
ProjectLeonida:old-pr/9921
ProjectLeonida:old-pr/9994
ProjectLeonida:old-pr/9775
ProjectLeonida:old-pr/9768
ProjectLeonida:old-pr/9905
ProjectLeonida:old-pr/9936
ProjectLeonida:old-pr/9901
ProjectLeonida:old-pr/9904
ProjectLeonida:old-pr/9906
ProjectLeonida:old-pr/9988
ProjectLeonida:old-pr/9908
ProjectLeonida:old-pr/9909
ProjectLeonida:old-pr/9911
ProjectLeonida:old-pr/9912
ProjectLeonida:old-pr/9913
ProjectLeonida:old-pr/9887
ProjectLeonida:old-pr/9916
ProjectLeonida:old-pr/9919
ProjectLeonida:old-pr/9925
ProjectLeonida:old-pr/9933
ProjectLeonida:old-pr/9935
ProjectLeonida:old-pr/9918
ProjectLeonida:old-pr/9879
ProjectLeonida:old-pr/9880
ProjectLeonida:old-pr/9881
ProjectLeonida:old-pr/9996
ProjectLeonida:old-pr/9876
ProjectLeonida:old-pr/9892
ProjectLeonida:old-pr/9899
ProjectLeonida:old-pr/9915
ProjectLeonida:old-pr/9914
ProjectLeonida:old-pr/9872
ProjectLeonida:old-pr/9869
ProjectLeonida:old-pr/9866
ProjectLeonida:old-pr/9819
ProjectLeonida:old-pr/10012
ProjectLeonida:old-pr/9857
ProjectLeonida:old-pr/9893
ProjectLeonida:old-pr/9897
ProjectLeonida:old-pr/9928
ProjectLeonida:old-pr/9868
ProjectLeonida:old-pr/9917
ProjectLeonida:old-pr/9940
ProjectLeonida:old-pr/9873
ProjectLeonida:old-pr/9816
ProjectLeonida:old-pr/10009
ProjectLeonida:old-pr/9900
ProjectLeonida:old-pr/9966
ProjectLeonida:old-pr/9859
ProjectLeonida:old-pr/9843
ProjectLeonida:old-pr/9991
ProjectLeonida:old-pr/10058
ProjectLeonida:old-pr/9883
ProjectLeonida:old-pr/9838
ProjectLeonida:old-pr/9835
ProjectLeonida:old-pr/9959
ProjectLeonida:old-pr/9895
ProjectLeonida:old-pr/9837
ProjectLeonida:old-pr/9858
ProjectLeonida:old-pr/9865
ProjectLeonida:old-pr/9864
ProjectLeonida:old-pr/9840
ProjectLeonida:old-pr/9820
ProjectLeonida:old-pr/4669
ProjectLeonida:old-pr/9848
ProjectLeonida:old-pr/9850
ProjectLeonida:old-pr/9810
ProjectLeonida:old-pr/9799
ProjectLeonida:old-pr/9853
ProjectLeonida:old-pr/9875
ProjectLeonida:old-pr/9831
ProjectLeonida:old-pr/9796
ProjectLeonida:old-pr/9801
ProjectLeonida:old-pr/9813
ProjectLeonida:old-pr/9794
ProjectLeonida:old-pr/7417
ProjectLeonida:old-pr/9781
ProjectLeonida:old-pr/9806
ProjectLeonida:old-pr/9958
ProjectLeonida:old-pr/9809
ProjectLeonida:old-pr/9791
ProjectLeonida:old-pr/9792
ProjectLeonida:old-pr/10053
ProjectLeonida:old-pr/9784
ProjectLeonida:old-pr/9789
ProjectLeonida:old-pr/9849
ProjectLeonida:old-pr/9846
ProjectLeonida:old-pr/9773
ProjectLeonida:old-pr/9785
ProjectLeonida:old-pr/9803
ProjectLeonida:old-pr/9826
ProjectLeonida:old-pr/9839
ProjectLeonida:old-pr/9922
ProjectLeonida:old-pr/9948
ProjectLeonida:old-pr/7189
ProjectLeonida:old-pr/9957
ProjectLeonida:old-pr/9823
ProjectLeonida:old-pr/9807
ProjectLeonida:old-pr/9851
ProjectLeonida:old-pr/9774
ProjectLeonida:old-pr/9830
ProjectLeonida:old-pr/9836
ProjectLeonida:old-pr/9822
ProjectLeonida:old-pr/9783
ProjectLeonida:old-pr/9833
ProjectLeonida:old-pr/9890
ProjectLeonida:old-pr/9770
ProjectLeonida:old-pr/9769
ProjectLeonida:old-pr/9772
ProjectLeonida:old-pr/9787
ProjectLeonida:old-pr/9852
ProjectLeonida:old-pr/9834
ProjectLeonida:old-pr/9845
ProjectLeonida:old-pr/9871
ProjectLeonida:old-pr/9771
ProjectLeonida:old-pr/9776
ProjectLeonida:old-pr/10005
ProjectLeonida:old-pr/9949
ProjectLeonida:old-pr/9923
ProjectLeonida:old-pr/9805
ProjectLeonida:old-pr/9829
ProjectLeonida:old-pr/9790
ProjectLeonida:old-pr/9827
ProjectLeonida:old-pr/9929
ProjectLeonida:old-pr/9855
ProjectLeonida:old-pr/9934
ProjectLeonida:old-pr/9907
ProjectLeonida:old-pr/9910
ProjectLeonida:old-pr/9779
ProjectLeonida:old-pr/9780
ProjectLeonida:old-pr/9885
ProjectLeonida:old-pr/9882
ProjectLeonida:old-pr/9877
ProjectLeonida:old-pr/9998
ProjectLeonida:old-pr/4251
ProjectLeonida:old-pr/9987
ProjectLeonida:old-pr/9989
ProjectLeonida:old-pr/9950
ProjectLeonida:old-pr/9777
ProjectLeonida:old-pr/10044
ProjectLeonida:old-pr/9884
ProjectLeonida:old-pr/2906
ProjectLeonida:old-pr/5076
ProjectLeonida:old-pr/9937
ProjectLeonida:old-pr/9986
ProjectLeonida:old-pr/3014
ProjectLeonida:old-pr/9943
ProjectLeonida:old-pr/9939
ProjectLeonida:old-pr/4682
ProjectLeonida:old-pr/4765
No reviewers
Labels
Clear labels
No items
No labels
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.
Reference
ProjectLeonida/mandy!3198
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-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?
Imported from ubiquitarianism/leonida. Originally posted by pranjalprateek6 on 2026-12-02T18:27:33Z.
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)Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T20:26:06Z.
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).
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T20:31:05Z.
Review: COMMENTED
Source review on
80a627bb. This also changes the maximum working-set policy.residency.rs:301–302always sets the maximum to physical RAM and disables hard maximum enforcement. Microsoft documents that the soft maximum still guides trimming when memory is scarce, and a hard maximum can already be configured. Thus the current call can relax another limit and the on/off measurement changes both settings. Could you read the current limits and flags withGetProcessWorkingSetSizeEx, preserve the maximum and its enforcement where possible, and document or decline a request above an existing hard maximum? If a soft maximum must rise to accommodate the minimum, raising it only that far would isolate the change. Set API · Get API. Source review only; I did not repeat the Windows workload. AI-assisted.Imported from ubiquitarianism/leonida. Originally posted by EdenBendheim on 2026-12-02T21:01:16Z.
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.)Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T21:02:26Z.
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.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T07:01:31Z.
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).
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T09:32:40Z.
#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.Imported from ubiquitarianism/leonida. Originally posted by Lanworm on 2026-12-03T17:47:00Z.
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.
Imported from ubiquitarianism/leonida. Originally posted by pranjalprateek6 on 2026-12-03T17:54:01Z.
Done in
d17b595b6, thank you. The limits are read first withGetProcessWorkingSetSizeEx, 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).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.