Adaptive 16/8 MiB texture pool, block-aware idle eviction, and pop-in priority #1168
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1168"
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 mikael-jarvinen on 2026-11-28T14:45:19Z.
Summary
Reduces local VRAM footprint, eliminates pool fragmentation traps, and cuts texture pop-in on 8–12 GB GPUs:
Adaptive size-segregated texture pools (
crates/victory-gpu/src/pool.rs,apps/victory/src/play.rs,scripts/play-foxhound.ps1):VICTORY_TEXTURE_BLOCK_MB):<= 12 GiB:16 MiBlarge blocks +8 MiBsmall blocks12–20 GiB:32 MiBlarge blocks +16 MiBsmall blocks>= 20 GiB:64 MiBlarge blocks +16 MiBsmall blocks<= 64 KiB, withVICTORY_POOL_SMALL=1enabled by default) into a dedicatedTEXTURES_SMALLpool so persistent small textures do not pin large streaming blocks open and prevent D3D12 heap reclamation.SPARE_KEPT_TIGHT = 2) on<= 12 GiBGPUs so drained heaps return promptly to WDDM.D3D12_RESOURCE_BARRIER_TYPE_ALIASINGonpool::is_pooled(texture)(crates/victory-gpu/src/host.rs,crates/victory-gpu/src/texture.rs, matching the fix in #999), which is required with 16 MiB blocks because textures> 8 MiBfall back to committedID3D12Resources where D3D12 rejects aliasing barriers withE_INVALIDARG.Pool-block growth gate + O(1) block-aware idle eviction + peak target reserve (
crates/victory-gpu/src/pool.rs,crates/victory-gpu/src/resource.rs,crates/victory-gpu/src/draw.rs):pool::gate()/pool::waiting()) with ano_fitcache so when VRAM approachesroom_line, waitable textures still fill existing free holes in live blocks and defer cleanly (Told::Later) instead of growing new blocks or falling back to committed allocations.Hosted::pool_block) with its pool and block index and sorts idle eviction candidates by block occupancy tier (<25%→25–50%→>=50%/ unpooled) so sparse D3D12 heaps drain to 0 and return to the OS.let_go_idle(), excludes phantomtargets_room_keptfrom live-texture eviction, and replaces the fixed 3,072 MiB target reserve with a peak-sized reserve (clamp(peak * 1.5, 256 MiB, min(cap, 30% budget)), 2,048 MiB DLSS cap, 10 s settle to 0).Texture pop-in priority & ahead-pool trimming (
crates/victory-gpu/src/descriptor/host.rs,crates/victory-gpu/src/ahead.rs,crates/victory-gpu/src/texture/ahead.rs):TextureQueuedue ordering (Due::ordered()) intoagain(partially mapped / retried) →fresh(never uploaded yet) →recheck(already uploaded whole, speculative blind-write fingerprint checks), preventing unchangedrecheckscans from starving new textures during bursts.ahead::CARDpre-allocated 64 KiB card buffers on<= 12 GiBGPUs (256initial /128kept, releasing excess above32under VRAM pressure).texture::ahead::claimonresidency::admit_texture_pass(false)instead ofallow_staging_growth(false)so already-committed staging blocks stay reusable for ahead uploads.Verification
cargo clippy -p victory-gpu -p victory --all-targets --locked— 0 warnings in touched codecargo clippy -p victory-gpu --all-targets --all-features --locked— 0 warnings in touched codecargo test -p victory-gpu --lib --locked— 456 passed, 0 failed (including unit tests forDue::ordered()priority andtargets_kept_from_peak/targets_most)cargo xtask policy— 294 files okcargo build --release -p victory— clean release build (0 warnings)A/B Benchmark vs
origin/main(63b902f)Tested on RTX 3080 10 GB, 1440p DLSS Performance, identical 115 s scripted launch (
VICTORY_WARMUP_RESTART=0,VICTORY_POOL_STATS=1,VICTORY_KEYS=25:Enter,...,55:Enter):origin/main(63b902f)eba2e0c)7,601 MB6,229 MB8,336 / 8,679 MB8,152 / 8,556 MB16,012–18,245(2,053–2,214 MB)27,379–28,677(2,236–2,496 MB)1,433–1,580 MB(39–43%)1,033–1,174 MB(29–33%)Held back for room(sum across 5 s windows)1,263,687(137,309max)355,102(70,432max)5,915 / 6,876 / 11,15325,139 / 41,986 / 33,9811.6 / 2.5 / 0.5 fr(12–15max)0.6 / 0.5 / 0.6 fr(6–9max)UPLOAD_AHEADcount & latency30,000(1,526 MB,1.4 ms)35,000(1,596 MB,0.7 ms)00Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Aniseto on 2026-11-28T15:02:25Z.
Ran the adaptive texture-pool tests at
eba2e0con an NVIDIA Blackwell desktop part:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, Rust 1.98.1 (48a229cea 2026-09-01, pinned by
rust-toolchain.toml), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env), debug build.Both pass: the texture line tracks the adapter's VRAM budget, and the due-slot ordering carries the known state of each slot (the pop-in priority path). A 16 GB card takes the 32/16 MiB block bracket from the PR's table. These are CPU-side policy tests; I did not run the author's 115 s scripted world launch and cannot claim an FPS or pop-in improvement here. The PR has no comments yet, so this is the first datapoint in the thread and the first from an RTX 5070 Ti.
Not tested: a retail title, A/B FPS or pop-in measurement, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by cxy0072019-sketch on 2026-11-28T15:17:14Z.
I ran an in-game comparison on a 16 GB RTX 5070 Ti with an i5-14600KF under Windows to complement the texture-pool test results above.
Both diagnostics release builds started from a copy of the same Series S Gear Up save at 1920×1080 output, with DLSS and frame generation off. The emulator caches started with identical manifests, and each build had a separate fresh driver cache. The PR build used its
VICTORY_POOL_SMALL=1preset.63b902feba2e0cThe stable samples used the same camera after pipeline compilation finished. The inspected character, house and nearby water looked similar. The startup camera varied and the candidate issued about 3% more draws in the stable view, so this single restart pair is a data point for the VRAM and frame-time trade-off on 16 GB. It does not establish texture pop-in latency while moving. Test automation and analysis were AI-assisted.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-28T19:23:22Z.
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