victory-gpu: bound let_go_idle sweep and back off empty slot_evict pa… #2549
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2549"
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 KleiinMoretti on 2026-11-29T14:06:29Z.
What it changes
On titles with 100k+ live textures (such as GTA 6 on 8 GB GPUs), two texture sweep paths were causing severe CPU frame-time spikes:
let_go_idle()full-table scans (crates/victory-gpu/src/resource.rs): Whenmost != u64::MAXoridle_ms < 60_000 && !unmapped_only,let_go_idle()walked every entry in the live texture table on every submission. Unforced passes are now bounded toPART = 8192textures andMAX_SWEEP_US = 4_000(4 ms) using a rollingFROMcursor, whileflush != 0andVICTORY_TEXTURE_SWEEP=wholeretain full scans.slot_evict()empty-pass thrashing (crates/victory-gpu/src/resource.rs): When bindless descriptors prevented evicting any slots (evicted == 0),slot_evict()still re-scanned the descriptor heap every second for zero gain. Addedslot_evict_backoff_ms()+NEXT_SLOT_MSto back off15_000ms after an empty pass (2_000ms when over budget with evictions,5_000ms otherwise; bypassed on forced flushes), plus unit testresource::tests::slot_evict_backoff_slows_empty_passes.How it was tested
console=series-s), DLSS Quality (preset K), FG 2xlooks for textures to let goaveraged94.16 ms(263.7 msmax);the heaps' records and what is sweptwas47.6 ms/framewhileslot_evictscanned 141,073 textures and evicted0looks for textures to let goaveraged3.60 ms(7.3 msmax);the heaps' records and what is sweptdropped to0.1–0.5 ms/framecargo testpassed for the crates it touches: yes (cargo test -p victory-gpu --locked --lib -- resource::tests: 45 passed, 0 failed, 1 ignored;slot_evict_backoff_slows_empty_passespassed)Checked for overlap
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by icdmkg2 on 2026-11-29T18:19:58Z.
An in-game data point from an 8 GB laptop. It covers this PR together with four others, so it can't attribute the gain to this one alone.
Setup: RTX 5060 Laptop GPU (8 GB), Ryzen 7 H 260 (8 cores), 32 GB, Windows 11, driver 621.24.
mainat55d06914, release build, Series S, DLSS performance,VICTORY_LEVELS_ON_DEMAND=0andVICTORY_COMMIT_FLOOR_MB=1024in both builds (see #1411 for why). Same save (the prologue's cell), driven by a script: 60 s measured after a 30 s settle, warm shader cache, two alternating pairs.Combo:
main+ #2549 + #2783 + #2647 + #2665 + #2795. These merge cleanly together. #2796, #2656, #2604 and #2587 conflict with that set, so they weren't tested.mainThat's about 15–18 % shorter frames and half the slow frames, with no crash and no device removal. A frame capture of the combo (diagnostics build,
VICTORY_CAPTURE_WORLD) matchedmain's brightness (mean luma 66.4 against 66.2), with no black holes.One thing for the diagnostics build: with these merged together,
--features diagnosticsno longer compiles. A localtiminginsubmitshadowshost::timing()at three call sites, andcopystat::log_heap_elsewhereuses anmbhelper it doesn't define. Both are one-line fixes; mentioning it in case whichever lands second hits it.