Skip to content

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

Closed
xiepeixuan wants to merge 2 commits into
trustno1-coder:mainfrom
xiepeixuan:codex/spare-scale-756
Closed

xiepeixuan wants to merge 2 commits into
trustno1-coder:mainfrom
xiepeixuan:codex/spare-scale-756

Conversation

@xiepeixuan

@xiepeixuan xiepeixuan commented Nov 28, 2026 •

Copy link
Copy Markdown

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 63b902f (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.

Enable with VICTORY_SPARE_SCALE=1. Leave the legacy 85 percent cutoff and host staging limits unchanged.
xiepeixuan added a commit to xiepeixuan/VIctory-NVIDIA that referenced this pull request Nov 28, 2026
MystifiedSky added a commit to MystifiedSky/VIctory-NVIDIA-Improved that referenced this pull request Nov 28, 2026
fylcr pushed a commit to fylcr/VIctory-NVIDIA-for-low-end that referenced this pull request Nov 28, 2026
…1-coder#923 trustno1-coder#890 trustno1-coder#1008 trustno1-coder#1005 trustno1-coder#801, and trustno1-coder#953 by hand

Merged from trustno1-coder/VIctory-NVIDIA, all aimed at the 8 GB card / 32 GB
RAM class of machine this fork targets:

  trustno1-coder#784  empty texture blocks kept in proportion to the card's budget
        (VICTORY_SPARE_SCALE=1)
  trustno1-coder#986  texture staging retried in smaller blocks after out-of-memory
  trustno1-coder#923  lists' upload buffers kept and used again, not made for each copy
  trustno1-coder#890  VICTORY_CARD_BUFFERS_MIN_KB, an 8 GB card's floor
  trustno1-coder#1008 fault-page bound raised to 16,384, <4 GiB strays skipped
  trustno1-coder#1005 >65,535-group indirect dispatches enabled on NVIDIA
  trustno1-coder#801  stall-free per-draw zero-alloc and COM fast paths

trustno1-coder#953 (an upload buffer refused for want of memory is asked again once the
spare scratch chunks are freed) conflicted with the tree's own try_upload_buffer
split; ported by hand with the same semantics and the same log line.

Not taken: trustno1-coder#991, trustno1-coder#1014, trustno1-coder#722 - they conflict in pool.rs / draw.rs /
memory.rs, which trustno1-coder#784, trustno1-coder#801 and trustno1-coder#1008 already changed here.
@trustno1-coder

Copy link
Copy Markdown
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants