Texture pool: fullest block and best range first, eviction from the emptiest blocks (8 GB card stays under budget) #1337
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1337"
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Agam77055 on 2026-11-28T17:39:53Z.
On an 8 GB card the texture pool kept the card over its budget for a whole session. Free space inside the 64 MB texture blocks counted as room, but eviction by age only made more of those holes, because a block goes back to the system only when it is empty.
PC: RTX 5060 Laptop 8 GB (driver 621.40), i7-13620H, 24 GB RAM, Windows 11 26300. Series S, DLSS Performance,
VICTORY_TEXTURE_POOL=1,VICTORY_SLOT_EVICT=1.What changes
pool.rs:VICTORY_POOL_FIT=firstgives the old first fit.Rangeskeeps its total.block_of()andblock_held()let eviction know which block a texture lies in and how much of each block is held.resource.rs: under pressure, the sweep takes textures with allocations of their own first, then textures from the blocks least held, then by age.VICTORY_EVICT_ORDER=agegives the old order, longest idle first. Addseviction_counts().Measured
The texture queue's room lines, first fifth of each run left out. Same switches in both runs; the only difference is this change.
Later runs with more changes on top stayed under budget (5,510–5,547 MB in use against about 6,660 MB). One run each, in different scenes, on one PC, so take the exact figures with that in mind.
Tests
cargo test -p victory-gpu --lib: 455 passed, 0 failed, 36 ignored on Windows. That includesthe_best_range_leaves_least_over_and_the_total_follows. The tests also caught a wrap in the leftover computation (then_someevaluatedsize - lenfor ranges too small), now computed only for ranges that fit.Tested and written with an AI assistant (Claude Code); the runs were on my machine. No game files attached.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-28T19:22:46Z.
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.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by spook40 on 2026-11-29T01:20:28Z.
Test Results — 8 GB RTX 3060 Ti (
1080to1440,60 fps)Tested against this PR on an 8 GB RTX 3060 Ti (noting
mainhas moved on since PR #1337 was opened):pool.rs+resource.rs): Cut internal block waste from ~1.6 GB down to 649 MB across 48 blocks (3,072 MB), withlet_go_idleevicting 154 MB (1,382textures), but0 blocks empty—so no VRAM blocks returned to the system and the card remained atno room.resource.rs): Tripled idle evictions to 494 MB (2,124textures, only31re-uploads) and drained a block down to ~55.7 MB free, still with0 blocks empty(998 MBfree across49blocks;7,112 MBvs.6,208 MBroom line).pool.rs): Reached 53 blocks (3,392 MB) with 1,242 MB free across18half-empty blocks and0 blocks empty, because even a single pinned texture keeps a 64 MiB block resident.BLOCK = 16 << 20): Hita host state prelude did not record (The parameter is incorrect. (0x80070057))shortly after startup (1block /16 MB).Pull request closed