Pool: empty blocks kept follow the card's headroom below 85% (VICTORY_SPARES_BY_HEADROOM=1, off) (#94) #285

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

@⁠GDemay on GitHub · 2026-11-26 14:23 UTC · original
GDemay:perf/spares-by-headroom → main · +53 −3 · 1 files · 1 commits · open

What and why

spares() (crates/victory-gpu/src/pool.rs) keeps either 2 blocks or all 64 (4 GiB) by a binary line at 85 % of the card's budget, whatever headroom is actually left below it. On 8-16 GB cards that overshoots: a 16 GB card 12 GB in held 4 GiB of empty blocks with about a GB of budget left, and the paging that followed ran at about a frame a second; on 8 GB cards it costs about 1-1.5 GB of VRAM (#94, #76's 8-16 GB runs; the 7900 XTX is unaffected — 24 GB keeps all 64).

Behind VICTORY_SPARES_BY_HEADROOM=1 (off by default, read and explained in a comment where it is read): at most half of what is left below 85 % of the budget is kept, in 64 MiB blocks, the ends as before — a 24 GB card 10 GB in keeps all 64 blocks, one at or past 85 % keeps 2, memory pressure (room's keep == false) keeps 2, and with the switch off the choice is exactly as today. Composes with VICTORY_RESIDENCY unchanged: it only feeds spares() a smaller number.

The issue's sketch, with the boundary cases spelled out: 16 GB at 12 GB in -> 12 blocks (768 MiB), 8 GB at 5.5 GB in -> ~5 blocks.

Measurements or Tested

  • New unit test pool::tests::spares_follow_the_cards_headroom_when_asked (exact GiB arithmetic, both modes, all boundary cases), alongside the existing empty_blocks_stay_while_the_card_has_room, which keeps passing through the unchanged default path.
  • Cross-checked from a non-Windows machine: CARGO_FEATURE_PURE=1 cargo clippy -p victory-gpu --all-targets [--all-features] --locked --target x86_64-pc-windows-msvc -- -D warnings is clean apart from the two errors already on main (missing_transmute_annotations #169, unnecessary_mut_passed watch.rs:3626 #241).
  • Windows runners (my fork's CI, this branch): parallel Default 381 passed; 1 failed and Diagnostics 432 passed; 1 failed, the one failure in both being depth_bounds_pipeline_loads_and_filters_draws (WARP, #169); the new test passes in both jobs.

Not run

  • Not run: the game. The frame-time and VRAM effect of the smaller spare set on 8-16 GB cards is a game-run measurement — per #94/#76 the pool overshoot paged over PCIe (~1 fps on a 16 GB card at high use). A run on a 16 GB card with VICTORY_SPARES_BY_HEADROOM=1 (for example #76's and #124's setups) would say the number; the 7900 XTX should be unchanged, as the clamp keeps 64 blocks there.

AI-assisted: yes

**@⁠GDemay** on GitHub · 2026-11-26 14:23 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/285) `GDemay:perf/spares-by-headroom` → `main` · +53 −3 · 1 files · 1 commits · open ### What and why `spares()` (crates/victory-gpu/src/pool.rs) keeps either 2 blocks or all 64 (4 GiB) by a binary line at 85 % of the card's budget, whatever headroom is actually left below it. On 8-16 GB cards that overshoots: a 16 GB card 12 GB in held 4 GiB of empty blocks with about a GB of budget left, and the paging that followed ran at about a frame a second; on 8 GB cards it costs about 1-1.5 GB of VRAM (#94, #76's 8-16 GB runs; the 7900 XTX is unaffected — 24 GB keeps all 64). Behind `VICTORY_SPARES_BY_HEADROOM=1` (off by default, read and explained in a comment where it is read): at most half of what is left below 85 % of the budget is kept, in 64 MiB blocks, the ends as before — a 24 GB card 10 GB in keeps all 64 blocks, one at or past 85 % keeps 2, memory pressure (`room`'s `keep == false`) keeps 2, and with the switch off the choice is exactly as today. Composes with `VICTORY_RESIDENCY` unchanged: it only feeds `spares()` a smaller number. The issue's sketch, with the boundary cases spelled out: 16 GB at 12 GB in -> 12 blocks (768 MiB), 8 GB at 5.5 GB in -> ~5 blocks. ### Measurements or Tested - New unit test `pool::tests::spares_follow_the_cards_headroom_when_asked` (exact GiB arithmetic, both modes, all boundary cases), alongside the existing `empty_blocks_stay_while_the_card_has_room`, which keeps passing through the unchanged default path. - Cross-checked from a non-Windows machine: `CARGO_FEATURE_PURE=1 cargo clippy -p victory-gpu --all-targets [--all-features] --locked --target x86_64-pc-windows-msvc -- -D warnings` is clean apart from the two errors already on main (`missing_transmute_annotations` #169, `unnecessary_mut_passed` watch.rs:3626 #241). - Windows runners (my fork's CI, this branch): parallel Default **381 passed; 1 failed** and Diagnostics **432 passed; 1 failed**, the one failure in both being `depth_bounds_pipeline_loads_and_filters_draws` (WARP, #169); the new test passes in both jobs. ### Not run - Not run: the game. The frame-time and VRAM effect of the smaller spare set on 8-16 GB cards is a game-run measurement — per #94/#76 the pool overshoot paged over PCIe (~1 fps on a 16 GB card at high use). A run on a 16 GB card with `VICTORY_SPARES_BY_HEADROOM=1` (for example #76's and #124's setups) would say the number; the 7900 XTX should be unchanged, as the clamp keeps 64 blocks there. AI-assisted: yes
spares() kept either 2 blocks or all 64 (4 GiB) by a binary line at 85% of the
card's budget, whatever headroom was left below it. A 16 GB card 12 GB in held
4 GiB of empty blocks with about a GB of budget left, and the paging that
followed ran at about a frame a second (#94, #76's 8-16 GB runs). With the
switch on, at most half of what is left below 85% is kept, in 64 MiB blocks,
the ends as before: a 24 GB card 10 GB in keeps all 64, one past 85% keeps 2.
Off, the choice stays binary.

Co-Authored-By: GLM 5.3 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:28:29 +00:00
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/285/head:github-bot/gh-285'
git switch 'github-bot/gh-285'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-285'
git switch 'github-bot/gh-285'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-285'
git switch 'github-bot/gh-285'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-285'
git switch 'main'
git merge --squash 'github-bot/gh-285'
git switch 'main'
git merge --ff-only 'github-bot/gh-285'
git switch 'main'
git merge 'github-bot/gh-285'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.