GPU: exclude reserved and resting pieces from reusable texture memory #297
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!297
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-297"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ySKELLETONX on GitHub · 2026-11-26 14:49 UTC · original
ySKELLETONX:fix/texture-pool-reusable-bytes→main· +76 −9 · 1 files · 1 commits · openRefs #262 (reserved and resting bytes only).
texture_room()subtracts the successful textures'HELDcounter from the allocated block bytes. A piece is removed from the allocator beforeCreatePlacedResourcesucceeds, andHELDis decremented as soon as the texture dies, before its mandatory 2,500 ms rest has elapsed. Both intervals therefore appear as reusable capacity even though the allocator cannot use those pieces. The block count and the independently loaded atomic counter can also describe different moments.Track unavailable bytes in
Pool, under the same mutex that reserves and reclaims ranges. A reservation increases the count; returning a piece keeps it unavailable; reclaiming its range after the rest period decreases it.texture_room()now uses this count and advances the existing rest/reclaim logic, so admission can recover even when no new allocation is being attempted. The successful-texture-onlyHELDcounter is removed.Three synthetic regressions cover reservation before resource creation, the rest deadline and recovery from a budget query alone, alignment padding, block retirement and slot reuse, and 400 allocation/reclaim cycles checked against the actual free ranges. These exercise the production pool with integer block handles. Two initial regressions failed with the original accounting arithmetic extracted into the queried helper.
Validation on Windows:
cargo test --locked -p victory-gpu --lib -- pool::tests residency::tests resource::tests --test-threads=1: 27 passed.--features diagnostics: 27 passed.cargo clippy --locked -p victory-gpu --lib --tests -- -D warnings -A clippy::unnecessary_mut_passed: passed, also with diagnostics. The narrow allowance is for the existingwatch.rs:3626warning on main; that file is unchanged.cargo xtask policy: 265 files OK.git diff --checkpassed.This fixes aggregate accounting only. It does not make fragmented free ranges contiguous or prove that a particular allocation fits, so #262 should remain open. No gameplay A/B run, FPS improvement, or reduction in device loss is claimed. Full workspace tests were not run locally.
Prepared with OpenAI Codex assistance.
@Jesper-Andersson on GitHub · 2026-11-27 01:41 UTC · original
An 8 GB data point: RTX 2070 SUPER 8 GB (driver 621.14), Ryzen 7 5800X, 32 GB RAM, Windows 11. Build: main
014d52d+ #203 (DLSS) + pr0vId3nce's own-bytes pool (#221) + #412,diag, Series S + DLSS,play.ps1settings plusVICTORY_RESIDENCY=1,CARD_BUFFERS_MIN_KB=64,CARD_BUFFERS_MB=1024,WIDE_MERGE=1,WINDOW_KB=1024,SUBMIT_FRAMES=2,CARD_ROOM_FOR_TARGETS_MB=1280(#407). One run each, about two minutes in the world, around the same place:Without it, the free part of the texture blocks (1.2-2.2 GB in every run here) counted as room, and the card went over its budget. With it, the room test turns textures away earlier (more lack-of-room passes) and the card stays under. Textures didn't visibly load slower. The frame time going down fits the card no longer being over its budget, but these are single runs, not matched pairs, so take the 128 -> 85 ms as rough.
Both PRs were in the build together. With
VICTORY_RESIDENCY=1, #327's new sweep doesn't run (it mirrors the residency branch), so I'd credit most of this to this PR; I haven't run them apart.Not checked: without residency, AMD, Series X.
This comment was written with AI assistance (Claude Code).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.