Textures: VICTORY_SMALL_ROOM_PERCENT, the share of the budget under which small stand-ins are still made (97 by default) #4228

Closed
github-bot wants to merge 11 commits from github-bot/gh-4227 into main AGit
Owner

@⁠Denkiyaa on GitHub · 2026-11-30 17:36 UTC · original
Denkiyaa:pr/small-room-percent → main · +804 −823 · 32 files · 11 commits · closed without merging

Fixes #

What it changes

A texture that has to wait for room gets a small stand-in made from its lowest levels (VICTORY_SMALL_WHEN_FULL), but resource::small_room makes none once the layer is past 97 % of the card's budget. On Windows that is right: past the system's budget the card's memory spills into the PC's. Under Linux NVIDIA's driver spills nothing, and a budget set below what the card has free (VICTORY_VRAM_BUDGET_MB, which under Proton has to be set below the free memory, see docs/linux-proton.md) leaves real room past it. There the layer sits just over its budget the whole session, and the 97 % gate refuses almost every stand-in.

Observed in 8 minutes of play on main c71899d9, under Proton (RTX 5070 Ti, budget 5,000 MB under the card's free memory): 1,723,030 stand-ins not made for "the card past 97 %", 9,541 made, 7,484 textures waiting on average. A slot without a stand-in reads as nothing, and alpha-tested foliage then discards every pixel until the sweep frees room: trees disappearing and coming back.

This PR makes the share a switch, VICTORY_SMALL_ROOM_PERCENT (read once; 97 by default, so nothing changes unless it is set; clamped to 50-200). Above 100 it is measured against the same budget, so 115 lets the layer go 15 % past it for small stand-ins. The doc comment says it is only for a budget set below what the card has free, not for the system's own budget on Windows. The small-copies line now names the share in use instead of a fixed "97 %".

Files: crates/victory-gpu/src/resource.rs (the switch, small_room), crates/victory-gpu/src/host.rs (the line's text).

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): RTX 5070 Ti 16 GB, Ryzen 7 9800X3D, 32 GB RAM, Linux under Proton (GE-Proton11-15), Series S profile, DLSS Quality, DLSS frame generation 3X; budget 5,000 MB under the card's free memory (~8.2 GB). Measured on a branch of this repository carrying other ports besides this change.
  • Before (97, four runs of 120 s of scripted travel): 71,813 to 295,806 stand-ins not made for the card past 97 %; textures waiting at most 7,425 to 12,216.
  • After (VICTORY_SMALL_ROOM_PERCENT=115, two runs of 120 s of scripted travel): none not made for that reason; textures waiting at most 4,329 and 5,971; the card's total use 13.5-13.7 of 16.3 GB, as before.
  • Not shown: the scripted route varied between runs, so the two settings were not measured on the same route; and nobody watched the foliage during the runs: the counters are the evidence, not a picture. Not measured on Windows, where the default of 97 stays the right one with the system's budget.
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): no shader change.
  • cargo test passed for the crates it touches: no, not run. victory-gpu's tests need Windows, and this was prepared on Linux. What was run: cargo xwin clippy -p victory-gpu --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings on this branch (cut from main 84bd61e2): it builds; the only two findings are main's own, in lines this PR does not touch (method ranged is never used in shadow.rs:7197, manual implementation of .is_multiple_of() in host.rs:5092), and with those two lints allowed it passes with no other warning. cargo xtask policy --staged passed.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: none change small_room's gate. #3918 changes the texture room line and slot eviction's percentages in resource.rs (other functions, no textual overlap expected); #3602 (8 GB cards, card use past the vkd3d cap) is about the budget under vkd3d as well, from the other side.

Written with Claude Code (Claude Opus 5.5): the measurements were run by me on my PC; the code and this text were prepared with it.

🤖 Generated with Claude Code

**@⁠Denkiyaa** on GitHub · 2026-11-30 17:36 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4227) `Denkiyaa:pr/small-room-percent` → `main` · +804 −823 · 32 files · 11 commits · closed without merging <!-- Thanks for the pull request. Please label it (pr-fix, pr-feature, pr-performance, pr-diagnostics, pr-refactor, pr-docs or pr-tests, plus the area labels), or put the label in the title, like [pr-fix]. --> Fixes # ## What it changes A texture that has to wait for room gets a small stand-in made from its lowest levels (`VICTORY_SMALL_WHEN_FULL`), but `resource::small_room` makes none once the layer is past 97 % of the card's budget. On Windows that is right: past the system's budget the card's memory spills into the PC's. Under Linux NVIDIA's driver spills nothing, and a budget set below what the card has free (`VICTORY_VRAM_BUDGET_MB`, which under Proton has to be set below the free memory, see `docs/linux-proton.md`) leaves real room past it. There the layer sits just over its budget the whole session, and the 97 % gate refuses almost every stand-in. Observed in 8 minutes of play on main c71899d9, under Proton (RTX 5070 Ti, budget 5,000 MB under the card's free memory): 1,723,030 stand-ins not made for "the card past 97 %", 9,541 made, 7,484 textures waiting on average. A slot without a stand-in reads as nothing, and alpha-tested foliage then discards every pixel until the sweep frees room: trees disappearing and coming back. This PR makes the share a switch, `VICTORY_SMALL_ROOM_PERCENT` (read once; 97 by default, so nothing changes unless it is set; clamped to 50-200). Above 100 it is measured against the same budget, so 115 lets the layer go 15 % past it for small stand-ins. The doc comment says it is only for a budget set below what the card has free, not for the system's own budget on Windows. The small-copies line now names the share in use instead of a fixed "97 %". Files: `crates/victory-gpu/src/resource.rs` (the switch, `small_room`), `crates/victory-gpu/src/host.rs` (the line's text). ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): RTX 5070 Ti 16 GB, Ryzen 7 9800X3D, 32 GB RAM, Linux under Proton (GE-Proton11-15), Series S profile, DLSS Quality, DLSS frame generation 3X; budget 5,000 MB under the card's free memory (~8.2 GB). Measured on a branch of this repository carrying other ports besides this change. - Before (97, four runs of 120 s of scripted travel): 71,813 to 295,806 stand-ins not made for the card past 97 %; textures waiting at most 7,425 to 12,216. - After (`VICTORY_SMALL_ROOM_PERCENT=115`, two runs of 120 s of scripted travel): none not made for that reason; textures waiting at most 4,329 and 5,971; the card's total use 13.5-13.7 of 16.3 GB, as before. - **Not shown:** the scripted route varied between runs, so the two settings were not measured on the same route; and nobody watched the foliage during the runs: the counters are the evidence, not a picture. Not measured on Windows, where the default of 97 stays the right one with the system's budget. - For shader changes, the wave sizes tested (32 and/or 64 lanes): no shader change. - `cargo test` passed for the crates it touches: no, not run. `victory-gpu`'s tests need Windows, and this was prepared on Linux. What was run: `cargo xwin clippy -p victory-gpu --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings` on this branch (cut from main 84bd61e2): it builds; the only two findings are main's own, in lines this PR does not touch (`method ranged is never used` in `shadow.rs:7197`, `manual implementation of .is_multiple_of()` in `host.rs:5092`), and with those two lints allowed it passes with no other warning. `cargo xtask policy --staged` passed. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: none change `small_room`'s gate. #3918 changes the texture room line and slot eviction's percentages in `resource.rs` (other functions, no textual overlap expected); #3602 (8 GB cards, card use past the vkd3d cap) is about the budget under vkd3d as well, from the other side. --- Written with Claude Code (Claude Opus 5.5): the measurements were run by me on my PC; the code and this text were prepared with it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
small_room's gate is a fixed 97 % of the card's budget: past it no small
stand-in is made for a texture waiting for room, because on Windows the
card's memory then spills into the PC's. Under Linux the driver spills
nothing, and a budget set below what the card has free
(VICTORY_VRAM_BUDGET_MB) leaves real room past it. In 8 minutes of play
under Proton (RTX 5070 Ti) the layer stood just over such a budget the
whole time: 1,723,030 stand-ins not made for "the card past 97 %", 9,541
made, 7,484 textures waiting on average. A slot without a stand-in reads
as nothing, and alpha-tested foliage then discards every pixel until a
sweep makes room.

The switch is read once, 97 by default (unchanged), clamped to 50-200,
measured against the same budget above 100; the small-copies line names
the share. At 115, two runs of 120 s of scripted travel (frame generation
3X): none not made (71,813 to 295,806 in four runs at 97), textures
waiting at most 4,329 and 5,971 (7,425 to 12,216), the card's total
13.5-13.7 of 16.3 GB as before. The route was not the same for both
settings, and the foliage was not watched: the counters are the evidence.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 18:09:04 +00:00
github-bot closed this pull request 2026-12-01 18:50:25 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:45 UTC · original

Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:45 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4227#issuecomment-7321478912) Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

Pull request closed

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!4228
No description provided.