Repository navigation
Library: a key on a deep Recommended page no longer costs a late frame, and library-shelves-deep can pass - #860
Merged
Merged
Conversation
… and library-shelves-deep walks it #843 let the Recommended page answer the empty line from the bridge's content probe while library-shelves-deep kept waiting for a region=grid and six extra Downs, so the scene could not pass on any build: the focus log held two lines. The page now answers the Library's one grammar (region=shelf row= col=, heading/crumb/strip elsewhere), the scene grades region=shelf with no extra rows, and library-shelf-paging-held-3g / -remote-wan, which read region=shelf, get their fingerprint. A harness test reads the words each page can print from its probe_viewport and fails a scene whose fingerprint_region or reach.region is not among them, so a scene cannot wait for a word its page never prints again. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Home's catalog sync kept a row whose identity, title and cards were the ones it was projected from by taking it out of a Vec<Option<_>> of the old rows, looking a moved row up through a lazily built identity map, and leaving the rest as the rows nobody kept. That matching moves to registry.rs as RowSeats/RowDiff so the Library's Recommended page can run the same one; Home calls it and its behaviour (and its SyncCost pins) are unchanged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…e page holds RecommendedScreen::rebuild re-registered every slot of every row on each publication, took each old row out with Vec::remove (a 920-byte memmove per row) and built two all-element HashSets; with 170 hubs the store publishes about once per key press and that was 1.7 ms of a 2.4 ms frame on the host. It now matches the old rows to the new hubs through the registry's RowSeats, the matching Home's sync uses, and keeps a row whose Basis (its hub, length, card identities, linked heading, and for placeholders the query they were minted under) is the publication's: no key is registered for it, and a row that only moved (a hub inserted above) is seated again by its group and heading. The basis is compared whole rather than through Shelf::epoch because a release (settle_from) does not move the epoch and a fresh parse carries epoch 0 for a row nobody walked. A remount over a memory (restore) or a hub listed twice builds every row, as Home does. The keys a changed row gave up are swept when the region stands a batch over its bound, off KeyRegistry's per-region counts, instead of by scanning the table on every publication. A kept row keeps its page-ask latch (a landing on a row changes its basis, and an unanswered ask retries on the ladder). Tests: landing one row registers the same keys on 10 and on 170 hubs (red before: 250 against 4250); an incremental sync is the page one full build makes over random landings, hold moves, refreshes with reordered and repeated hubs, and remounts; a hub inserted above seats the moved rows without registering their cards. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The store refuses a page ask computed from a window a landing has since replaced (HubPage.seen), and says the publication it missed re-arms the row, which asks again. rebuild reset only the rows it built; a kept row kept asked == Some((len, end)) and in_flight == After, so the refused ask waited for the retry ladder (a quarter of a second, climbing to half a minute) with the row's trailing cells painting as skeletons, where it went out again on the next tick before 732b33e. A kept row is reset as well (three field writes, no key registered). Test, red before the fix: a kept row's refused ask is asked again on the next tick after a publication that changed another row. The two store docs that promised the re-arm now say what re-arms the row. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…unts The random full-build equivalence test now also moves the listing's query with a publication (a row the store gave up is its placeholders, keyed by the query they were minted under), runs a second stream on pages small enough to reach the lazy key sweep, compares the index each group key remembers, holds the key table to the bound the sweep keeps after every build, and checks the keys the page held a publication ago survive it. Refreshes give the cards they gave before half the time, so a hub that recurs is a kept row that moved. New: the key table stays bounded over 120 rotating refreshes (and a sweep ran), and KeyRegistry's per-region counts equal a scan of the table after a random mix of minting, pruning and remounting from memory. Each was checked against a mutant (the query term out of Basis::matches, a count not kept in prune or register, the sweep removed or without the previous publication's keys, a moved row not seated again): each mutant fails a test. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… two nits bridge.rs: Collections is a LibraryScreen and prints the focus fingerprint; only an unmounted page answers the empty line. registry.rs: KEY_PRUNE_BATCH's doc named Home's sweep alone; the Recommended page sweeps its item and slot keys with it, and those can be named again. tests/manifest.json: library-shelves-deep and the two library-shelf-paging-held scenes carry their television result (2026-10-20, ARM release, own mock) in place of "not yet run". Nits: the scene-region validator no longer counts none, library or status (no focus, focus the page does not classify, the retry button) as regions a walk goes into; mock_fps.py's walk example no longer pairs extra_rows 6 with the grid for the shelf walk. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Recommended rebuild: a publication re-arms every row's page-ask latch in one loop after the rows are built (kept or built, one rule, one comment); the lazy sweep keeps one set; the card count has one reader (`cards_held`). `RowSeats::finish` reads the row count it matched instead of being told it. The sync tests share `Fixture::named_shelves` and `Fixture::republish` (the paging tests' copy of the same seeding is gone) and draw from `plx_ui::fixture::Walk`. The harness validator loses an assertion its own subtraction made unfalsifiable. tests/manifest.json: the library-shelf-paging-held PASS lines name what their pair is (robust_min, median loop/s), not "loop 50/52". Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Oct 20, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On the TV, a key press on a library's Recommended page with many shelves cost a late frame, and the scene that measures it,
library-shelves-deep, could not pass at all. This PR fixes both. It is the Library half of #858.Cause
The scene was blind. Library: Collections redesign (header row, Collections and Recommended pages, Under posters, scroll chrome) #843 sent
library-shelves-deepto the Recommended page, butbridge.rs'scontent_probeanswered that page with an empty line. So the walk never saw focus move; the held-paging scenes (library-shelf-paging-held-3g/-remote-wan) had the same silent probe. This was true onmainsince Library: Collections redesign (header row, Collections and Recommended pages, Under posters, scroll chrome) #843, not a regression from Home: a key press no longer costs a late frame - key tables update in place, the catalog sync touches only changed rows, the hold band has hysteresis #858.Every publication rebuilt every row. About one store publication arrives per key (
section_hubsbumps its revision as each held row lands).RecommendedScreen::rebuildthen:Vec::removed every row (920 B each, about 13 MB moved per publication at 170 shelves);Stringclones);On the host this was 1.3–2.0 ms per publication. On the TV, late frames carried an 11.2 ms median store step.
Fix (shared where Home already had the mechanism)
registry.rsasRowSeats/RowDiff, and Home calls it unchanged.Basisis equal: hub, length, each column's identity, the linked heading and the placeholder query. Every content read (art, label, progress, caption, title, link) already goes to the store each frame, so a kept row cannot show stale content. Kept rows are re-seated, not re-registered, and every row, kept or rebuilt, re-arms its page-ask latch on a publication.restoreand a publication that lists one hub twice still do a full build.KeyRegistrykeeps per-region counts. The shelf-key sweep runs when the table passes twice the live keys plus a batch, and prunes back down. It is bounded and is not a cap on reachable content, because a pruned key is minted again on demand.Verification
Red first:
PER_ROW + 2on both).a_kept_rows_refused_ask_is_asked_again_on_the_next_tick_after_a_publication.last_place.count()against a table scan.Gates on the committed tree (
git status --shortempty before and after):make checkexit 0:103 steps — all ok, harness ok,plx_screenstest result: ok. 1622 passed; 0 failed;make test-hostsimok. 932 passed; 0 failed;make check-nodefclean;make check-replay3 fixtures, 6 replays, 0 failures, every replay SAME.TV (ARM release build, 60 Hz, panel on, muted, mock only), 732b33e:
library-shelves-deeplibrary-shelf-paging-held-3glibrary-shelf-paging-held-remote-wanlibrary-recommendedlibrary-scrollIn the two held-paging scenes, 11–12% of frames go over 33 ms. Those are GPU-bound card fragments while a row pages, not the store, and are being fixed separately in the shared card compositor.
Host (sim, 170 shelves): store-frame nav commit median went from 2.7 / 1.4 ms to 0.4 / 0.6 ms, and rebuild from 1.98 / 1.29 ms to 0.10 / 0.13 ms.
One review: no blockers, four shoulds, all fixed here. It also found no stale-content path, no wrong-card path for restore, BACK-to-top or Detail return, no replay-anchor change (no anchor mounts a Library page), and Home's behaviour identical.
No crate, Cargo, Makefile, build.rs or workflow change, so there is no build-bench table.
Not in this PR
🤖 Generated with Claude Code