Big cards: windows in card memory the CPU maps up to a quarter of the budget (VICTORY_VRAM_WINDOWS_BAR=1) #4894

Open
github-bot wants to merge 2 commits from github-bot/gh-4893 into main AGit
Owner

@⁠NICKNAMErutschovkonikovan on GitHub · 2026-12-01 13:07 UTC · original
NICKNAMErutschovkonikovan:pr/vram-windows-bar → main · +68 −6 · 2 files · 2 commits · open

What it changes

Adds an opt-in switch, VICTORY_VRAM_WINDOWS_BAR=1. On a card with a budget of 20 GiB or more whose memory the CPU can map (GPU_UPLOAD, resizable BAR), it raises the default cap for windows outside buffers in card memory the CPU maps. The default is normally the 4096 MiB that window_mapped_default gives a card of 14 GiB or more. With the switch it becomes a quarter of the card's budget, for example 7854 MiB on an RTX 5090 with a 31,419 MB budget. All of the title's windows can then sit in card memory: they have no CPU side in shared memory and nothing to send.

  • Small hosts (small shared budget, or under 24 GB of RAM) keep their 4096/3072 MiB.
  • An explicit VICTORY_WINDOWS_BAR_MB, 0 included, still wins.
  • Smaller cards and cards without mappable memory don't change (big_card_windows_mb_of returns 0).
  • When the switch takes effect, it logs one INFO line with the cap.
  • The README settings table lists the switch.

Default: off (asked_for!). The measurements below compared the switch with no windows in mapped card memory at all. They were taken before main gave 14 GiB+ cards 4096 MiB by itself (ae8fa941). Nobody has measured what raising the cap from 4096 MiB to a quarter of the budget gains on its own, so the switch stays opt-in until someone does.

How it was tested

  • Branch commit: 6c7d884b (on main 5fabb46e).
  • cargo test -p victory-gpu --lib --locked: 1096 passed, 0 failed, 66 ignored. This includes the new shadow::window_tests::windows_go_to_mapped_card_memory_on_big_cards_only, which needs no GPU or game data.
  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: fails only on lints that already fail on main in files this branch doesn't touch:
    • host/font.rs:213 and :260: too_many_arguments
    • host/menu.rs:667: manual_is_multiple_of
    • host/panel.rs:602 and :668: collapsible_if
  • This branch wasn't run in the game. The numbers below come from the reference change. They were measured on an RTX 5090 with a Ryzen 7 5800X3D, on a combined build that also had other changes, with the switch on by default there:
    • GPU and profile: RTX 5090, 1440p, 120 s per run, runs in the order OFF ON ON OFF ON OFF.
    • Before (OFF, no windows in mapped card memory): 17.8, 17.6 and 17.1 fps (56.3, 56.8 and 58.7 ms). Card's own memory 15.6-15.9 GB, shared with the card 7.8-8.1 GB, committed 35.1 GB.
    • After (ON): 18.6, 18.4 and 18.5 fps (53.9, 54.8 and 54.6 ms), 17.5 against 18.5 fps on average (+6 %). Card's own memory 14.7-15.0 GB, shared 3.8-4.0 GB, committed 30.0-30.3 GB. All 912 windows (5.65 GB) sat in card memory alone. No new kinds of warnings.
    • Not measured: this switch against main's 4096 MiB default for 14 GiB+ cards.
  • For shader changes, the wave sizes tested: not applicable.
  • cargo test passed for the crates it touches: yes (victory-gpu --lib)

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #3791 (requires at least 8 GiB of dedicated VRAM budget for the automatic BAR defaults). It sets when the defaults apply; this PR makes the windows larger on big cards, opt-in. No open pull request changes the windows' size on big cards.

🤖 Generated with Claude Code

**@⁠NICKNAMErutschovkonikovan** on GitHub · 2026-12-01 13:07 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4893) `NICKNAMErutschovkonikovan:pr/vram-windows-bar` → `main` · +68 −6 · 2 files · 2 commits · open ## What it changes Adds an opt-in switch, `VICTORY_VRAM_WINDOWS_BAR=1`. On a card with a budget of 20 GiB or more whose memory the CPU can map (`GPU_UPLOAD`, resizable BAR), it raises the default cap for windows outside buffers in card memory the CPU maps. The default is normally the 4096 MiB that `window_mapped_default` gives a card of 14 GiB or more. With the switch it becomes a quarter of the card's budget, for example 7854 MiB on an RTX 5090 with a 31,419 MB budget. All of the title's windows can then sit in card memory: they have no CPU side in shared memory and nothing to send. - Small hosts (small shared budget, or under 24 GB of RAM) keep their 4096/3072 MiB. - An explicit `VICTORY_WINDOWS_BAR_MB`, 0 included, still wins. - Smaller cards and cards without mappable memory don't change (`big_card_windows_mb_of` returns 0). - When the switch takes effect, it logs one INFO line with the cap. - The README settings table lists the switch. **Default: off (`asked_for!`).** The measurements below compared the switch with no windows in mapped card memory at all. They were taken before `main` gave 14 GiB+ cards 4096 MiB by itself (ae8fa941). Nobody has measured what raising the cap from 4096 MiB to a quarter of the budget gains on its own, so the switch stays opt-in until someone does. ## How it was tested - Branch commit: 6c7d884b (on `main` 5fabb46e). - `cargo test -p victory-gpu --lib --locked`: 1096 passed, 0 failed, 66 ignored. This includes the new `shadow::window_tests::windows_go_to_mapped_card_memory_on_big_cards_only`, which needs no GPU or game data. - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings`: fails only on lints that already fail on `main` in files this branch doesn't touch: - `host/font.rs:213` and `:260`: `too_many_arguments` - `host/menu.rs:667`: `manual_is_multiple_of` - `host/panel.rs:602` and `:668`: `collapsible_if` - **This branch wasn't run in the game.** The numbers below come from the reference change. They were measured on an RTX 5090 with a Ryzen 7 5800X3D, on a combined build that also had other changes, with the switch on by default there: - GPU and profile: RTX 5090, 1440p, 120 s per run, runs in the order OFF ON ON OFF ON OFF. - Before (OFF, no windows in mapped card memory): 17.8, 17.6 and 17.1 fps (56.3, 56.8 and 58.7 ms). Card's own memory 15.6-15.9 GB, shared with the card 7.8-8.1 GB, committed 35.1 GB. - After (ON): 18.6, 18.4 and 18.5 fps (53.9, 54.8 and 54.6 ms), 17.5 against 18.5 fps on average (+6 %). Card's own memory 14.7-15.0 GB, shared 3.8-4.0 GB, committed 30.0-30.3 GB. All 912 windows (5.65 GB) sat in card memory alone. No new kinds of warnings. - Not measured: this switch against `main`'s 4096 MiB default for 14 GiB+ cards. - For shader changes, the wave sizes tested: not applicable. - `cargo test` passed for the crates it touches: yes (`victory-gpu --lib`) ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #3791 (requires at least 8 GiB of dedicated VRAM budget for the automatic BAR defaults). It sets when the defaults apply; this PR makes the windows larger on big cards, opt-in. No open pull request changes the windows' size on big cards. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
With VICTORY_VRAM_WINDOWS_BAR=1, a card whose budget is 20 GiB or more and
whose memory can be mapped (GPU_UPLOAD) takes windows outside buffers into
card memory the CPU maps up to a quarter of its budget (7854 MiB on an
RTX 5090) instead of the 4096 MiB that window_mapped_default gives a card
of 14 GiB or more. Small hosts keep their 4096/3072, and an explicit
VICTORY_WINDOWS_BAR_MB (0 included) still decides. The switch is read with
asked_for!, so it is off unless set to 1; README lists it.

Evidence, from the reference change (RTX 5090, Ryzen 7 5800X3D, 1440p,
120 s each, OFF ON ON OFF ON OFF, on a combined build with other changes):
17.8 18.6 18.4 17.6 18.5 17.1 fps (17.5 against 18.5, +6 %), 56.3 53.9
54.8 56.8 54.6 58.7 ms. Memory, OFF: the card's own 15.6-15.9 GB, the PC's
shared with the card 7.8-8.1 GB, committed 35.1 GB; ON: 14.7-15.0 GB,
3.8-4.0 GB, 30.0-30.3 GB. All 912 windows (5.65 GB) lay on the card alone.

Why off by default: OFF in those runs meant no windows in mapped card
memory at all; it was measured before main gave 14 GiB+ cards 4096 MiB by
itself (ae8fa941). What the step from 4096 MiB to a quarter of the budget
gains on its own has not been measured, so it stays opt-in until it is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 13:10:25 +00:00
Author
Owner

@⁠cloph-dsp on GitHub · 2026-12-01 13:42 UTC · original

Verification (independent, AI-assisted: Hy4 flash). Windows, Rust 1.100.0 (Scoop rust-msvc), MSVC, commit-scoped shallow worktree.

Base 5fabb46eaf6ed8771321787f8871051abde69b9b, head 6c7d884b1275b27ad00a6c051bdb5fc111c5a3d4. git diff --numstat → README.md 1/0, crates/victory-gpu/src/shadow.rs 61/5.

As with the neighbouring PRs tonight, window_line_keeps_the_room_held_for_targets already exists on the base (git grep -F on 5fabb46e matches shadow.rs), so this is an extension of an existing test, not a new one; the new part covers the mapped-window budget line.

git diff --check "5fabb46e..6c7d884b" → no output, exit 0.

$env:CARGO_TARGET_DIR='D:\Victory-Contrib\NVIDIA-Contrib\target-4893'
cargo test --locked -p victory-gpu --lib -- shadow::window_tests::window_line_keeps_the_room_held_for_targets --exact --test-threads=1 --quiet

Result: running 1 test, test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1161 filtered out.

Budget arithmetic only, no device opened; GPU/driver N/A. No game data.

**@⁠cloph-dsp** on GitHub · 2026-12-01 13:42 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4893#issuecomment-7313049825) Verification (independent, AI-assisted: Hy4 flash). Windows, Rust 1.100.0 (Scoop rust-msvc), MSVC, commit-scoped shallow worktree. Base `5fabb46eaf6ed8771321787f8871051abde69b9b`, head `6c7d884b1275b27ad00a6c051bdb5fc111c5a3d4`. `git diff --numstat` → README.md 1/0, crates/victory-gpu/src/shadow.rs 61/5. As with the neighbouring PRs tonight, `window_line_keeps_the_room_held_for_targets` already exists on the base (git grep -F on `5fabb46e` matches shadow.rs), so this is an extension of an existing test, not a new one; the new part covers the mapped-window budget line. `git diff --check "5fabb46e..6c7d884b"` → no output, exit 0. ``` $env:CARGO_TARGET_DIR='D:\Victory-Contrib\NVIDIA-Contrib\target-4893' cargo test --locked -p victory-gpu --lib -- shadow::window_tests::window_line_keeps_the_room_held_for_targets --exact --test-threads=1 --quiet ``` Result: `running 1 test`, `test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1161 filtered out`. Budget arithmetic only, no device opened; GPU/driver N/A. No game data.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-12-01 14:24 UTC · original

On 6c7d884b, window_mapped_most calls big_card_windows_mb() before applying the explicit VICTORY_WINDOWS_BAR_MB override. On a qualifying host with both VICTORY_VRAM_WINDOWS_BAR=1 and VICTORY_WINDOWS_BAR_MB=0, startup can log a positive windows_bar_mb even though the effective cap is zero. Could the explicit override be resolved before computing and logging the automatic cap? This is from static review.

AI-assisted with OpenAI Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-12-01 14:24 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4893#issuecomment-7314195816) On `6c7d884b`, `window_mapped_most` calls `big_card_windows_mb()` before applying the explicit `VICTORY_WINDOWS_BAR_MB` override. On a qualifying host with both `VICTORY_VRAM_WINDOWS_BAR=1` and `VICTORY_WINDOWS_BAR_MB=0`, startup can log a positive `windows_bar_mb` even though the effective cap is zero. Could the explicit override be resolved before computing and logging the automatic cap? This is from static review. AI-assisted with OpenAI Codex.
With VICTORY_VRAM_WINDOWS_BAR=1 and VICTORY_WINDOWS_BAR_MB=0 the start
logged a positive cap for the very big card although the cap in force was
zero (review on #4893). The explicit value is read first; the automatic cap
is computed, and logged, only without it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

@⁠NICKNAMErutschovkonikovan on GitHub · 2026-12-01 14:45 UTC · original

Thanks for the check and the review. Fixed in the latest commit on this branch: an explicit VICTORY_WINDOWS_BAR_MB (0 included) is read first, and the big card's cap is only computed and logged without it. cargo test -p victory-gpu --lib -- shadow::window: 22 passed.

**@⁠NICKNAMErutschovkonikovan** on GitHub · 2026-12-01 14:45 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4893#issuecomment-7314785627) Thanks for the check and the review. Fixed in the latest commit on this branch: an explicit `VICTORY_WINDOWS_BAR_MB` (0 included) is read first, and the big card's cap is only computed and logged without it. `cargo test -p victory-gpu --lib -- shadow::window`: 22 passed.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/4894/head:github-bot/gh-4893'
git switch 'github-bot/gh-4893'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4893'
git switch 'github-bot/gh-4893'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4893'
git switch 'github-bot/gh-4893'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4893'
git switch 'main'
git merge --squash 'github-bot/gh-4893'
git switch 'main'
git merge --ff-only 'github-bot/gh-4893'
git switch 'main'
git merge 'github-bot/gh-4893'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!4894
No description provided.