Repository navigation
resource: check unmapped_only instead of host_idle.is_some() in let_go_idle - #3272
Conversation
…e (port trustno1-coder#2486, trustno1-coder#3272) - trustno1-coder#2486 (eljoviz, open), code part only (its .cmd launchers left out): slot_evict let a texture go even when evict_slots() found one of its slots being made by another thread ("the texture is in use then, and stays" said the comment; nothing did it): now it stays (counted in SLOT_EVICT[6]). Also: highest_shader_model() uses the adapter it was given; card_steps tests forget pages an earlier test left; a duplicate '%' glyph arm in font.rs. - trustno1-coder#3272 (Maverick0351a, open): let_go_idle chose its locking and its "only wholly unmapped textures" path by host_idle.is_some() instead of the policy's unmapped_only. With host memory AND the card pressured (the chase in log 213111: ~34 GB resident, ~3 GB free, VRAM 9.95/9.96 GB) the policy picks the card's rule, but every mapped idle texture hit the unmapped-only checks and was skipped: no texture left the card. - Not ported: trustno1-coder#2890 (raw texture key in slot_evict): on .04 evictable_slots() already returns its map keyed by the title address; the PR's translation would have matched nothing and stopped slot eviction. Expected: VRAM let go again under both pressures (the chase); fewer textures freed while in use (missing/black textures). fps: indirect, via less spill (the card's lists went 28 -> 68 ms as VRAM filled in the prison). Switch: none (revert); slot eviction itself: VICTORY_SLOT_EVICT. Shader preload: not needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…instead of host_idle.is_some() in let_go_idle trustno1-coder#3272 by Maverick0351a, head a0f5fc3.
|
Confirming this on an RTX 3060 Ti 8 GB (i7-12700, 32 GB, Windows 11, driver 621.40, Series S, frame generation off). Without this PR, a 45-minute session went from 5.3 GB of card memory at the start to 8.8 GB of a 7.0 GB budget. Host texture copies grew from 2.8 to 5.6 GB, and fps fell from 13 to 5. Then the whole PC froze. Log attached. The log shows slot eviction "Evicting: yes" all session, but 0 textures let go. PC memory free stayed under 8 GiB, so This PR builds on 41adb55. The log analysis and code review were done with Claude (Claude Code); I ran the session. I'll post an after-run with this PR.Report from an affected 8 GB card. This line is what let the card's memory climb until my PC froze, and this pull request fixes the condition. |
…ped_only instead of host_idle.is_some() in let_go_idle trustno1-coder#3272
…essure too (trustno1-coder#3512) Playing with the first two commits, the minigame went from 8-9 fps to two to three times that, then stuttered again after about 15 minutes: the card went from 11.7 to 13.3 GB of its 15.3 GB budget, the card's rule took over from the host-pressure rule, and looks took 60 ms on average (238 ms at most) again. With the card's rule in charge and the PC's memory tight, the free loop still required the copy's title memory to be wholly unmapped (it tested host_idle instead of unmapped_only), so it asked about every candidate, freed almost none and walked the whole list each second (as trustno1-coder#3272 found). It now tests unmapped_only, and the look budget also applies to the card's rule while the PC's memory is tight. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I reproduced the mapped-idle case on WARP 1.0.22 against release main
The held copy survived all cases. After a retirement, the next access created a new host copy and the synthetic CPU backing bytes were intact. The existing resource unit tests passed 44/44 with one ignored on each revision. This measures eviction and recreation on WARP with uncontended locks. The long-session FPS and VRAM figures come from the field reports. For integration, #2591 contains these same two predicate changes and additional tile work. #3681 also changes the inner detach predicate and adds its own reload protection. Please carry the predicate fix once when landing the overlapping sweep work. This PR is the two-line version. GitHub shows only the label check for this head, so maintainer review and the normal Windows CI run remain pending. Release follow-up Both predicates are already present in Thanks @Lyrnc for the RTX 5080 sweep timings. The current release passes the two-predicate check. The sweep time on the current release and the FPS effect of the stacked changes remain field measurements. Another matched field pair with the same room settings on an RTX 5070 Ti showed 5.65 GB versus 3.2 GB of texture copies at minute 30 after changing the inner sweep condition. The patched run was under budget in all 175 samples from minute 16. This was one pair on an older locally stacked tree. Our current-release fixture above verifies both conditions. RTX 5070 Ti measurements |
|
Tested on an RTX 5080 + 9800X3D with 32 GB, Series X native 1440p, DLSS off, a scripted walk route, 300 s windows. On a 32 GB PC free RAM is always under 8 GiB while the game runs, so
We've carried it unchanged in our team fork, with your authorship. AI use: Claude Code (Claude Opus 5.5). |
|
Numbers for the same gate from a 16 GB card with 64 GB of RAM, where the PC's line is 16 GiB free instead of 8. Setup. Ryzen 7 9800X3D, RTX 5070 Ti 16 GB, 64 GB RAM, Windows 11. Series X at 2560x1440, DLSS Balanced, frame generation 2x, ray tracing on. Tree: main 41adb55 with a number of open pull requests merged locally, not this one. One scripted route, 31 minutes a run: 10 minutes of walking and camera turns, then standing, from the same save.
Without it, the PC fell under 16 GiB free at minute 10 of the second run (minute 2 of the first), and idle copies that no list and no slot held went from 12 at minute 8 to 35,750 at minute 31; slot eviction let go of 0 textures, since no slot shows them. With it, by the end: 247,162 copies let go (25,574 MB), 92,066 made again, 4,035 of them within 2 s (4.4 %), away 156.8 s on average. At 6,000 to 8,000 draws the submitting thread took 35.6 ms a frame against 46.8 ms, the card 41.4 ms against 45.4. One card, one route, one run per row, on a local tree rather than plain main. The cost to watch is copies made again soon after they go. The counting code (made again, within 2 s, time away) is on a branch if that line is wanted here. |
Problem
\idle_sweep_policy(host_idle, card_rule)\ returns \unmapped_only = false\ whenever the card itself is pressured (\card_most != u64::MAX || card_idle < 60_000), even when \host_idle.is_some()\ is also true (which is permanently true on a 32 GB RAM PC once < 8 GiB\ of physical RAM is free), so that mapped idle textures continue to be evicted from VRAM to keep the card under budget.
However, inside \let_go_idle()\ (\crates/victory-gpu/src/resource.rs:3119\ and \3131), the inner loop checked \if host_idle.is_some()\ instead of \if unmapped_only. As a result, whenever both \host_idle.is_some()\ and \card_pressured\ were true:
.host.used.store(0, Relaxed).
Fix
Check \if unmapped_only\ instead of \if host_idle.is_some()\ at lines 3119 and 3131 of \crates/victory-gpu/src/resource.rs, matching line 3103 and line 3176 and honoring \idle_sweep_policy's returned \unmapped_only\ decision.
Verification
Verified across a 26-minute continuous gameplay run on an RTX 5080 Laptop GPU (16 GB VRAM, 32 GB RAM):