Skip unusable indexed slot eviction records #3811

Closed
Yoruiopz wants to merge 1 commit from upstream-pr/3811 into main
Yoruiopz commented 2026-11-30 07:51:41 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Yoruiopz on 2026-11-30T07:51:41Z.


Related to #1644.

What it changes

With sampled eviction disabled, an indexed-only slot blocks its texture in the final eligibility filter. The scan currently allocates and appends an eviction-slot record for that same slot. The filter discards the vector before eviction can use it.

Skip the insertion for that case. The same rows still update the blocked, recent-table, and sampled sets used by the eligibility filter and cold-texture accounting. A slot that can be rebuilt from a table, or an indexed slot considered by trusted sampled eviction, keeps its existing path.

How it was tested

  • RTX 5070 Laptop GPU (8 GB), Core Ultra 9 275HX, Windows 11, Series X at 1920×1080 output, DLSS Performance, DLSS FG 2×, cap of 15 rendered FPS.
  • One A/B pair using the same diagnostics binary built on 41adb551 plus the Series X startup fix and timings. The trial switch selected only this insertion predicate. Both runs used the same checkpoint, input tape, and warm cache. Sampled eviction and sweep slicing were disabled in both.
  • The window below is 90–130 seconds after first present. Both runs checked 1,000,127 slots per pass. The new path matched slightly more slots. Both runs found zero eligible textures, made zero descriptor resets, and evicted zero textures.
Median per eviction pass Control (38 passes) Trial (37 passes)
Matched slots 27,355 27,588
Slot lock walk 16.82 ms 17.16 ms
Descriptor work outside the slot walk 6.41 ms 2.29 ms
Entire descriptor match 23.21 ms 19.48 ms
Entire slot eviction pass 27.49 ms 24.07 ms
  • Median draw load was 7,987 and 7,542 per render, respectively. The controlled switch and comparable slot counts support the reduction in descriptor matching cost. A repeat with tighter draw-load alignment is needed for an end-to-end frame pacing claim.
  • The focused victory-gpu Rust test checks that accepted slot lists agree for combinations of table, indexed, and blocking slots, with sampled eviction both trusted and untrusted. Focused Cargo test and staged asset-policy checks passed. No shader changes.

Checked for overlap

  • Searched the open PRs touching this path. #2720 targets the slot walk, #2549 backs off empty scans, and #3750 moves victim planning to another thread. This PR removes allocations for records that the existing policy discards.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5561235270 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3811). Originally posted by [Yoruiopz](https://github.com/Yoruiopz) on 2026-11-30T07:51:41Z. --- Related to #1644. ## What it changes With sampled eviction disabled, an indexed-only slot blocks its texture in the final eligibility filter. The scan currently allocates and appends an eviction-slot record for that same slot. The filter discards the vector before eviction can use it. Skip the insertion for that case. The same rows still update the blocked, recent-table, and sampled sets used by the eligibility filter and cold-texture accounting. A slot that can be rebuilt from a table, or an indexed slot considered by trusted sampled eviction, keeps its existing path. ## How it was tested - RTX 5070 Laptop GPU (8 GB), Core Ultra 9 275HX, Windows 11, Series X at 1920×1080 output, DLSS Performance, DLSS FG 2×, cap of 15 rendered FPS. - One A/B pair using the same diagnostics binary built on `41adb551` plus the Series X startup fix and timings. The trial switch selected only this insertion predicate. Both runs used the same checkpoint, input tape, and warm cache. Sampled eviction and sweep slicing were disabled in both. - The window below is 90–130 seconds after first present. Both runs checked 1,000,127 slots per pass. The new path matched slightly more slots. Both runs found zero eligible textures, made zero descriptor resets, and evicted zero textures. | Median per eviction pass | Control (38 passes) | Trial (37 passes) | | --- | ---: | ---: | | Matched slots | 27,355 | 27,588 | | Slot lock walk | 16.82 ms | 17.16 ms | | Descriptor work outside the slot walk | 6.41 ms | 2.29 ms | | Entire descriptor match | 23.21 ms | 19.48 ms | | Entire slot eviction pass | 27.49 ms | 24.07 ms | - Median draw load was 7,987 and 7,542 per render, respectively. The controlled switch and comparable slot counts support the reduction in descriptor matching cost. A repeat with tighter draw-load alignment is needed for an end-to-end frame pacing claim. - The focused `victory-gpu` Rust test checks that accepted slot lists agree for combinations of table, indexed, and blocking slots, with sampled eviction both trusted and untrusted. Focused Cargo test and staged asset-policy checks passed. No shader changes. ## Checked for overlap - [x] Searched the open PRs touching this path. #2720 targets the slot walk, #2549 backs off empty scans, and #3750 moves victim planning to another thread. This PR removes allocations for records that the existing policy discards.
tyr0nsur commented 2026-11-30 08:06:11 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-11-30T08:06:11Z.


I combined 88497e1 with #3750 and the two follow-up descriptor guards from its review. Integration commit 58e78c1 resolves the two descriptor.rs conflicts by keeping record_eviction_slot and using the typed record with the heap ID and view key for the rows it records. Every row still contributes to the existing eligibility sets.

The integration test uses a five-slot D3D12 heap with a table-only texture, an indexed-only texture, and a mixed texture. The table-only texture keeps its two candidates in slot order. With no completed shader readback, the other two stay blocked. The test then rewrites a selected slot and checks that eviction leaves the replacement made and pointing to the new texture. It passed on Windows WARP with sampled eviction off and on. The slot test filter passed 48 tests (2 ignored), and the focused tests also passed with #3697 applied locally. Staged asset policy passed. These are compatibility checks with synthetic textures. The combined build's frame times remain unmeasured. Integration and tests used Codex assistance.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7272483909 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3811#issuecomment-7272483909). Originally posted by [tyr0nsur](https://github.com/tyr0nsur) on 2026-11-30T08:06:11Z. --- I combined `88497e1` with #3750 and the two follow-up descriptor guards from its review. [Integration commit `58e78c1`](https://github.com/tyr0nsur/VIctory-NVIDIA/commit/58e78c10e460847ebbd7ee30354e2845112316da) resolves the two `descriptor.rs` conflicts by keeping `record_eviction_slot` and using the typed record with the heap ID and view key for the rows it records. Every row still contributes to the existing eligibility sets. The integration test uses a five-slot D3D12 heap with a table-only texture, an indexed-only texture, and a mixed texture. The table-only texture keeps its two candidates in slot order. With no completed shader readback, the other two stay blocked. The test then rewrites a selected slot and checks that eviction leaves the replacement made and pointing to the new texture. It passed on Windows WARP with sampled eviction off and on. The slot test filter passed 48 tests (2 ignored), and the focused tests also passed with #3697 applied locally. Staged asset policy passed. These are compatibility checks with synthetic textures. The combined build's frame times remain unmeasured. Integration and tests used Codex assistance.
ghptc commented 2026-11-30 14:38:50 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ghptc on 2026-11-30T14:38:50Z.


We independently tested Yoruiopz's change at 88497e1ba98bb271f51cc0fdf9f7254bf4440cc5. In a CPU fixture we compared the original and patched evictable_slots using the same slots_showing and oldest_covering code, a real mutex per slot, and fixed-lifetime Arc identities in place of COM resources. The fixture generated the slot states and alternated order across eight paired passes per profile and policy.

With sampled eviction disabled, the median paired saving per matcher call was 2.308 ms in the blocked-indexed profile and 0.895 ms in a mixed profile. In the all-eligible control the candidate took 0.016 ms more. With sampled eviction enabled, absolute median paired differences were at most 0.017 ms. All 48 pairs agreed on eligible resources, ordered slots per resource, kept/blocked/cold results, selections at four byte budgets, and final ownership. The comparisons used a single CPU quota on Linux.

A separate functional check on an RTX 5070 under Proton exercised a registered descriptor heap with two generated SRVs. The real matcher preserved a recently tabled slot and blocked the indexed-only slot in both builds. The first draw after classification produced identical expected RGBA for both resources at the completed fence, with all 126 background control pixels intact.

The timed region of the CPU comparison covers one matcher call. The complete sweep and gameplay frametime still need separate measurements.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7281704945 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3811#issuecomment-7281704945). Originally posted by [ghptc](https://github.com/ghptc) on 2026-11-30T14:38:50Z. --- We independently tested Yoruiopz's change at `88497e1ba98bb271f51cc0fdf9f7254bf4440cc5`. In a CPU fixture we compared the original and patched `evictable_slots` using the same `slots_showing` and `oldest_covering` code, a real mutex per slot, and fixed-lifetime Arc identities in place of COM resources. The fixture generated the slot states and alternated order across eight paired passes per profile and policy. With sampled eviction disabled, the median paired saving per matcher call was **2.308 ms** in the blocked-indexed profile and **0.895 ms** in a mixed profile. In the all-eligible control the candidate took **0.016 ms more**. With sampled eviction enabled, absolute median paired differences were at most 0.017 ms. All 48 pairs agreed on eligible resources, ordered slots per resource, kept/blocked/cold results, selections at four byte budgets, and final ownership. The comparisons used a single CPU quota on Linux. A separate functional check on an RTX 5070 under Proton exercised a registered descriptor heap with two generated SRVs. The real matcher preserved a recently tabled slot and blocked the indexed-only slot in both builds. The first draw after classification produced identical expected RGBA for both resources at the completed fence, with all 126 background control pixels intact. The timed region of the CPU comparison covers one matcher call. The complete sweep and gameplay frametime still need separate measurements.
trustno1-coder commented 2026-12-01 18:48:29 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:48:29Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7321582791 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3811#issuecomment-7321582791). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-12-01T18:48:29Z. --- 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

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!3811
No description provided.