Slot eviction: say what it did every 5 seconds #943

Manually merged
github merged 1 commit from github-bot/gh-943 into main 2026-11-29 08:22:03 +00:00 AGit
Owner

@⁠psttt432454 on GitHub · 2026-11-28 09:31 UTC · original
psttt432454:diag/slot-evict-line → main · +30 −0 · 2 files · 1 commits · merged 2026-11-29 08:16 UTC

Problem

resource::SLOT_EVICT and resource::SLOT_STATE (the memory stack's slot eviction, by skornuta) are counted by slot_evict and when an evicted copy comes back. Nothing reads them, so a run cannot tell whether eviction freed anything, or why it did not. victory play turns VICTORY_SLOT_EVICT=1 on by default.

Change

When VICTORY_SLOT_EVICT=1, the 5-second texture lines in host.rs get one more line. It reports:

  • textures and MB let go, and slots put back to waiting;
  • textures made again, how many within 2 s, and their average time away;
  • attempts given up because a draw used the texture meanwhile;
  • the last look's state: evicting or not, idle-looking textures, how many were kept because a table showed them lately, and how many could not be taken because a slot shaders pick by index shows them.

resource::slot_evict_on() exposes whether the settings are on. Nothing else changes.

What it shows

One measured run, with victory play --series-s on main plus #890. RTX 5070 Laptop 8 GB (budget about 6.8 GB), same save and spot as the runs in #890, about 5 minutes:

time state idle-looking not to be taken (picked by index) let go, total
first ~3 min not evicting 0 0 0
+3 min evicting 11,313 11,302 9
+4 min evicting 8,283 8,271 81 (5 MB)
+4.5 min evicting 7,918 7,904 91 (5 MB)

Eviction switches on at the right time, but it can take almost none of the idle textures: 99.8% are held by slots shaders pick by index. Over the run it freed 5 MB while the texture queue's line said no room, new textures wait. On screen, some surfaces were left without textures. This is the case fxceless/victory-fork#1423 describes: what was sampled, recorded per frame. That issue already has someone working on its first step, so this PR only makes the numbers visible.

Tests

  • cargo build -p victory-gpu: clean.
  • cargo clippy -p victory-gpu --all-targets reports one manual_is_multiple_of at shadow.rs:1708, already on main. It is not touched here.
  • The new line was read in the run above.

No game files, logs of the title or images are included.

🤖 Generated with Claude Code

**@⁠psttt432454** on GitHub · 2026-11-28 09:31 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/943) `psttt432454:diag/slot-evict-line` → `main` · +30 −0 · 2 files · 1 commits · merged 2026-11-29 08:16 UTC ## Problem `resource::SLOT_EVICT` and `resource::SLOT_STATE` (the memory stack's slot eviction, by skornuta) are counted by `slot_evict` and when an evicted copy comes back. Nothing reads them, so a run cannot tell whether eviction freed anything, or why it did not. `victory play` turns `VICTORY_SLOT_EVICT=1` on by default. ## Change When `VICTORY_SLOT_EVICT=1`, the 5-second texture lines in `host.rs` get one more line. It reports: - textures and MB let go, and slots put back to waiting; - textures made again, how many within 2 s, and their average time away; - attempts given up because a draw used the texture meanwhile; - the last look's state: evicting or not, idle-looking textures, how many were kept because a table showed them lately, and how many could not be taken because a slot shaders pick by index shows them. `resource::slot_evict_on()` exposes whether the settings are on. Nothing else changes. ## What it shows One measured run, with `victory play --series-s` on `main` plus #890. RTX 5070 Laptop 8 GB (budget about 6.8 GB), same save and spot as the runs in #890, about 5 minutes: | time | state | idle-looking | not to be taken (picked by index) | let go, total | |---|---|---|---|---| | first ~3 min | not evicting | 0 | 0 | 0 | | +3 min | evicting | 11,313 | 11,302 | 9 | | +4 min | evicting | 8,283 | 8,271 | 81 (5 MB) | | +4.5 min | evicting | 7,918 | 7,904 | 91 (5 MB) | Eviction switches on at the right time, but it can take almost none of the idle textures: 99.8% are held by slots shaders pick by index. Over the run it freed 5 MB while the texture queue's line said `no room, new textures wait`. On screen, some surfaces were left without textures. This is the case fxceless/victory-fork#1423 describes: what was sampled, recorded per frame. That issue already has someone working on its first step, so this PR only makes the numbers visible. ## Tests - `cargo build -p victory-gpu`: clean. - `cargo clippy -p victory-gpu --all-targets` reports one `manual_is_multiple_of` at `shadow.rs:1708`, already on `main`. It is not touched here. - The new line was read in the run above. No game files, logs of the title or images are included. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
`resource::SLOT_EVICT` and `SLOT_STATE` (memory stack by skornuta) are
counted by `slot_evict` and the copy's return, but nothing read them: a
run could not tell whether eviction freed anything, nor why not. With
`VICTORY_SLOT_EVICT=1` (on in `victory play`) the 5-second texture lines
now carry one more: textures and MB let go, slots put back, textures made
again (within 2 s, and their average time away), attempts given up, and
the last look's state (evicting or not, idle-looking textures, kept by a
table, not to be taken as a slot shaders pick by index shows them).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 14:30:43 +00:00
github manually merged commit 706f813041 into main 2026-11-29 08:22:03 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

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