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

Open
NICKNAMErutschovkonikovan wants to merge 2 commits from upstream-pr/4893 into main
NICKNAMErutschovkonikovan commented 2026-12-01 13:07:55 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by NICKNAMErutschovkonikovan on 2026-12-01T13:07:55Z.


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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5586326418 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4893). Originally posted by [NICKNAMErutschovkonikovan](https://github.com/NICKNAMErutschovkonikovan) on 2026-12-01T13:07:55Z. --- ## 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)
cloph-dsp commented 2026-12-01 13:42:35 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by cloph-dsp on 2026-12-01T13:42:35Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7313049825 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4893#issuecomment-7313049825). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-12-01T13:42:35Z. --- 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.
andrewpozdnakov7-jpg commented 2026-12-01 14:24:18 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-12-01T14:24:18Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7314195816 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4893#issuecomment-7314195816). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-12-01T14:24:18Z. --- 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.
NICKNAMErutschovkonikovan commented 2026-12-01 14:45:45 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by NICKNAMErutschovkonikovan on 2026-12-01T14:45:45Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7314785627 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4893#issuecomment-7314785627). Originally posted by [NICKNAMErutschovkonikovan](https://github.com/NICKNAMErutschovkonikovan) on 2026-12-01T14:45:45Z. --- 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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/4893:upstream-pr/4893'
git switch 'upstream-pr/4893'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/4893'
git switch 'upstream-pr/4893'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/4893'
git switch 'upstream-pr/4893'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/4893'
git switch 'main'
git merge --squash 'upstream-pr/4893'
git switch 'main'
git merge --ff-only 'upstream-pr/4893'
git switch 'main'
git merge 'upstream-pr/4893'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

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