vkback live: cache slot reads whose words are no view #48
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!48
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-48"
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?
@Mhyster on GitHub · 2026-12-01 03:59 UTC · original
Mhyster:slot-cache-no-view→main· +28 −3 · 4 files · 1 commits · merged 2026-12-01 08:13 UTCWhat
live/slots.rs caches slot reads whose words are no view (
Resolved::NotAView) as it caches resolved views. Answers that depend on the view table (stale generation, beyond the table, bad shape) are still tried again at every read.Why
Only resolved slots were cached, so each read of a slot whose tag is not
vVIE(a render-target record, an empty slot in a page the cache had not seen) was resolved, noted and nulled again: ~11.5k index slots a present (prison30.md).NotAViewcomes from the words alone (ViewTable::resolvechecks the tag before the table) and its write is the same null each time. The backend's own writes to a slot uncache it as before (forget_slots). The slot cache's doc on all-zero words is corrected: they are the default, and an empty slot is no view, so a hit is right.Verification (rule 27)
Added 2026-12-01: the pairs below are bb34500 (
2dd59dawith the open PRs #22 and #29 merged, just-another-dude84/VKtory@324542c cherry-picked and a local translator version bump) against bb34500 with this change (2181d35). This change also ran in #47's validation run as part of 1da3463, with no new error against bb34500.cargo test -p vkback --lib. RX 9070 XT, Ryzen 5 9600X, Mesa 26.3.1, own save left standing, 180 s after a 120 s load, two interleaved pairs: recording and submitting 13.7/13.7 -> 12.3/13.2 ms a frame, renderer thread 77.8/77.2 -> 73.6/76.1 % of a core; fps within the spread. A small renderer saving, not a frame-rate change by itself.Validation run (rule 30): the Vulkan calls stay the same (a cached slot already holds the null the write would make again); none run.
Learning:
docs/learnings/vkback-live-cpu.md, "Slots that are no view, cached".What is left: ~2.2M slot reads per 5 s still resolve to no view; a counter put all of them inside the view heaps, and they miss although cached (their words differ from the last read, or the address is new), so no cache holds them. Only fewer reads would (the descriptor heap as one array). In the learning.
The fps numbers are from the house scene, which docs/tools.md now calls a smoke check only (its view switches on its own); the refusal counts and recording times are the measurement, the fps only shows nothing got worse.
🤖 Generated with Claude Code
VUID-VkSparseMemoryBind-memory-02730on main (not on the TASKS.md list) #42@vktory6 on GitHub · 2026-12-01 08:13 UTC · original
Merged, thanks! Caching
NotAViewis safe: the decision depends only on the words, and the cache entry is keyed on them, so changed words resolve again. Check on the reference system (RX 9070 XT): tests pass, and the house-scene validation run shows no new error.