Repository navigation
d3d12 launcher: 16 GB PCs keep title memory windows on the card up to 95 % of its budget (D3D12-16GB-WINDOWS-BAR-LINE) - #3002
Conversation
… 95 % of its budget (D3D12-16GB-WINDOWS-BAR-LINE)
With a windows cap set (the launcher's 3072 or -WindowsBarMB, not 0), play-nvidia.ps1 now sets
LEONIDA_WINDOWS_BAR_LINE=95 on PCs with under 20 GB of RAM (16 GB class) and a card known to have
8 GB or more (7 GB and up by the driver's key; an RTX 4060 Laptop reads 8,188 MiB). There the PC's
memory runs out before the card's: windows refused at the runtime's line of 80 stay in RAM and frames
stall. RTX 4060 Laptop 8 GB, 16 GB PC, four ABBA pairs: medians 5.8 ms (+-1.9 SE) lower on average,
frame lines over 100 ms 16/116 -> 4/112, the card at about 100 % of its budget.
20 GB and more, 6 GB cards and unknown card sizes keep 80; -More @{LEONIDA_WINDOWS_BAR_LINE='80'}
keeps 80.
|
The new line default is calculated before the final window cap is known. Using this PR's launcher dry-run fixture (16003 MiB RAM, 8188 MiB VRAM) at f777fd4:
The second invocation enables the same 3072 MiB cap as the first through the documented higher-priority option, yet misses the new 95 percent default. Computing that default after the cap overrides have been applied, only if the line itself is still unset, would preserve an explicit line override. These were synthetic settings checks without a game or a performance measurement. Codex-assisted. |
|
Saved F1 values and actual restart arguments show two more ways to miss the intended limit. I used the PR’s PowerShell dry-run fixture at
I also replayed the exact |
…12-16GB-WINDOWS-BAR-LINE) The 95 line was decided before the F1 menu file's values and -More were merged, so a cap set or cleared there got the wrong line (review on ProjectLeonida#3002: -WindowsBarMB 0 with -More cap 3072 -> no line; -More or menu-file cap 0 -> 95; -MenuRestart -WindowsBarMB 0 with saved cap 3072 -> no line). It is now decided after the merge, from the final LEONIDA_WINDOWS_BAR_MB (a whole number > 0, as shadow.rs reads it), and only when neither -More nor the menu file names LEONIDA_WINDOWS_BAR_LINE (an empty value there unsets it, as for any setting). It is never written to the menu file. Tests cover each row of both review tables.
|
Thanks @andrew-ai and @merzleckeier, both right: the line was decided before the final cap was known. Fixed in 09c9e9b. The 95 line is now decided after the launcher's settings, the F1 menu file and New test rows in
The restart replay dropping Tested: AI-assisted: Claude Opus 5.5; reviewed by a separate read-only Claude Opus 5.5 agent. |
|
Rechecked 09c9e9b on Windows. The 14-case launcher test passes. I also supplied conflicting menu-file and -More values in the same dry run using the 16003 MiB RAM / 8188 MiB VRAM fixture. A saved cap of 0 overridden to 3072 produced line 95. A saved cap of 3072 overridden to 0 left the line unset. A saved line of 82 overridden to 87 produced 87. This resolves my cap-precedence finding for a single launch. These checks exercised settings only. Codex-assisted. |
|
Heads-up from #3035 (no action needed now): it changes the same launcher block for the other end - PCs of 20 GB or more with a card under 12 GB keep the title memory windows off the card (measured on an RTX 3080 10 GB / 32 GB, numbers there). The two rules never overlap (yours: under 20 GB), but the files conflict textually, and your test's 32 GB / 8 GB case (32,606 / 8,188 MiB) expecting the 3072 cap would flip with mine. If yours lands first I'll rebase mine onto your Case harness and flip that assertion. |
|
Thanks @Krashgamer, agreed. The two rules don't overlap, so whichever lands second just merges AI-assisted: yes (Claude Opus 5.5) |
Claimed in the coordination issue as: D3D12-16GB-WINDOWS-BAR-LINE (#2570 (comment))
Depends on: none
Related: draft #2658 (8 GB over-budget guard, measured on an RTX 3060 Ti 8 GB with 16 GB RAM) deals with the same 8 GB card / 16 GB RAM case from the card's side. This PR only changes the launcher's windows line and does not depend on it.
What and why
When a windows cap is set (the launcher's own
LEONIDA_WINDOWS_BAR_MB=3072, or-WindowsBarMBother than 0),d3d12/scripts/play-nvidia.ps1now also setsLEONIDA_WINDOWS_BAR_LINE=95on PCs with 16 GB of RAM or less (under 20 GB as Windows counts it; this PC reads 15.6 GB) and a card known to have 8 GB or more. The card check is 7 GB and up by the driver'sHardwareInformation.qwMemorySize, because the RTX 4060 Laptop GPU reads 8,188 MiB.The runtime's default line is 80 (clamped to 50-97,
shadow.rswindow_mapped_line()). Title memory windows go to the card's CPU-mapped GPU_UPLOAD memory only while the card's memory in use plus the window stays under that share of its budget; otherwise they stay in the PC's memory. On a 16 GB PC the PC's memory runs out before the card's: at 80 the refused windows stay in RAM, free memory drops to tens or a few hundred MB, and frames stall.-More @{LEONIDA_WINDOWS_BAR_LINE='80'}keeps 80, because-Moreis applied after the launcher's settings and the F1 menu's.d3d12/README.md, a new section ind3d12/docs/findings.md("The windows' line on a 16 GB PC"), and the oneswitches.mdrow, written astools/d3d12_switches.pygenerates it.Setup:
scripts\play-d3d12.ps1 -SeriesS -Resolution 540 -NoDlss -NoFrameGen, diagnostics build of main 1fff691, the same save restored before each start.LEONIDA_ABcannot switch it during a run.LEONIDA_WINDOWS_BAR_LINE=95, run in the order A B B A A B B A.Frame times:
Memory:
With 95 the card runs at about 100 % of its budget.
Textures (counted at each run's end, runs 2-8):
So B let go about 3 % more texture copies and made about 10 % more again, with slightly more alive. The picture was not compared between the two settings.
LEONIDA_CARD_BUFFERS_MB=512instead of 1536 (one run) was far worse: median 115.9 ms, with the card 95 % busy.Not measured: PCs under 16 GB or of 20-47 GB, other cards, AMD.
Tested
python -I tests/test_win_launchers.py, new testtest_nvidia_windows_bar_line_on_16_gb_pcs_with_8_gb_cards. RAM and card memory are mocked at what this PC reads (16,003 and 8,188 MiB). Cases:-Moreline 80: line 80-WindowsBarMB 3072: line 95-WindowsBarMB 0: no lined3d12/scripts/play-nvidia.ps1taken from main (None != '95') and passes with the change. Done by hand:scripts/red_green.pywould have put its worktree inside the user's play checkout.python -m unittest discover -s tests -p "test_docs_*.py"passes.python -I tests/test_d3d12_switches.pypasses (20 tests).python -I scripts/check_no_game_data.pyon the changed files is clean.GPUs tested: NVIDIA GeForce RTX 4060 Laptop GPU 8 GB, driver 610.62, Windows 11 Home, i7-13650HX, 16 GB RAM
AI-assisted: yes. Claude Opus 5.5 led and implemented the change. A separate read-only reviewer agent, also Claude Opus 5.5, audited the diff twice; everything it marked as a blocker or should-fix was addressed.
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a)