d3d12: title memory windows stay off cards under 12 GB on PCs of 20 GB or more #3035
Closed
leonida/mandy
Krashgamer wants to merge 10 commits from
github-pr/3035 into main
pull from: github-pr/3035
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:github-pr/3198
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/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
4 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!3035
Loading…
Reference in a new issue
No description provided.
Delete branch "github-pr/3035"
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?
Pull request closed
Please reopen this pull request to perform a merge.
Claimed in the coordination issue as: D3D12-LAUNCHER-WINDOWS-SMALL-CARD (claimed with this pull request, in #2570)
Depends on: #3031. The PC-memory headroom this needs comes from pooled command allocators. Without #3031 a 32 GB PC with this change would be back near the 2026-11-27 case that brought the windows to PCs under 48 GB. Merge after #3031.
What and why
play-nvidia.ps1puts up to 3 GB of title memory windows in the card's CPU-mapped memory (LEONIDA_WINDOWS_BAR_MB=3072) on every PC with under 48 GB of RAM. Cards under 6 GB are the only exception. The windows are there for the PC's memory.On an RTX 3080 10 GB with 32 GB of RAM, the windows take about 2 GB of the card in the world's first seconds, before most textures arrive. The process's 32 MB write-combined regions (the mapped card memory) go from 27 to 90 there and stay. The device census has 732 card buffers the CPU maps, 2,054 MB. Textures then find the card at its line.
Game gate, Series X, 2560x1440, 300 s in the world from the same save, with #3031:
LEONIDA_WINDOWS_BAR_MB=0LEONIDA_WINDOWS_BAR_MB=0So on a 10 GB card the windows cost the textures half their room. The frame rate stays within the spread, at its low end, and the PC's memory takes 1.1 GB more.
The change:
play-nvidia.ps1also setsLEONIDA_WINDOWS_BAR_CARD_MIN_MB: 11,776 on PCs reported at 19 GiB or more, 6,144 below that. The runtime compares it with the own memory (DedicatedVideoMemory) of the adapter it took, and puts no windows on a card under the line. It says so once in the log.-Adaptercan be part of several card names,#Nis the runtime's order, and Windows' default card is not always the largest. The first versions of this pull request guessed, and the reviews found cards each guess missed (ecox982745, merzleckeier). The launcher's card probe is back to whatmainhas.-WindowsBarMBbehave as before. A card whose size the runtime cannot read keeps the cap.-WindowsBarMBhelp,d3d12/README.md,docs/switches.mdand ad3d12/docs/findings.mdsection.For an 8 GB card on a 16 GB PC (RTX 3070, Series X, 1080), OtavMacedo measured the two settings this rule chooses between (comment): with the windows on the card, which the rule keeps there, the frame was 1.9 ms (4.4 %) faster in four pairs, at the price of a card over its budget for most of the run; without them 1 of 6 runs lost the device, with shared memory near Windows' limit. That was main with #3258 and the prologue save, not this head.
Not measured: 12 GB cards, and 8 GB cards on 32 GB PCs. The rule assumes 8 GB cards lack card memory more.
Tested
The tables above are from an earlier head, where the launcher left the cap out. The check run below is the runtime rule itself.
Check run of the rule. Game gate, this head (
4995a799c) with #3031 (8df1bfce7) merged onmain8877be372, Series X, 2560x1440,-HardwareRT, 300 s in the world, RTX 3080 10 GB, 32 GB RAM: PASS.The launcher set the cap and the line, and the runtime logged that the windows stay in the PC's memory: the card's 10,051 MB are under the line of 11,776.
No windows in card memory (0 MB), 2,567 in the PC's memory since the start.
Card at most 8,919 MB of a 9,155 MB budget, 0 s over budget. Private bytes at most 27.7 GB.
A memory walk ran every 30 s, so its frame rate is no comparison.
tests/test_win_launchers.py,test_nvidia_windows_cap_and_card_line_by_ram: fakes the PC's RAM and the card's memory as reported, runs the launcher with-DryRun, and checks the cap, the line and the one message for 13 pairs of sizes (among them both sides of 19 GiB and of 48 GiB, and a typed cap). All pass on Windows.Rust unit test
mapped_windows_tests::a_card_under_the_line_gets_no_windows: a card under the line, at it, over it, of unknown size, and no line set. Without the rule (mapped_capreturning the cap always) it fails.Docs tests (
test_docs_*.py),d3d12_switches.py --checkandcheck_no_game_data.py: passed.The change was reviewed by an independent reviewer agent before this pull request and again after the move to the runtime. Found and fixed in the second review:
GPUs tested: NVIDIA GeForce RTX 3080 10 GB, driver 32.0.16.1088 (610.88), resizable BAR, Windows 11 Pro 26200; Intel i7-10700K, 32 GB RAM
AI-assisted: yes, Claude Code (Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a)🤖 Generated with Claude Code
Independent Windows dry-run check at base
8422def75and headd2e2188f0. I mocked 32 GB RAM and an 8 GB selected adapter (-Adapter 5060), then added a separate 16 GB registry entry. Windows PowerShell 5.1 and PowerShell 7 both gave the same result.-WindowsBarMB 0LEONIDA_ADAPTER=5060was passed in all cases. The existing probe takes the largest registry entry, so the new rule protects the 8 GB card in the single-adapter case and can still leave the cap on when the same card is selected on a mixed-adapter PC. This is a scope limitation of the existing probe. It may be worth documenting the manual override for that case.AI-assisted validation. Synthetic registry and CIM inputs, no game files or GPU activity.
Thanks, @ecox982745 - fixed in b0cf557e2 rather than documented: with
-Adapterthe probe now takes the memory of the card(s) whose name it is part of (any case, as the runtime picks), else the largest as before. That also corrects the under-6 GB rule on such PCs. The test got two-card cases (8 GB5060beside a 16 GB card: picked 8 GB -> no cap; pickedrtx 4080-> 3072; none picked or a name matching none -> the largest, 3072). The picked-8 GB case fails with the previous head's script and passes now; all 6 launcher tests pass.VERIFY-3035 — Linux, Fedora 45, no GPU device, no game files, no title
Verdict: PASS. The launcher change, its documentation and its new test are mutually consistent: I traced the
-Adapter-aware VRAM pick and the new under-12-GB rule through the code, the test cases and the docs, and found the logic self-consistent with no defect. The measured numbers are the author's and I could not reproduce them (no GPU, no Windows, no game files); the new PowerShell test could not be run here (nopwsh).Head
d4da3449, base the currentmain(0ae5a266), merge base8422def7, 4 files, +151/−5:d3d12/README.md(+4/−1),d3d12/docs/findings.md(+29),d3d12/scripts/play-nvidia.ps1(+25/−4),tests/test_win_launchers.py(+93).1. What it changes
d3d12/scripts/play-nvidia.ps1: (a) the card-memory probe is now-Adapter-aware — with-Adapternaming a card (any case, plain text, not#N), it takes the largest memory of the cards whoseDriverDesccontains the name; otherwise, or if the name matches none, the largest adapter's (lines 367-386). (b) A new rule:$textureShort = $vram -gt 0 -and $vram -lt 11.5GB -and $ram -ge 20GB; when true (and not a small card, PC under 48 GB) the launcher no longer setsLEONIDA_WINDOWS_BAR_MB=3072and instead prints that the title memory windows stay in the PC's memory (lines 531-547). The-WindowsBarMBhelp and the README are updated to match.d3d12/README.md(lines 558-565): the explanation of the 3072 MiB cap now says "unless the card has under 6 GB, or under 12 GB on a PC with 20 GB or more (there the card's memory is what the textures lack: on an RTX 3080 10 GB with 32 GB, twice the textures stayed alive without the windows, docs/findings.md), and leaves it off otherwise."d3d12/docs/findings.md(lines 1807-1834): a new measured section "Title memory windows in the card's memory on a 10 GB card (2026-12-02)" with the run conditions and two result tables.tests/test_win_launchers.py: a newtest_nvidia_windows_in_card_memory_by_ram_and_cardthat fakes the CIM/registry queries and checks the cap decision for 15 RAM/VRAM/-Adapter/typed-cap cases.2. The claims it makes, and which ones I checked
-Adapter, the largest of the cards whose name it is part of, else the largest adapter's" — checked by reading lines 371-386:$want = $Adapter.Trim()unless it starts with#;$namedtakes the largestHardwareInformation.qwMemorySizewhoseDriverDesccontains$want(IndexOf(..., OrdinalIgnoreCase));if ($named -gt 0) { $vram = $named }. Matches the comment. True.host.rschosen_adapter(): name substring, case-insensitive. Consistent. True.IndexOfis substring matching, not a pattern; the runtime usescontains. True (the test's"[x"case confirms no pattern/error).#N, the runtime's N-th card, has no place here: the driver keys are not in its order, so it gets the largest" — checked: the registry class keys are not in DXGI order, so an index cannot be mapped;$want=''for#Nand the largest is used. A documented limitation, acknowledged in the comment and covered by the test ("#1"→"3072"). True.$vram -lt 11.5GB -and $ram -ge 20GB. Consistent with the comment "(Cards and PCs report a little under what they are sold as, hence 11.5 GB and 20 GB)". The README says "under 12 GB" in nominal terms; the code uses 11.5 GB reported. (See section 4.)textureShortfalse (ram < 20GB) → cap 3072; 32 GB PC + 10 GB card →textureShorttrue → no cap; 32 GB + 12 GB-as-reported (12,284 MiB > 11.5 GB) → cap 3072; 4 GB card →$smallCard→ no cap and no message; 48 GB+ → no cap; typed-WindowsBarMB 3072→ wins. Two-card runs:-Adapter 5060picks the 8 GB card's 8,188 MiB → no cap;-Adapter 'rtx 4080'picks the 16 GB card's 16,376 MiB → cap 3072; no/9999/[x/#1→ the largest (16,376) → cap 3072. Every expectation matches. Consistent.textureShortis false, so the cap is set (windows on the card). Matches the prose and the 16 GB test case. True.3. What the tests do here
python3 -I tests/test_win_launchers.py: 6 tests, OK (5 skipped). The newtest_nvidia_windows_in_card_memory_by_ram_and_cardis@unittest.skipUnless(POWERSHELL, ...)and is skipped — there is nopwsh/powershell.exeon this machine, so the PowerShell path (including the fakeGet-CimInstance/Get-ChildItem/Get-ItemProperty) is not exercised.test_static_quoting_and_no_pause_guardspasses; the new test and four pre-existing ones skip for the same reason.python3 -I -m unittest discover -s tests -p "test_docs_*.py": 57 tests, OK (42 s) — includes the repository's link checks, so the new[docs/findings.md](docs/findings.md)reference resolves.python3 -I scripts/check_no_game_data.py d3d12/README.md d3d12/docs/findings.md d3d12/scripts/play-nvidia.ps1 tests/test_win_launchers.py: clean.python3 -I scripts/red_green.py 3035 --work-dir ...:no red— the red side (base + the test change) and the green side both pass the one runnable test intest_win_launchers.py; the new test is skipped here (no PowerShell), so it cannot show a red→green transition on this machine. Not a defect of the change.4. Anything wrong in the change (with the file and line)
No defect. Three minor observations, all acknowledged by the author in comments or by design:
11.5GB(d3d12/README.md~line 560,d3d12/scripts/play-nvidia.ps1line 539): the README speaks in nominal ("under 12 GB"), the code in reported ($vram -lt 11.5GB). Theplay-nvidia.ps1comment explains "(Cards and PCs report a little under what they are sold as, hence 11.5 GB and 20 GB)". A card reporting between 11.5 and 12 GB (e.g. a nominal 12 GB card reporting 11.8 GB) would keep the cap under the code but "under 12 GB" under the README. Cosmetic/precision only; the prose is consistent with the author's stated intent.-Adapter '#N'uses the largest card's memory (play-nvidia.ps1lines 373-374, 380-381): a card picked by DXGI index cannot be matched to a registry key (they are not in the same order), so the VRAM used is the largest card's. If the index-named card is the smaller one, thetextureShortdecision could be off. Documented in the comment and covered by the test; a known limitation, not a regression.play-nvidia.ps1line 539):$ram -ge 20GBis the exact 20·2³⁰ byte threshold; a nominal-20 GB PC that reports slightly under would not meet it and would keep the cap. The comment's "hence ... 20 GB" shows this is intended as a reported-value cutoff, but the README's "20 GB or more" is looser.5. What I did not check
d3d12/docs/findings.md(RTX 3080 10 GB, driver 32.0.16.1088, i7-10700K, 32 GB, Series X, 300 s, A/B runs; the textures/made again/turned down/fps/private-bytes tables) — the author's own GPU measurements; not reproducible here (no NVIDIA GPU, no Windows, no game files). I checked only their internal consistency (A vs B ≈ 2× textures; B fps within A's spread, p5 a little under; private bytes ≈ 1.1 GB more; "29 GB without #3031" ≈ 27.7 + 1.1).pwsh): the launcher logic and the new test were verified by reading, and the test's 15 cases were checked against the code by hand.ecox982745reference in theplay-nvidia.ps1comment (line 370) — a comment on #3035; I could not read GitHub comments and did not try.DriverDescmatches what the runtime sees as the DXGI name — the launcher matches the registryDriverDesc, the runtime matches the DXGI description; I could not confirm they agree on real hardware.This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).
Could you, or anyone with a working setup, post a run report on the current head merged onto current
main:mainSHA it was merged onto;mainalone for comparison, if you can.Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.
AI-assisted (Claude Code).
Read on the current head; the PowerShell tests could not run here (Linux, no
pwsh). The logic is right. The default change rests on one PC, and the in-game gate is still open.python -I tests/test_win_launchers.pyplay-nvidia.ps1skip off Windows, so this proves nothing about the changepython -I scripts/check_no_game_data.pyon the 4 filesRead in the diff (
d3d12/scripts/play-nvidia.ps1)-Adaptermatch is nowIndexOf(..., OrdinalIgnoreCase), plain text as the runtime matches it. The old-like "*$Adapter*"treated[xas a pattern and threw inside thetry, which silently left$vramat its value so far.#Nfalls back to the largest card. The two new test rows ("[x","#1") cover both cases.$textureShort = $vram -gt 0 -and $vram -lt 11.5GB -and $ram -ge 20GBkeeps the windows off every card under 12 GB on a PC with 20 GB or more. Theelseifmessage is printed only when the windows would otherwise have been put on the card. Unknown VRAM (0) keeps the old behaviour.Points for the author (not defects)
Verdict: ready for the script logic. Merge after the render-path run that was asked for on this PR, ideally on an 8 GB card with 24-32 GB of RAM.
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
Thanks @MoonEyes. In-game runs on current
main5b1fff821, RTX 3080 10 GB, 32 GB RAM, Series X, game gate 300 s in the world, same save, alternating, two runs each.+#3031+#3035is the new head of #3031 (8df1bfce7) with this branch merged; this change only moves the windows, so on this PC it runs with no windows on the card. Private bytes at most:-HardwareRT: card over its budget-HardwareRT: card in use, max-HardwareRT: private / fps medianNo device losses or crashes in any of them. (A first
-HardwareRTround with the gate's over-budget stop on was stopped at ~175 s for main and+#3031, not for+#3031+#3035.)On your two points:
-HardwareRT). That is why the pull request says "merge after #3031". I cannot measure a 24 GB PC here. A 24 GB PC already commits beyond its memory on main (27.6 GB private), so the windows were not what kept it out of paging. I would leave the line at 20 GB unless someone with 24 GB measures otherwise.AI-assisted (Claude Code, Claude Opus 5.5).
Windows CPU-only check on the latest head
b7b3c56cewith mainb41763227. The merge touches only one conflict, ind3d12/docs/findings.md: keep both the new table-constant-buffer section from main and this PR’s title-memory-window section. The launcher and tests auto-merge. The merged launcher’s RAM/VRAM matrix, including the named dual-GPU case, passed in Windows PowerShell 5.1 and PowerShell 7. No GPU or title run in this check. AI-assisted.Thanks @ecox982745. Rebased on
mainb41763227(5f0042151): thefindings.mdconflict keeps both sections, main's table-constant-buffer section first.tests/test_win_launchers.py, the docs tests andcheck_no_game_data.pypass on Windows.AI-assisted (Claude Code, Claude Opus 5.5).
Superseded by
4995a799c: the runtime now judges the card it took; the "smallest card" rule below is gone.Thanks @merzleckeier, a real gap. Fixed in
c0bc6f70d: when-Adapteris part of several card names, the launcher now takes the smallest of them.The driver keys it reads do not say which card comes first in DXGI order, which is what the runtime picks. The smallest is the card the rule must not miss: a 16 GB card treated as the 8 GB one only keeps the windows off a card that could hold them, while the reverse puts them on the small card.
New case
(32 GB, 8 GB + 16 GB, -Adapter nvidia) -> no windows: it fails on the previous head (the cap was3072) and passes now.tests/test_win_launchers.pypasses on Windows.AI-assisted (Claude Code, Claude Opus 5.5).
This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).
Could you, or anyone with a working setup, post a run report on the current head merged onto current
main:mainSHA it was merged onto;mainalone for comparison, if you can.Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.
AI-assisted (Claude Code).
@merzleckeier your check made me look at the rule again: even the smallest matching card is a guess, because the launcher cannot know which card the runtime takes. So
4995a799creplaces the approach ofc0bc6f70d.LEONIDA_WINDOWS_BAR_CARD_MIN_MB(11,776 on PCs of 19 GiB or more, 6,144 below that). Its card probe is back to whatmainhas.-Adapter nvidiawith an 8 GB and a 16 GB card follows the card that is used.-HardwareRTpassed: the runtime logged the line, 0 MB of windows on the card, 0 s over budget.Nothing has to be merged by hand for #3002 any more (closed). The pull request text is rewritten for this head. It still merges after #3031.
AI-assisted (Claude Code, Claude Opus 5.5).
@MoonEyes run report of the current head. It depends on #3031, so the run has #3031 merged too.
4995a799cand #30318df1bfce7, merged onmain8877be372(local mergedc289a22b, clean tree, builtdiagnostics,mimalloc).mainhas moved tof3865cae8since; ind3d12/cratesandd3d12/scriptsonlyleonida-luaandleonida-pechanged.-HardwareRT.game-gate.ps1, 301 s in the world, PASS. 0 device lost, 0 crashes, 0 s over the card's budget (at most 8,919 of 9,155 MB).For comparison, without that walk, from an earlier head of this pull request (
3b8a11cee, the same rule judged in the launcher) with an earlier head of #3031 (9903ba336), andmain5b1fff821alone,-HardwareRT, 300 s:mainA second
mainrun was stopped by the gate's own memory limit at 172 s in the world (65 s over the card's budget). Without ray tracing, same commits, two runs each:main24.5 and 24.1 fps, #3031 + this 23.8 and 23.5.The failing
d3d12 (windows-latest)check ismain's:leonida-luatests do not build there (tests.rs:1089); #3237 fixes it.AI-assisted (Claude Code, Claude Opus 5.5).
VERIFY-3035 — Windows nativo: las suites pasan y el control muerde la línea de memoria de la tarjeta
(this PR)b41763227= currentmainmain—merge-treeclean,git merge --no-ffcleanRan
Negative control (synthetic): I inverted the comparison in
mapped_cap(card > lineinstead ofcard < line), rebuilt and ran:The test bites.
What the change is:
Host::card_memory()reports the adapter's own memory, andwindow_mapped_mostnow judges it — when the card has less of its own memory thanLEONIDA_WINDOWS_BAR_CARD_MIN_MB(6 GiB, or 11.5 GiB on PCs with 20 GB of RAM or more), the title's memory windows stay in the PC's memory instead of being mapped into the card's. The reason is in the docs and the README: "on an RTX 3080 10 GB with 32 GB, twice the textures stayed alive without the windows" — on a card that small it is the card's memory the textures lack, not the PC's. A card whose memory is not known keeps the cap, as before, which is the right default for a new heuristic.Why judging it in the runtime is the right place: the launcher cannot know which adapter the runtime took (that is #3049's question, on this same
main), and the comment says so.What I could not test
mapped_capwith a 10 GB card.LEONIDA_WINDOWS_BAR_MBunset means no windows at all, so the whole path is off unless someone sets it — and the two new tests set it synthetically.Written with an AI assistant.
RUN (in game, batch of two pull requests), each head merged with
git merge --no-ffonto maind5b30be1c, in one build: #3035ed7048a14, #3248f4b082e96. RTX 4060 8 GB, driver 610.88, Windows 11. Series S,-Resolution 1080, frame generation 2x,-PrecompileUsed, the same walking route as the other runs on this machine, 330 s after reaching the world.For reference, the same machine and route rendered 13.3 to 17.2 fps on other batches in the last day. These fps are a check that nothing fell over, not a measurement of a gain.
Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch, on the heads listed above. If one of these pull requests changes its head, this run no longer covers it.
Limits: one run; arrival in the world was driven by keys and not checked on pictures;
-PrecompileUsedwas used, so the default start (every known pipeline precompiled) was not exercised. #3248 was also run in a batch on its earlier headefd21d867; this run covers its current head. #3035 acts on cards under 12 GB in PCs of 20 GB or more, which this PC is (8 GB card, 32 GB of RAM); its memory effect was not measured here, only that nothing fell over.AI-assisted (Claude Code).
@MoonEyes thanks for the run of
ed7048a14. The head is now72df6a9f9: onlymain(1a163523d) merged in, because #3230 added a test at the same place intests/test_win_launchers.py. Both tests are kept; this pull request's own runtime and launcher changes are as ined7048a14. The launcher tests (12), the docs tests and the switches check pass on Windows. It still merges after #3031.AI-assisted (Claude Code, Claude Opus 5.5).
Integration check on
72df6a9f9merged onto maind15e048a. The current VRAM reader is the same block as main's. In a disposable copy I used the reader and tests from the existing patch in #2600, keeping this PR's surrounding comments and memory-budget policy. All eleven registry cases passed, as did the seven runnable tests intest_win_launchers.py(five Windows-only skips under Linux PowerShell 7.4.21). This included the title-memory cap and card-threshold test. Results are launcher-side dry runs.One merge-order detail with #3270. Together the branches have 684 runtime switch rows and say 683 in the catalog header, despite a clean textual merge. Regenerating on the combined tree gives 684, and then
--checkand all 21 switch tests pass. The same issue was seen with #3128. AI-assisted with OpenAI Codex.I checked ebbf9f8e merged onto 516c9eaa on native Windows, now that #3279 is in main. I reran the eleven registry cases from #2600 and also asserted LEONIDA_WINDOWS_BAR_CARD_MIN_MB using a synthetic 32 GiB PC. All eleven passed in Windows PowerShell 5.1 and PowerShell 7.
A binary 4 GiB value, including after an unreadable key or an enumeration error, leaves both the launcher window cap and the runtime card minimum unset. A valid larger reading in either order preserves the 3,072 MiB cap and sets the 11,776 MiB minimum for the runtime to apply to the selected card. This covers launcher dry runs only. No game files or GPU workload. AI-assisted with OpenAI Codex.
Profile-M data point for the "Unchanged" rule here: an 8 GB card on a 16 GB PC keeps the windows. The PR says that size was not measured. This is an in-game ABBA of
LEONIDA_WINDOWS_BAR_MB=3072(arm A, what the launcher sets on this PC) against0(arm B).The build is main
516c9eaab+ #3258, not this PR's head. It measures the two settings the rule chooses between, not the runtime rule itself. Numbers recomputed fromsummary.json/memory.csvby a separate agent before posting.Frame rate (MEASURED, 4 ABBA pairs):
Device loss (MEASURED):
play-nvidia.ps1's comment (16 GB PC, RTX 3060, 0x8007000E then a driver fault). ASSUMED: same mechanism; not traced further.Memory, measured runs that count (4 a side, MEASURED):
LEONIDA_WINDOWS_BAR_MB=0What this does and does not show:
@OtavMacedo thank you, that is the size I could not measure. I added it to the text of this pull request, with its limits (
mainwith #3258, the prologue save, not this head).It fits what the rule assumes for PCs under 19 GiB: the windows stay on the card, and without them shared memory comes near Windows' limit. The card being over its budget for most of those runs is the price, and I say so in the text. 8 GB cards on 32 GB PCs are still not measured.
AI-assisted (Claude Code, Claude Opus 5.5).
Check run of this head on profile M, the size the rule keeps as before.
LEONIDA_WINDOWS_BAR_MB=3072andLEONIDA_WINDOWS_BAR_CARD_MIN_MB=6144(settings line). MEASURED.shadow.rswindow_mapped_most,mapped_cap), so it kept the windows.One run, n=1. Its 20.63 fps is not compared with the ABBA's runs, which were a different build (no #3031); same-arm runs on this PC already span 21.0–23.7 fps.
@OtavMacedo thank you for running this head on the 8 GB card with 16 GB of RAM. It confirms that the rule leaves the windows as they were there, which I could only test with a PC of 32 GB.
AI-assisted (Claude Code, Claude Opus 5.5).
Large-card side of the line this pull request draws, next to OtavMacedo's RTX 3070 8 GB result above: an A B B A on an RTX 3090 24 GB (64 GB of RAM, NVIDIA 621.40) in Series X with DLSS, since that is how such a card is likely played. Earlier on the same PC: Series S 540 -2.4 ms and Series X 1440 held -7.86 ms.
The same commit as before, built with DLSS (
--features diagnostics,dlss,mimalloc);-Dlss quality -NoFrameGenwith 2560x1440 out, so DLSS renders 1706x960 (checked on its creation line in every run, no fallback, the world lit in a picture at 300 s). Sender on, standing at the same save, 600 s runs each in its own copy of one warmed-up data folder; from 150 s. A:LEONIDA_WINDOWS_BAR_MB=0(the launcher's value on this PC), B: 8192.So on this card the windows are worth about 6 ms a frame with DLSS quality and about 8 ms at 1440 held. The p90 moved less in pair 2 (-0.9 against -5.9 in pair 1), so the gain at the median is the steadier figure.
AI-assisted: Claude Code (Claude Opus 5.5)
@enlight3d thank you, the DLSS runs are a useful addition on the large side. This pull request changes which PCs get windows on the card (in the launcher and in the runtime), and a 24 GB card is above its line, so it is not touched here.
Main is merged in (the conflict was in
switches.mdonly); head is nowa71e0815f.AI-assisted (Claude Code, Claude Opus 5.5).
Second data point for the size this pull request leaves unchanged (8 GB card, 16 GB PC), after my Series X 1080 one above (comment 19277): the same trade on the launcher's own pick for this PC, Series S with DLSS quality, on current
main, with where the card's memory goes. AI-assisted: Claude Code (Claude Opus 5.5).main30c683055(no pull request applied),diagnostics,dlss,mimalloc; one executable for both arms.-SeriesS -Dlss quality -NoFrameGen(what the launcher picks here),mods/gate_driveridle, 600 s in the world, gate memory stops set to private 32000 MB, commit left 1500 MB, video memory over budget 900 s. A = the play script's default here (LEONIDA_WINDOWS_BAR_MB=3072, shown in each run's settings); B =LEONIDA_WINDOWS_BAR_MB=0in-More. A discarded warm-up (A), then A B B A B A. Run from my main checkout's folder (on this PC the device loss depends on the folder the executable runs from: #2821, comment 25546).LEONIDA_WINDOWS_BAR_MB(PC free memory:
memory.csvsamples from 60 s in the world on. Windows on the card: the device census linecard buffers the CPU maps, median over the same span.)What the runs say, each tagged:
LEONIDA_WINDOWS_BAR_LINE), but the textures and targets made after them take the rest; a lower line for small cards is what I am measuring next (60 against 80), and I will add it here.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.
Follow-up to my comment above (26127), same 8 GB card and 16 GB PC: keeping the play script's 3072 MB of windows but lowering the line under which they go to the card (
LEONIDA_WINDOWS_BAR_LINE, 80 by default) to 60 took about 380 MB of windows off the card and cut its time over budget from 315-330 s to 0-109 s of 600, without the RAM cost that turning the windows off had. AI-assisted: Claude Code (Claude Opus 5.5).main30c683055,diagnostics,dlss,mimalloc, one executable for both arms; RTX 3070 8 GB, resizable BAR, 621.47, 16 GB RAM;-SeriesS -Dlss quality -NoFrameGen,mods/gate_driveridle, 600 s in the world, same gate memory stops, run from my main checkout's folder). A = the defaults here (LEONIDA_WINDOWS_BAR_MB=3072from the play script, line 80); B = the same plusLEONIDA_WINDOWS_BAR_LINE=60in-More(in each B run's settings). A B B A B A, no warm-up this time.(Medians from 60 s in the world on, as in 26127.)
What the runs say, each tagged:
So for the size this pull request leaves unchanged, line 60 (or a line that falls with the card's budget) may be a better default than either 3072 MB at 80 (over budget about half the run) or no windows (RAM near its end, a device loss in 26127). I have not changed anything for this; it is a data point for whoever picks the rule.
GPUs tested: NVIDIA GeForce RTX 3070 8 GB, 621.47, Windows 11, profile M.
The figures in the table were recomputed from the run records by a separate read-only agent before posting (not the 26127 figures, which it could not see).
Opened again as #3496: this pull request came over from GitHub under the name Ghost, and I can no longer push to it. #3496 has the same code (head
b49c09c7c), so the results here still apply to it; new results and reviews please on #3496. A maintainer can close this one. @Otavmacedo, thank you for the two data points since the move; they were on this same code's question.AI-assisted (Claude Code, Claude Opus 5.5).
Closing as a duplicate of #3496, which is the same change re-posted by the same author on this forge: same seven files, 2 changed lines differ. Review and merge happen on #3496.
Closed by Moon's agent during PR triage, on Moon's written authorization.