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

Merged
psttt432454 merged 1 commit from upstream-pr/943 into main 2026-11-29 08:16:58 +00:00
psttt432454 commented 2026-11-28 09:31:59 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by psttt432454 on 2026-11-28T09:31:59Z.


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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5538758326 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/943). Originally posted by [psttt432454](https://github.com/psttt432454) on 2026-11-28T09:31:59Z. --- ## 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)
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!943
No description provided.