Draw: a held slot does not walk the pages first (part of #1521) #1877
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!1877
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1877"
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?
@unueberlegt on GitHub · 2026-11-29 01:21 UTC · original
unueberlegt:perf/1521-first-upload-walk→main· +155 −38 · 2 files · 5 commits · openWhat it changes
The pass over the textures picked by index (the heap's buffer views and friends) walked a placed view's pages with
mapped_bytes()— VirtualQuery over whole textures — before it asked whether the card's fullness holds the slot. A held slot's answer (nothing mapped, or mapped in part) was thrown away: the slot is toldHeldand looked at again in about four seconds, or as soon as the card has room.Now the held decision runs first (it needs only the view and
texture_slot_made_from), and a held slot never walks. A counter (HEAP_TEXTURES_HELD_SKIP) in the 5-second line says how many slots skipped the walk:Behavior delta (said plainly)
Under
!room, an ineligible slot that streamed out is now toldHeldinstead ofAway— the walk was the only way to see that its memory is gone, and held slots do not walk.texture_slot_gonefor such a slot runs on the next pass with room (the slot's tell re-checks then); nothing leaks, the host copy's bytes are still resident.Why
Point 4 of #1521: on a full card the walks cost 87–281 ms of every 5 s plus recording-thread lock contention behind
mapped_bytes. On our machine (RTX 5070 12 GB, Ryzen 9 9950X3D, 31 GB, Series X 2560x1440, prologue) the pass stands under!roomalmost constantly: 3,716,941 held slots skipped the walk in one ~10-minute run (and 3.4M in a second). The skip is the pass's own answer: its walk exists only for slots that go up.How it was tested
cargo testpassed for the crates it touches:victory-gpu590 passed / 0 failed (and 644 with--features diagnostics);clippy --all-featuresat the base's warning count (10, none new).held_for_fullness_with_nothing_going_up_is_said_before_the_walk(the held predicate over a room/made/reupload/first-room/window matrix).window_asked); new testan_unsampled_first_upload_does_not_ask_the_window.cargo test -p victory-gpu --lib: 1097 passed / 0 failed; both clippy gates show only main's own five findings from #4635 (#4708, dup #4680), none from this branch.Checked for overlap
draw.rsor the texture pass.0174844(the shadow copy state lock) is merged and takes #1521's second point.The other three points of #1521 are left to those PRs and
0174844; this one takes the fourth.🤖 Generated with Claude Code
@amazedturnip on GitHub · 2026-11-29 05:38 UTC · original
Tested on 9800X3D + RTX 5070 Ti 16 GB across 20+ min sessions (including under heavy texture churn). Skipping VirtualQuery on held slots ran cleanly with zero faults or stale views.
@gut0to on GitHub · 2026-12-01 14:38 UTC · original · reviewed
AI-assisted review; I used an AI assistant to inspect this diff.
@ -4650,3 +4684,1 @@match first_upload_reserve(reserve, memory, has_commit) {WindowAdmission::Admitted => first_upload = true,WindowAdmission::Full => {}let has_commit = first_room && rest(6, || crate::residency::admit_texture_pass(required));@gut0to on GitHub · 2026-12-01 14:38 UTC · original
visibleis computed above but no longer gatesfirst_window, so an unsampled first texture can consume the five-second first-upload allowance whenever the room and reserve checks pass. That can spend the budget on off-screen textures and defer visible faces; the previous condition requiredvisiblehere. Could you includevisiblein this admission condition and add a regression test that an unsampled first upload does not consume the window? AI-assisted review; I traced the admission path and compared it with the previous gating in this diff.@unueberlegt on GitHub · 2026-12-01 16:16 UTC · original
On
crates/victory-gpu/src/draw.rsline 4684 (outdated):Fixed on the branch (
09c3aea7): the gate is back.window_asked(visible, first_room)sits before the commit consult andfirst_upload_reserve, so an unsampled first upload books neither the commit nor the five-second window, and itsCommitDeferredcan no longer stop the pass. With nothing of it going up the slot is held before the walk, like every held slot — the caller passesfirst_window = falsethere, soheld_and_nothing_goes_up's truth table is unchanged, andan_unsampled_first_upload_does_not_ask_the_windowpins the gate. The unusedvisiblewas this PR'scheckfailure; the five findings left in that run are main's own from #4635 (font.rs, menu.rs, panel.rs — byte-identical to main here), with #4708 open for them (dup: #4680).View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.