Pool: empty blocks kept in proportion to the card's budget, behind VICTORY_SPARE_SCALE (#756) #784

Closed
github-bot wants to merge 2 commits from github-bot/gh-784 into main AGit
Owner

@⁠xiepeixuan on GitHub · 2026-11-28 05:51 UTC · original
xiepeixuan:codex/spare-scale-756 → main · +74 −3 · 2 files · 2 commits · closed without merging

Below 85% DXGI usage, the texture pool can retain up to 64 empty 64 MiB blocks (4 GiB) regardless of the card's budget. That's one-third to one-half of an 8–12 GiB budget held in empty blocks.

Change. With VICTORY_SPARE_SCALE=1, the cap in 64 MiB blocks is min(existing_limit, SPARE_KEPT, max(budget_bytes / 32 / BLOCK, VICTORY_RIPE_BLOCKS, STAGING_KEPT)), where SPARE_KEPT = 64 and STAGING_KEPT = 8. Below 85% use, when the existing limit allows it, 8, 12, 16, and 24 GiB budgets each keep up to 12 blocks (768 MiB) with the default ripe setting. The floor preserves the ripe-block device-loss safeguard and leaves the staging pool's effective retention unchanged. The switch is off by default; --set VICTORY_SPARE_SCALE=0 keeps the old behavior.

Relation to #394. That PR lowers retention under host RAM or commit pressure. This change caps texture VRAM only when the existing policy allows retention; the 85% cutoff and host-pressure behavior are unchanged.

Tests. At PR commit 6eecf9746ca61814825dc9ebc850729bb7fef2c1, Windows cargo check --workspace --locked passed and cargo test -p victory-gpu --lib pool passed all 11 tests. The matrix covers 8, 12, 16, and 24 GiB budgets, the 85% cutoff, switch-on and switch-off behavior, and the staging floor with ripe blocks disabled.

CI: the two Clippy errors are pre-existing on main 63b902fe (run 46104876336) and unrelated to this change; the pool tests pass.

Focused Windows run · Full fork Windows CI · Upstream baseline run. Both fork jobs verified the exact PR checkout before Cargo; Actions lists their separate workflow trigger commit as head_sha (9782565). The focused result is attached to the tested PR commit. The upstream PR run reports the PR's head_sha and requires maintainer approval.

AI-assisted (Codex). Not run in the game: I have no game files. Needs a run on an 8-12 GB card with VICTORY_SPARE_SCALE=1 and =0.

**@⁠xiepeixuan** on GitHub · 2026-11-28 05:51 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/784) `xiepeixuan:codex/spare-scale-756` → `main` · +74 −3 · 2 files · 2 commits · closed without merging Below 85% DXGI usage, the texture pool can retain up to 64 empty 64 MiB blocks (4 GiB) regardless of the card's budget. That's one-third to one-half of an 8–12 GiB budget held in empty blocks. **Change.** With `VICTORY_SPARE_SCALE=1`, the cap in 64 MiB blocks is `min(existing_limit, SPARE_KEPT, max(budget_bytes / 32 / BLOCK, VICTORY_RIPE_BLOCKS, STAGING_KEPT))`, where `SPARE_KEPT = 64` and `STAGING_KEPT = 8`. Below 85% use, when the existing limit allows it, 8, 12, 16, and 24 GiB budgets each keep up to **12 blocks (768 MiB)** with the default ripe setting. The floor preserves the [ripe-block device-loss safeguard](https://github.com/xiepeixuan/VIctory-NVIDIA/blob/6eecf9746ca61814825dc9ebc850729bb7fef2c1/crates/victory-gpu/src/pool.rs#L115-L129) and leaves the staging pool's effective retention unchanged. The switch is off by default; `--set VICTORY_SPARE_SCALE=0` keeps the old behavior. **Relation to #394.** That PR lowers retention under host RAM or commit pressure. This change caps texture VRAM only when the existing policy allows retention; the 85% cutoff and host-pressure behavior are unchanged. **Tests.** At PR commit `6eecf9746ca61814825dc9ebc850729bb7fef2c1`, Windows `cargo check --workspace --locked` passed and `cargo test -p victory-gpu --lib pool` passed all 11 tests. The matrix covers 8, 12, 16, and 24 GiB budgets, the 85% cutoff, switch-on and switch-off behavior, and the staging floor with ripe blocks disabled. CI: the two Clippy errors are pre-existing on main 63b902fe (run 46104876336) and unrelated to this change; the pool tests pass. [Focused Windows run](https://github.com/xiepeixuan/VIctory-NVIDIA/actions/runs/46114602291) · [Full fork Windows CI](https://github.com/xiepeixuan/VIctory-NVIDIA/actions/runs/46114602256) · [Upstream baseline run](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46104876336). Both fork jobs verified the exact PR checkout before Cargo; Actions lists their separate workflow trigger commit as `head_sha` (`9782565`). The focused result is attached to the tested PR commit. The [upstream PR run](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46114543267) reports the PR's `head_sha` and requires maintainer approval. AI-assisted (Codex). Not run in the game: I have no game files. Needs a run on an 8-12 GB card with VICTORY_SPARE_SCALE=1 and =0.
Enable with VICTORY_SPARE_SCALE=1. Leave the legacy 85 percent cutoff and host staging limits unchanged.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 05:54:51 +00:00
github-bot closed this pull request 2026-11-28 19:25:19 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-11-28 19:23 UTC · original

Thanks for this. I'm closing it without merging because it conflicts with the current main in several places (main has moved a lot since it was opened, with about 100 pull requests merged today), and I can't resolve that safely on your behalf. If you'd still like it in, please rebase it on the current main and open a new pull request.

**@⁠trustno1-coder** on GitHub · 2026-11-28 19:23 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/784#issuecomment-7244509978) Thanks for this. I'm closing it without merging because it conflicts with the current main in several places (main has moved a lot since it was opened, with about 100 pull requests merged today), and I can't resolve that safely on your behalf. If you'd still like it in, please rebase it on the current main and open a new pull request.

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