gpu(pool,draw),play: reuse free pool holes under full VRAM and align 8 GiB room/eviction tier #153
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/153"
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 Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T18:21:37Z.
Summary
Addresses #149 (8 GiB VRAM texture starvation, black/missing textures, and broken textures under 8 GiB RT).
Root Causes Observed in Logs (#149)
room() == false: In 8 GiB open-world play,texture blocksheld up to ~637–708 MB of free space inside already-allocated 64 MiB blocks, yetheap_texturesrefused every new texture onceroom == false(no room for new ones so_far=788500) even when placement would take 0 bytes of new card memory.VICTORY_TEXTURE_ROOM_PERCENT=80sat permanently below the active render-target + DLSS Frame Gen working set (~85.5% of DXGI budget).VICTORY_TEXTURE_MIP_DROP=1: Broke most textures when RT was enabled on 8 GiB cards while keeping only opt-in--setusefulness.Changes
crates/victory-gpu/src/pool.rs&crates/victory-gpu/src/resource.rs:pool::existing_only()/pool::is_existing_only(), forcingGrow::Noinpool::textureand blocking any committed/reserved fallback inresource::host_textureso placements use strictly existing pool holes with zero new VRAM allocation (and never mark skipped allocationsrefused).existing_only_reuses_free_pool_hole_without_creating_blocksunit test.crates/victory-gpu/src/draw.rs:!roomand!has_its_texture, addedVICTORY_REUSE_POOL_WHEN_FULL(on unless=0) to try placing title-filled textures into already-allocated pool holes viapool::existing_onlywhentexture_room() > 0and!residency::pressured().apps/victory/src/play.rs:<= 9 GiBGPUs, raisedVICTORY_TEXTURE_ROOM_PERCENTto86(FG on) /88(FG ready-off) and paired withVICTORY_SLOT_EVICT_PERCENT=84(86without FG) /VICTORY_SLOT_EVICT_LOW_PERCENT=78(80without FG).VICTORY_TEXTURE_MIP_DROP=1from the 8 GiB tier while preservingVICTORY_CARD_BUFFERS_MB,VICTORY_CARD_WINDOWS_MB,VICTORY_CARD_ROOM_FOR_TARGETS_MB,VICTORY_RT_MEMORY_MB, andVICTORY_BVH_FAULTS_ALLsafety caps.play::tests(low_vram_series_x_sets_headroom_and_eviction_guards,low_vram_series_s_keeps_native_mips_and_bounds_rt_caps,user_set_overrides_low_vram_defaults).Local Verification
cargo +1.98.1-x86_64-pc-windows-gnu xtask policy:305 files okcargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --locked -- pool:::15 passed; 0 failed; 1 ignoredcargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --locked -- resource:::27 passed; 0 failedcargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --locked -- draw:::9 passed; 0 failed; 1 ignoredcargo +1.98.1-x86_64-pc-windows-gnu test -p victory --locked -- play:::15 passed; 0 failedclippy --all-targets -- -D warnings(default and--features diagnostics): 0 warningsImported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T18:59:17Z.
Follow-up fix in
19914946(crates/victory-gpu/src/draw.rs):reuse_pool_when_full()on!crate::residency::critical_commit()rather than!crate::residency::pressured(), since pool-hole reuse allocates zero new VRAM and normal 3D world execution regularly sits below the 4096 MiB host pressure watermark.pool::texture_room() > 0check once per pass and capped failed pool-hole probes per pass atMAX_POOL_REUSE_MISSES(64) to avoid repeatedTEXTURESlock contention under full VRAM.Verified at
19914946:xtask policy:305 files okcargo test -p victory-gpu --locked -- pool:::15 passed; 0 failed(1 ignored)cargo test -p victory-gpu --locked -- resource:::27 passed; 0 failedcargo test -p victory-gpu --locked -- draw:::9 passed; 0 failed(1 ignored)cargo test -p victory --locked -- play:::15 passed; 0 failedcargo clippy --workspace --locked --all-targets -- -D warnings(default features and--all-features): 0 warningscheck):COMPLETED/SUCCESSscripts/verify-world.ps1with--features diagnosticsforVICTORY_CAPTURE):VICTORY_TEXTURE_ROOM_PERCENT=72, 45s):room_false=100.0%yet placed55,000+new textures into already-allocated pool holes (uploaded=40155,crashes=0,used_max=5411 MB / budget_min=6712 MB,over=0 MB), with passing visual gate (pngs=24,lit=7/24, median luma103.64, edge energy6.97, near-black0.01%, magenta0.0%) and clean textures/lighting confirmed in screenshots.VICTORY_TEXTURE_ROOM_PERCENT=88,VICTORY_SLOT_EVICT=1,86/80%eviction thresholds, 45s):ok: true, all 6 gates PASSED (world_windows=12,max_draws=12333,crashes=0,no_host_texture_errors=0,used_max=5633 MB / budget_min=6634 MB,over=0 MB,room_false=16.7%,uploaded=41769,final_waiting=4455,mapped_rate=4.8 ms/world_sec,pngs=24,lit=14/24, median luma104.78, edge energy6.94, near-black0.0%, magenta0.0%,10,000+pool-hole placements logged), with full textures and clean lighting verified in captured screenshots.Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T19:03:18Z.
Automated triage for the maintainers (not an approval).
Verdict:
needs-gpu-test· CI (check):passingReview Summary
Logic and safety look solid, CI is passing, and the changes are well-scoped to
#149(8 GiB VRAM texture starvation). Because this PR modifies D3D12 texture-pool placement under full VRAM and changes 8 GiB launcher headroom/eviction defaults, it warrants a local real-GPU smoke test before merging.Key Findings
crates/victory-gpu/src/pool.rs,crates/victory-gpu/src/resource.rs):pool::existing_onlysetsCAN_WAITandEXISTING_ONLY, forcingGrow::Noinpool::textureand settingWAITEDon any miss (including non-pooled sizes, without inflatingBLOCKS[NOT_MADE]).resource::host_texture_ascheckspool::waits() || pool::is_existing_only()beforeCreateReservedResource/CreateCommittedResource, andresource::hostedavoids settingr.host.refusedwhenpool::is_existing_only()is active. This guarantees zero new D3D12 heap or committed VRAM allocations during reuse attempts.existing_only_reuses_free_pool_hole_without_creating_blockscovers thread-local guard restoration andPool::take_ripewithGrow::No.crates/victory-gpu/src/draw.rs):VICTORY_REUSE_POOL_WHEN_FULL(default on) attemptspool::existing_only(|| resource::host_resource(wanted))when!room,!has_its_texture,pool::texture_room() > 0, and!residency::critical_commit(), capped atMAX_POOL_REUSE_MISSES = 64per pass.!residency::pressured(), whereasdraw.rschecks!crate::residency::critical_commit()(reasonable on 8 GiB wherepressured()may stay true while commit is not critical).wantedalready has a cached host texture from another slot,host_resourcereturnsSomewithwaited == falseand incrementsHEAP_TEXTURES_REUSED_POOL; harmless functionally, just a slight counter overcount on shared resources.existing_onlyruns beforeresidency::admit_texture_pass(required); ifadmit_texture_passbreaks the loop, the placed texture stays cached inr.hostfor a subsequent pass.apps/victory/src/play.rs):VICTORY_TEXTURE_ROOM_PERCENTon<= LOW_VRAM_THRESHOLD_MBcards to86(FG on) /88(FG ready-off) and pairs it withVICTORY_SLOT_EVICT_PERCENT(84/86) andVICTORY_SLOT_EVICT_LOW_PERCENT(78/80), keepinglow < evict < roomin all modes.VICTORY_TEXTURE_MIP_DROP=1while keeping buffer/window/target/RT caps intact and overridable via--set/ menu.Local GPU Verification Needed
Please run a smoke test on an 8 GiB GPU (and optionally a higher-VRAM GPU for regression) covering:
new texture placed into already-allocated pool holetriggers whenroom == false, no black/missing textures, and VRAM stays within DXGI budget without device removal).VICTORY_BVH_BUILDER=1) to confirm textures render cleanly without automaticVICTORY_TEXTURE_MIP_DROP=1and without OOM/TDR.VICTORY_REUSE_POOL_WHEN_FULL=0sanity check.Generated with Antigravity CLI (
agy).Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T21:27:03Z.
Automated RTX 4060 Ti 8 GB Open-World A/B hardware verification PASSED (
playtest/wave5vsorigin/mainb1b6dc1,VICTORY_LEVELS_ON_DEMAND=0play-parity):cargo test(RTX 4060 Ti): 645 passed, 0 failed (victory39/39,victory-shaderemit::wave64_tests19/19 &lower19/19,victory-gpu568/568).scripts/verify-world.ps1, DLSS Quality + open-world save):9.4 fpsvs7.5 fps(+1.90 fps / +25%), min8.3 fpsvs0.8 fps, preparing53.6 msvs60.0 ms5760 MBvs6005 MB(-245 MB,0 MBover budget);no room for new oneshalved (9,000vs18,000);max_waitingdropped (36,432vs41,431)0mismatches (other_bytes=0, showed_another_view=0, failed=0vs5and2on baseline)mapped_rate1.63 ms/svs6.9 ms/s(-76%, max12.9vs51.9 ms)frame-5975.png,frame-5983.png),edge_energy=4.69vs3.88,near_black=0.02%,magenta=0.0%(and#1412bf6800showed zero visual artifacts).