Slot eviction takes textures picked by index that no shader sampled (VICTORY_SAMPLED_EVICT=1, draft, on #1074) #1145
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!1145
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1145"
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?
@psttt432454 on GitHub · 2026-11-28 14:09 UTC · original
psttt432454:feat/sampled-evict→main· +531 −24 · 11 files · 2 commits · merged 2026-11-28 19:39 UTCDraft: an experiment for 8 GB cards, not ready to merge. It is built on #1074 (the first commit here is #1074's), so review that one first. Only the last commit is new.
Why
#1074 showed that 75-94 % of the textures slot eviction may not take, because a slot shaders pick by index shows them, are read by no shader within its idle time: 0.5-1.2 GB on an RTX 5070 Laptop 8 GB. This lets eviction take them.
The change
VICTORY_SAMPLED_EVICT=1(withVICTORY_SAMPLED_MARKS=1; off by default, and unset nothing changes):HostHeap::slots_showingalso says which slots are title slots picked by index (no table showed them lately).evictable_slotskeeps a texture whose slots are all either a draw's to make again or picked by index, when no shader marked any of them and no table showed it since the cutoff. Its indexed slots come flagged.evict_slotsnotes each flagged slot it puts back to null (sampled::evicted). When a shader marks one again, it is queued as a title write would be (HostHeap::texture_slot_sampled_again). The pass over textures picked by index then makes the texture and the slot again (newest write first), andmake_waitingmakes its other slots.Measured (RTX 5070 Laptop 8 GB, Series S, the story cutscenes from the same save)
Both runs had
VICTORY_SAMPLED_MARKS=1 VICTORY_SLOT_EVICT_PERCENT=75. On the default 85 % the card never got there in one run, so eviction did nothing.VICTORY_SAMPLED_EVICT=1no room, new textures waitAn earlier run at the default 85 % let go of 49,038 slots, and 24,589 (50 %) of them came back. In the cutscenes many textures go unread for 30 s and are needed again. A longer idle time for these would probably cut that churn; not tried.
The player saw textures come in better with it on. I'm not counting that, because one such "better" run turned out to have evicted nothing.
The crash (open question)
Two runs with the switch on ended in the title's watchdog:
victory-image…+0x23cf683(write 0x0), after 33-34 s without a present, in the prestream of the same cutscene (fbk_stry000_FBK_STRY000_INTRO_min). That's the crash of #990 and #1031.So that cutscene breaks either way here. I can't say that eviction plays no part: 2 of 3 runs with the switch on crashed, and 0 of 5 with it off, too few runs to tell.
Tests
sampled::tests::the_used_words_cover_the_heap_in_whole_parts.cargo test -p victory-gpu --lib --locked: 455 passed, 37 ignored. Clippy--all-targets: nothing new (main's ownmanual_is_multiple_ofandlet_and_returnremain).Not tested: other cards, Series X, frame generation, open-world driving (only the cutscenes so far).
No game files, dumps or extracted data are included.
🤖 Generated with Claude Code
@Aniseto on GitHub · 2026-11-28 14:28 UTC · original
Ran the sampled-texture eviction test at
f3b7e62on an NVIDIA Blackwell desktop part:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, Rust 1.98.1 (48a229cea 2026-09-01, pinned by
rust-toolchain.toml), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env), debug build.The new test passes: the used words cover the heap in whole parts, which is the marking the opt-in eviction relies on. This is a CPU-side test; the branch is stacked on #1074 and its author reports only cutscene runs so far. The PR is a draft and has no comments yet, so this is the first datapoint in the thread and the first from an RTX 5070 Ti.
Not tested: open-world driving, a paired smoke run, a retail title, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
@futurepro62 on GitHub · 2026-11-29 03:18 UTC · original
In-game result for
VICTORY_SAMPLED_MARKS=1+VICTORY_SAMPLED_EVICT=1(#1074 + #1145, cherry-picked onto a local build) on an RTX 5070 Ti (16 GB), Windows 11 26300, Series X profile, 4K output, DLSS Performance, frame generation 4x: the marks made the game unplayable, and eviction never ran.Same build and launcher in every run; only the switches differ. Medians over the in-world windows of the
VICTORY_THINand frame-time lines:While moving, it held at 300–490 ms frames for about 30–40 seconds at a stretch. One run ended with Windows closing the game as hung (
AppHangB1). The marks buffer was in card memory (in_card=true).Caveat: the marks-on runs were short, about 1.5–2 minutes in the world each (three runs). But a marks-off run of the same length on the same build ran at its usual ~65 ms frames, and the player saw the slowdown whenever they moved.
Eviction never fired. Texture memory peaked at about 75% of the budget, under
VICTORY_SLOT_EVICT_PERCENT=78, and every status line read0 slots picked by index put back to null. So all of the cost is the marks.The cost is on the CPU side, not the card.
VICTORY_SAMPLED_EVERY). That cuts the card's reads and atomics by about 8x, and it changed nothing: still about 10–11 µs per call and 160–190 ms frames.settleslines) stayed at a few ms.Not measured: which function grows with marks on. I haven't profiled a marks-on run yet. (A profile of a different change, #638, showed list translation as the main cost but no single hot spot.)
Two more notes for anyone trying this:
VICTORY_SAMPLED_MARKSwas missing from the shader cache key on the base I cherry-picked onto. Without it, a marks-on run can be served translations made without marks, and eviction would then see on-screen textures picked by index as unused.mainkeys it already.VICTORY_SLOT_EVICT_PERCENT=78(under the texture queue's 80% line) costs nothing measurable.🤖 Generated with Claude Code
@futurepro62 on GitHub · 2026-11-29 03:26 UTC · original
Method for my report above, so it can be checked and repeated.
Hardware and settings
RTX 5070 Ti 16 GB, Windows 11 26300,
shaders.rpfof 1.0.2.1. Launched with the fork'sPLAY_FRAMEGEN.cmdmode 6 (Series X profile, big pools, High priority), with the F1 menu's saved choices on top: 4K output, DLSS Performance, DLSS frame generation 4x.Builds (all on fork
main9300875from 2026-11-28)Common to all: #339 (
e8e2dfc), #348 at5df24f4plus a local fallback-order fixcb325c5(posted in #348), and a port of Marvisak/VIctory#3619 (1f10565, atomic-sub loops on NVIDIA).1f10565315c941a410fd0, one-line import conflict resolved) and #1145 (f3b7e62) cherry-picked, plusVICTORY_SAMPLED_MARKSadded to the shader cache key (mainkeys it already)58ea7dfSAMPLED_ON) and mark only while it is set; the host sets it on 1 frame inVICTORY_SAMPLED_EVERY(default 8)Each build was warmed (
victory warm, withVICTORY_SAMPLED_MARKSset as in the runs) before it was played.Runs and switches
victory-nvidia-20261128-154834.logVICTORY_SLOT_EVICT=1at its default 85%...-180934.logVICTORY_SAMPLED_MARKS=1,VICTORY_SAMPLED_EVICT=1,VICTORY_SLOT_EVICT_PERCENT=78...-185120.log,...-185310.log...-190300.logVICTORY_SAMPLED_MARKS=0,VICTORY_SAMPLED_EVICT=0,VICTORY_SLOT_EVICT_PERCENT=78Confounds: the long marks-off run is on the build without the cherry-picks and evicted at 85%, not 78%. The runs were in different places in the game. The run on the same build and switches minus the marks is "marks off, later".
How the numbers were computed (from the logs)
victory_gpu::frame_timeslines. "In the world" means windows whose median is over 20 ms. Correction: the column labelled "Median frame" in my report above is the mean of those window medians (mislabelled). The real medians of the window medians (mean in brackets):...-185120)So in the "marks on" run, half the windows ran at the normal 71 ms pacing, and the slow stretches (300–490 ms, while moving) pulled the mean up. The "1 frame in 8" run was slow for most of its length. These are the game's own frames, before frame generation: 71.4 ms is the pacing on this setup (about 14 game fps, 56 shown); 160–190 ms is about 5–6 game fps.
list calls translated by threads of ours per frame: N in T mslines. Over windows with N > 20,000: mean N, mean T, and sum T / sum N. T is summed over all threads.texture slots shaders sampled ...lines. Every one in the marks-on runs read0 slots picked by index put back to null. Card memory came from thetexture queue's roomlines.Application Hang/AppHangB1for victory.exe.The marks-on runs weren't profiled. The CPU-profile procedure I used for #638 (
wpr+samply import+ a symbolication script) is in my method comment there.🤖 Generated with Claude Code
@psttt432454 on GitHub · 2026-11-29 11:31 UTC · original
@futurepro62 Thanks for the in-game numbers. I measured the marks on current
main(829188e9, v2026.11.29.01). There they're adwen-007's rewrite (7d0c2867: marks in a DEFAULT heap, read back once per present, one mark per wave) and they're on by default. On this machine they don't slow anything down.RTX 5070 Laptop 8 GB, Ryzen 9 HX, 32 GB,
victory play --series-s, launcher defaults. Same save and same spot, walking in the world, about 2.5 minutes each. OnlyVICTORY_SAMPLED_MARKSdiffers, and the shader cache was warm in both runs (--preloadwith that setting, thenhits=3065 misses=0).VICTORY_SAMPLED_MARKS=0VICTORY_THIN)So the per-call doubling you saw doesn't show up with
main's version here. The marks-on run is faster, which fits739f8339: with marks off,sampled_latelyisNoneand every texture counts as visible. That's one run each, so take the size of the gap loosely.One thing that may matter for your runs:
VICTORY_SAMPLED_MARKSis in the shader cache key, so the first run after flipping it starts with a cold cache. Here a marks-on run right after a new build (hits=0) went to 12 s frames at the title screen and Windows closed it as hung (AppHangB1). A marks-off run without a preload for that setting lost the picture, with 1-9 s frames and up to ~2,000 draws dropped while pipelines were made. Both were fine after a--preloadwith the same setting.