fix(gpu): respect completed sampling windows in slot eviction #3697
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3697"
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 victorportelada on 2026-11-30T04:18:55Z.
Problem
With
VICTORY_SAMPLED_EVICT=1, the GPU→CPU readback of sampled-slot marks is asynchronous. A slot eviction cutoff can advance past a whole 30-frame readback window before its marks have arrived, so recently sampled textures look cold and become eligible for eviction. On an RTX 5060 8 GB this caused a heavy re-upload storm: 24,458 textures evicted, 3,114 remade, 519 within 2 seconds, with texture first-serve latency spiking to 13+ frames.Fix
Clamp the eviction cutoff to the last readback whose marks have actually been written into
seen. A current token then skips a redundant full dependency scan; stale or inconclusive results still use the authoritative wait check. The regression test checks that a current token is not aged out, that arrivals and landings invalidate it, and that no completed readbacks leaves the result unknown.Verification
sampledtests pass on this branch.cargo test -p victory-gpu --lib sampled: 3 passed.cargo xtask policy: 441 files ok.cargo clippy -D warningscurrently fails on clean upstreammainitself with pre-existing lints (unused imports/variables, MSRVis_multiple_of); this patch does not add any.Matched headless A/B on the RTX 5060 8 GB / Ryzen 5 5600 rig with a gated replay driver: quick rebuilds (<2 s) fell from 1,394 to 283 and total remakes from 13,307 to 4,981, with zero VRAM warnings in both. The fix is correctness-directed; fps impact on a 6-core CPU was within scene noise.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-11-30T07:47:49Z.
A pre-fix 8 GiB data point for this path. One long
v2026.11.29.05run on an RTX 4060 with 32 GB RAM andVICTORY_SAMPLED_EVICT=1ended at 167,763 recorded indexed-slot resets and 129,589 requeue events after shader marks (about 77 requeues per 100 resets). These are cumulative descriptor events and the same slot can recur. They do not measure unique textures, re-upload latency, or bytes returned to DXGI. I have no matched in-game post-fix run yet.I also applied
2353047together with #3750 and its busy-descriptor follow-up on41adb551. The three sampling tests and the locked-descriptor regression passed under Windows WARP. This verifies that those changes build and pass the targeted tests together.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:49:49Z.
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