Draw: a held slot does not walk the pages first (part of #1521) #1877
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by unueberlegt on 2026-11-29T01:21:47Z.
What 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 #4634 (#4707, dup #4679), 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
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by amazedturnip on 2026-11-29T05:38:54Z.
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.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by gut0to on 2026-12-01T14:38:20Z.
Code review location:
crates/victory-gpu/src/draw.rs; line 4684visibleis 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.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by gut0to on 2026-12-01T14:38:20Z.
Review: COMMENTED
AI-assisted review; I used an AI assistant to inspect this diff.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by unueberlegt on 2026-12-01T16:16:29Z.
Code review location:
crates/victory-gpu/src/draw.rs; line 4684Fixed 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 #4634 (font.rs, menu.rs, panel.rs — byte-identical to main here), with #4707 open for them (dup: #4679).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.