Scale automatic framegen texture room reserve in bytes on large-VRAM GPUs #4902

Open
github-bot wants to merge 1 commit from github-bot/gh-4901 into main AGit
Owner

@⁠Andreww2009 on GitHub · 2026-12-01 13:15 UTC · original
Andreww2009:perf/framegen-byte-vram-reserve → main · +34 −1 · 1 files · 1 commits · open

What it changes

When victory play enables frame generation, it sets VICTORY_TEXTURE_ROOM_PERCENT=80 together with VICTORY_FRAMEGEN_ROOM_RESERVE=1. On an 8 GB GPU (~7 GiB DXGI budget), 20% leaves ~1.4 GiB free for Streamline / optical flow buffers. On a 16 GB GPU (~14.6 GiB DXGI budget), the same 20% leaves ~2.9 GiB unused and lowers the texture ceiling to ~11.4 GiB, causing premature no room, new textures wait stalls, SMALL_WHEN_FULL mip downgrades, and shared-RAM spilling.

In room_line_for (crates/victory-gpu/src/resource.rs), when framegen_reserve && framegen_available is true, scale the automatic reserve in bytes (1,408 MiB, capped at 92% of budget) while keeping the existing 80% floor for <= 8 GB budgets and honouring explicit user VICTORY_TEXTURE_ROOM_PERCENT overrides (framegen_reserve == false) verbatim. Adds unit test framegen_reserve_scales_in_bytes_on_large_vram_cards.

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): NVIDIA GeForce RTX 5080 Laptop GPU (16 GB GDDR7, ~14,574 MiB DXGI budget, driver 621.14), Intel Core Ultra 9 275HX, Series X, 2560x1440, DLSS Quality, DLSS Frame Generation 2X, RT off. Tested on commit 5ef350a9 (isolated branch on origin/main 5fabb46e) and in combined local Release build 139968c3.
  • Before: With 80% automatic framegen cap (victory-nvidia-play-20261201-093452-2728.log / NS-C4-fg2x), texture ceiling stayed at 11,403–11,774 MB, logging 35 no room stalls, 61,376 SMALL_WHEN_FULL downgrades (3,899 waiting to grow), up to 6,600 MB shared RAM usage, 85 frames >50 ms, and 169.9 ms worst frame spike.
  • After: In NS-C5-fg2x (unattended pass-through presented=1 with active Streamline FG proxy), texture ceiling rose to 13,319 MB (90.4%, +1,545 MB), waiting to grow dropped to 38 (-99%), shared RAM dropped by 1,072 MB, frames >50 ms dropped to 28 (-67.1%), frames >100 ms dropped to 0, and worst spike dropped to 61.8 ms (-63.6%). Note: live run was measured in the combined C5 build (139968c3); 5ef350a9 alone was verified via cargo test and clippy.
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): n/a (no shader changes).
  • cargo test passed for the crates it touches: yes (cargo test -p victory-gpu --lib: 1,105 passed, 0 failed; framegen_reserve_scales_in_bytes_on_large_vram_cards passed; cargo clippy -p victory-gpu --all-targets -- -D warnings reported 0 warnings in resource.rs, only 3 pre-existing warnings on origin/main 5fabb46e in untouched host/{font,menu}.rs).

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #4746 (also touches crates/victory-gpu/src/resource.rs, unrelated grow_small pass limit; no open PR touches room_line_for).
**@⁠Andreww2009** on GitHub · 2026-12-01 13:15 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4901) `Andreww2009:perf/framegen-byte-vram-reserve` → `main` · +34 −1 · 1 files · 1 commits · open ## What it changes When `victory play` enables frame generation, it sets `VICTORY_TEXTURE_ROOM_PERCENT=80` together with `VICTORY_FRAMEGEN_ROOM_RESERVE=1`. On an 8 GB GPU (~7 GiB DXGI budget), 20% leaves ~1.4 GiB free for Streamline / optical flow buffers. On a 16 GB GPU (~14.6 GiB DXGI budget), the same 20% leaves ~2.9 GiB unused and lowers the texture ceiling to ~11.4 GiB, causing premature `no room, new textures wait` stalls, `SMALL_WHEN_FULL` mip downgrades, and shared-RAM spilling. In `room_line_for` (`crates/victory-gpu/src/resource.rs`), when `framegen_reserve && framegen_available` is true, scale the automatic reserve in bytes (`1,408 MiB`, capped at 92% of budget) while keeping the existing 80% floor for <= 8 GB budgets and honouring explicit user `VICTORY_TEXTURE_ROOM_PERCENT` overrides (`framegen_reserve == false`) verbatim. Adds unit test `framegen_reserve_scales_in_bytes_on_large_vram_cards`. ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): NVIDIA GeForce RTX 5080 Laptop GPU (16 GB GDDR7, ~14,574 MiB DXGI budget, driver 621.14), Intel Core Ultra 9 275HX, Series X, 2560x1440, DLSS Quality, DLSS Frame Generation 2X, RT off. Tested on commit `5ef350a9` (isolated branch on `origin/main` `5fabb46e`) and in combined local Release build `139968c3`. - Before: With 80% automatic framegen cap (`victory-nvidia-play-20261201-093452-2728.log` / `NS-C4-fg2x`), texture ceiling stayed at `11,403–11,774 MB`, logging `35` `no room` stalls, `61,376` `SMALL_WHEN_FULL` downgrades (`3,899` waiting to grow), up to `6,600 MB` shared RAM usage, `85` frames >50 ms, and `169.9 ms` worst frame spike. - After: In `NS-C5-fg2x` (unattended pass-through `presented=1` with active Streamline FG proxy), texture ceiling rose to `13,319 MB` (`90.4%`, `+1,545 MB`), `waiting to grow` dropped to `38` (`-99%`), shared RAM dropped by `1,072 MB`, frames >50 ms dropped to `28` (`-67.1%`), frames >100 ms dropped to `0`, and worst spike dropped to `61.8 ms` (`-63.6%`). Note: live run was measured in the combined C5 build (`139968c3`); `5ef350a9` alone was verified via `cargo test` and `clippy`. - For shader changes, the wave sizes tested (32 and/or 64 lanes): n/a (no shader changes). - `cargo test` passed for the crates it touches: yes (`cargo test -p victory-gpu --lib`: 1,105 passed, 0 failed; `framegen_reserve_scales_in_bytes_on_large_vram_cards` passed; `cargo clippy -p victory-gpu --all-targets -- -D warnings` reported 0 warnings in `resource.rs`, only 3 pre-existing warnings on `origin/main` `5fabb46e` in untouched `host/{font,menu}.rs`). ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #4746 (also touches `crates/victory-gpu/src/resource.rs`, unrelated `grow_small` pass limit; no open PR touches `room_line_for`).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 13:21:34 +00:00
Author
Owner

@⁠gut0to on GitHub · 2026-12-01 15:12 UTC · original · reviewed

AI-assisted review: I checked the new frame-generation reserve branch and its unit test. I used AI assistance and verified the untested fallback against the current code.

**@⁠gut0to** on GitHub · 2026-12-01 15:12 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4901#pullrequestreview-6134106318) · **reviewed** AI-assisted review: I checked the new frame-generation reserve branch and its unit test. I used AI assistance and verified the untested fallback against the current code.
@ -3061,2 +3061,3 @@
}
percent.map_or_else(|| line_for(budget), |p| budget / 100 * p.clamp(50, 97))
let line = percent.map_or_else(|| line_for(budget), |p| budget / 100 * p.clamp(50, 97));
if framegen_reserve && framegen_available {
Author
Owner

@⁠gut0to on GitHub · 2026-12-01 15:12 UTC · original

Could this test also cover framegen_reserve=true, framegen_available=false? The new byte-scaled path is tested only when the backend is available, while the separate fallback above deliberately retains the old conservative percentage cap. A large-budget case asserting the fallback stays at 80% (and a lower explicit percentage remains lower) would protect the no-frame-generation path from accidentally inheriting the new increase.

**@⁠gut0to** on GitHub · 2026-12-01 15:12 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4901#discussion_r4756273853) Could this test also cover `framegen_reserve=true, framegen_available=false`? The new byte-scaled path is tested only when the backend is available, while the separate fallback above deliberately retains the old conservative percentage cap. A large-budget case asserting the fallback stays at 80% (and a lower explicit percentage remains lower) would protect the no-frame-generation path from accidentally inheriting the new increase.
Author
Owner

@⁠cloph-dsp on GitHub · 2026-12-01 15:29 UTC · original

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

Base 5fabb46eaf6ed8771321787f8871051abde69b9b, head 5ef350a918461c7e758b623e8b361f3089e8b34b. git diff --numstat → crates/victory-gpu/src/resource.rs 34/1.

One test is added and its name is new on the base — git grep -F framegen_reserve_scales_in_bytes_on_large_vram_cards 5fabb46e -- . returns no match:
resource::tests::framegen_reserve_scales_in_bytes_on_large_vram_cards, at resource.rs:8399.

It asserts room_line_for(budget, floor_pct, framegen_reserve, available) over six literal cases: 7,000 MiB at 80%, 10,800 MiB and 14,574 MiB both keeping a flat 1,408 MiB reserve, 22,000 MiB capped at 92%, and two explicit-override cases (75% and 80% with framegen_reserve = false) that keep the floor verbatim.

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

$env:CARGO_TARGET_DIR='D:\Victory-Contrib\NVIDIA-Contrib\target-4901'
cargo test --locked -p victory-gpu --lib -- resource::tests::framegen_reserve_scales_in_bytes_on_large_vram_cards --exact --test-threads=1 --quiet

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

Budgets are passed as literals; no adapter is queried, GPU/driver N/A. No game data.

**@⁠cloph-dsp** on GitHub · 2026-12-01 15:29 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4901#issuecomment-7316002851) Verification (independent, AI-assisted: Hy4 flash). Windows, Rust 1.100.0 (Scoop rust-msvc), MSVC, commit-scoped shallow worktree, per-worktree CARGO_TARGET_DIR. Base `5fabb46eaf6ed8771321787f8871051abde69b9b`, head `5ef350a918461c7e758b623e8b361f3089e8b34b`. `git diff --numstat` → crates/victory-gpu/src/resource.rs 34/1. One test is added and its name is new on the base — `git grep -F framegen_reserve_scales_in_bytes_on_large_vram_cards 5fabb46e -- .` returns no match: `resource::tests::framegen_reserve_scales_in_bytes_on_large_vram_cards`, at resource.rs:8399. It asserts `room_line_for(budget, floor_pct, framegen_reserve, available)` over six literal cases: 7,000 MiB at 80%, 10,800 MiB and 14,574 MiB both keeping a flat 1,408 MiB reserve, 22,000 MiB capped at 92%, and two explicit-override cases (75% and 80% with `framegen_reserve = false`) that keep the floor verbatim. `git diff --check "5fabb46e..5ef350a9"` → no output, exit 0. ``` $env:CARGO_TARGET_DIR='D:\Victory-Contrib\NVIDIA-Contrib\target-4901' cargo test --locked -p victory-gpu --lib -- resource::tests::framegen_reserve_scales_in_bytes_on_large_vram_cards --exact --test-threads=1 --quiet ``` Result: `running 1 test`, `test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1161 filtered out; finished in 0.00s`. Budgets are passed as literals; no adapter is queried, GPU/driver N/A. No game data.
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/4902/head:github-bot/gh-4901'
git switch 'github-bot/gh-4901'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4901'
git switch 'github-bot/gh-4901'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4901'
git switch 'github-bot/gh-4901'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4901'
git switch 'main'
git merge --squash 'github-bot/gh-4901'
git switch 'main'
git merge --ff-only 'github-bot/gh-4901'
git switch 'main'
git merge 'github-bot/gh-4901'
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!4902
No description provided.