fix(gpu): apply slot eviction backoff on VICTORY_SLOT_EVICT_ASIDE path #4465
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4465"
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 YounesAH15 on 2026-11-30T20:40:01Z.
Problem
When
VICTORY_SLOT_EVICT_ASIDEis enabled (the default),slot_evictreturns early immediately after callingslot_look_aside(job), bypassing theNEXT_SLOT_MSbackoff update (#2549) that only ran on the synchronous path:NEXT_SLOT_MSstayed0forever on the async path, so whenever an 8 GB GPU was over the eviction threshold andslot_choosereturned 0 victims (e.g. bindless/indexed textures withoutVICTORY_SAMPLED_EVICT=1),slot_look_asidespawned a freshvictory-slot-lookOS thread on every sweep (each taking ~45-90 ms and contending onTEXTURES/SHADER_HEAPSlocks) instead of backing off for 15 s.slot_look_asidealso did not checkSLOT_HAS_READY, allowing a subsequent sweep beforeslot_evict_readyto spawn a redundant look thread and overwriteSLOT_READY.Changes (
crates/victory-gpu/src/resource.rs)NEXT_SLOT_MSto module scope withslot_evict_next_ms/slot_evict_schedule_nexthelpers.over_budget: boolonSlotJob.slot_look_asidewithSLOT_HAS_READY.load(Acquire)so pending victims aren't overwritten by a redundant scan.slot_evict_readyfinishes applying victims (2 s over budget / 5 s under budget / 15 s if 0 evicted).slot_evict_next_ms_schedules_backoff_for_sync_and_aside.Verification
cargo test -p victory-gpuslot eviction tests — 9 passed, 0 failed (includingslot_evict_next_ms_schedules_backoff_for_sync_and_aside,slot_evict_backoff_slows_empty_passes,a_texture_freed_since_the_look_aside_is_left_alone,a_rewritten_texture_descriptor_survives_a_stale_eviction).slot eviction asidelog timestamps across ~4 minutes of play (16 looks, 0 victims, 45.0 ms avg / 89.9 ms max) spaced cleanly at the 15 s backoff:19:00:17.2119:00:32.95(+15.7 s)19:01:04.29(+15.6 s/look)19:02:05.15(+15.2 s/look)19:04:06.71(+15.2 s/look)Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tikD1337 on 2026-11-30T20:51:14Z.
Tested headlessly on
origin/main(e1251c31, Windows 11, no game run):origin/main.cargo test -p victory-gpu --lib -- slot_evict: 7 passed, 0 failed (1193 filtered).Note: this overlaps in
crates/victory-gpu/src/resource.rswith #4432 (both hoistNEXT_SLOT_MS, addover_budgettoSlotJob, guardslot_look_asidewithSLOT_HAS_READY, and schedule backoff on emptyvictims/ afterslot_apply). Merging both would conflict inresource.rs. (#4465 usesRelaxedonNEXT_SLOT_MSand tests the pure helper without mutating global statics; #4432 usesAcquire/Releaseand also updatessampled.rssweep_cadence.)(AI-assisted build/unit-test check and diff review; game runtime not launched.)
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by YounesAH15 on 2026-12-01T01:41:53Z.
Before/After Comparison on RTX 3050 (8 GB, Series S, release build)
Tested the exact same machine on
main(without this PR) vs this branch:slot eviction asidelooksmain(without PR #4465)TEXTURES/SHADER_HEAPSlocksfix/8gb-vram-eviction)Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:41:07Z.
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed