vkback: keep the old view of a held new image (VKB_HOLD_NEW_KEEP, off) #266
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/vktory6--VKtory!266
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-266"
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?
@lordra9-svg on GitHub · 2026-12-02 18:56 UTC · original
lordra9-svg:fix/hold-new-keep→main· +240 −28 · 7 files · 1 commits · openWhat
docs/TASKS.md:626"Newly made images show empty for a frame": behindVKB_HOLD_NEW_KEEP(default off), keep a held slot's old same-kind image descriptor and pin its image/view until the retry, instead of nulling the slot. This is victory-gpu'sshow_new_laterkeep (kin) idea; the counter merged as #236 showed 5,958 reads of held-null slots in a clean run, i.e. draws sample 0 where the console shows the old image.Change
holdkeep.rs:hold_keep_begin(addr, index)pins the old image (showncount) beforeslot_resetreleases the slot, when the slot held a plain image view (no twin/exact hook);hold_keep_releasedrops the pin.slotwrite:hold_new(..., keep)leaves the old descriptor bytes in place when kept; the pin is released at the end of a write that did not end in a hold, or onretry_droppedafterwrite_null_slot(so a retry dropped bypeek_smallnever leaves old bytes naming an unpinned image).arena::take_retry_slotsno longer releases the pin itself (it cannot know a retry will be written). Off: byte-identical old path.heldreadstats line says "old view kept (VKB_HOLD_NEW_KEEP)" only when the switch is on.Verified
cargo test -p vkback --lib: 176 passed (pin survivesslot_reset, released once, dropped-retry nulls then releases); policy 6; clippy-D warnings; build exit 0.reads of a slot held null ... 4115, 0 keep notes, 0 faults.reads of a slot held ... old view kept ... 5240, 34old view keptholds, 0 faults.VK_LAYER_KHRONOS_validation, 200 s, switch on): only the four known VUIDs (06409 x4, 01687/01688/03428 x20), no device loss. Keep path exercised (25 holds, 155 held reads under the layer).Caveats
b7fixedsave is an animated cutscene, so F9 frames are not comparable); this stays an experiment until the picture gates and a longer device-loss run pass.Same/Moved/Sizeddefault.arena.laterand are retried as before; only what the slot shows in between changes.@vktory6 on GitHub · 2026-12-02 19:35 UTC · original
Thanks. This is a clean piece of work: the pin is taken before
slot_reset, it is released afterwrite_null_sloton a dropped retry, and with the switch off the old path stays byte for byte. I read it against victory-gpu'sshow_new_laterkeep. Before we merge, three points:kin: Same/Moved/Sized). Here any plain image view counts. A sampled-image descriptor can then stay in a slot whose new write is a storage image, and the other way round. With descriptor buffers, those two descriptor types differ in size and layout, so a shader that reads the slot as the new kind reads bytes it does not expect. That can mean a wrong picture, or a device loss on stricter drivers. Please record the old descriptor's kind (SRV/UAV and dimension) next toFLAG_IMAGE, compare it with the held write, and keep only on a match. A unit test for the mismatch case would cover it.On evidence: the A/B in the animated cutscene does not compare (as you say), so the fps difference does not count. Once 2 and 3 are in, one run at a fixed scene point with the switch on and off, plus the validation run you already did, is enough for an opt-in experiment.
On how this relates to the holdfrees branch (title frees in stream order, https://github.com/vktory6/VKtory/discussions/248): they touch different code. Holdfrees orders the title's frees behind GPU work; it does not change
hold_new. The pin here keeps our image alive, though, not the title memory under it, which is one more reason for point 3. Holdfrees' failing boat gate turned out to be a run that never left the intro cutscene, not a picture difference, so it says nothing about this PR.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.