Skip to content

Cards and captions: late art dissolves once per frame across glass walks; gliding captions fade at both edges - #854

Merged
GLinnik21 merged 6 commits into
mainfrom
crx-a1coll
Oct 19, 2026
Merged

GLinnik21 merged 6 commits into
mainfrom
crx-a1coll

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

Follow-up to #843. A frame-by-frame pass over #843's merged head in the simulator found two defects; this fixes both in the shared layer, each from a regression test that failed first.

What changes

  • Late poster art no longer pops in one frame. On the Collections page, the seated tile whose art arrived late stayed a blank placeholder and then showed its art and name in ONE frame, while its neighbours dissolved over 7. Cause, traced in the simulator: card_motion keyed a card's art-arrival history by how many times the card had been drawn earlier in the frame, and a non-player frame draws the page up to three times (the backdrop discovery walk, one replay per stale glass source, then the visible walk). The dissolve that starts when art lands stales the header glass, so a replay starts on that very frame and pushes the visible draw to an occurrence with no history, which reads as "art already shown". Now a card's history advances once per frame, by the first walk that draws it, and every later walk of that frame reuses the answer (gfx::backdrop::walk_serial() identifies the walk). Every card grid outside the player draws through the one resolve_card_art site, so all of them are covered; no screen code changes.
  • A gliding caption fades at its leading edge too. A long collection name held to its tile scrolls on the shared marquee; its trailing edge dissolved over 24 px but its leading edge was cut mid-letter. The text-fade program gains a leading band (u_tlead, GLSL ES 1.00, gated like the existing bands), plumbed through draw_text_fade and a new Painter::text_fade_edges; card_row::block_text applies it while the run is past the window's left edge, growing with the travel up to 24 px (so the first glide frame does not dim the line's head) and none at rest. Existing text_fade/text_fade_v callers are unchanged.
  • Docs: card_motion/backdrop module docs, ui/src/CLAUDE.md, the shader header and two older comments that had gone false.

Verification

  • On the committed head (f6f2620): make check exit 0 (cargo — ok, python — ok, rest — ok, 103 steps — all ok, harness — ok; 29 test result: lines, all 0 failed, 18233 passed); make test-hostsim ok. 926 passed; 0 failed; make check-nodef clean; make check-replay 3 fixtures / 6 replays, 0 failures (no re-record).
  • Red first: late_art_dissolves_in_the_visible_walk_when_a_glass_source_replay_starts_with_it failed with the visible walk at 1.0 on the landing frame; the within_tile leading-band census tests failed (a gliding run dissolves in over the window's first edge-fade px). Both pass now.
  • Simulator, the recipes that found the defects: the seated Collections tile's art dissolves over 8 frames in each of 3 late-art runs (largest one-frame step 0.18), its name on the same ramp; its neighbour and the Library's seated card still dissolve. The gliding caption's leading edge ramps from luma 48 to 227 over x 96-120 (was a 49 -> 228 step at one pixel), is crisp at rest, and keeps its trailing ramp. No shader compile or link failure.
  • TV (webOS 4.5, release build of f12cdb3 = this head minus a comment-only commit, guest + mock server, panel on, muted, 60 Hz): fps:library-collections 60/60, library-scroll robust_min 59 (median 60), library-recommended 60/60, watchlist-idle PASS; the text-fade program links on the set (no "text fade prog link failed" in any log). library-switch read median 7 fps against its floor of 8 on a run made while make check loaded the Mac, and 9 (PASS) on the re-run; its drawn-frame totals over the graded windows are 349-355 on this build, Library: Collections redesign (header row, Collections and Recommended pages, Under posters, scroll chrome) #843's head and the build before it, so the work is unchanged (see follow-ups). 136 s every-frame Library scroll: 75 of 8940 frames >= 22 ms (0.84%), the same as Library: Collections redesign (header row, Collections and Recommended pages, Under posters, scroll chrome) #843's merged head (75 of 8943); 91% of them wait in GL draw (the back-buffer wait the earlier profiling traced to GPU work outside the app), 2 are poster-upload frames.
  • One Opus review of the whole diff: no blockers or shoulds; its nit (the reuse path's nested-walk invariant) is documented on observe_in. A doc-claim audit found one stale test doc and two older false comments; all fixed.
  • No Makefile, Cargo, build.rs, workflow or module-layout changes, so no build-bench table.
  • The design-agent team (lead + member, exchanging findings by message) reviewed Library: Collections redesign (header row, Collections and Recommended pages, Under posters, scroll chrome) #843's merged head and this fix against every item its previous round left undetermined: 0 blockers and 0 shoulds on this head (the two shoulds it found on Library: Collections redesign (header row, Collections and Recommended pages, Under posters, scroll chrome) #843's head are the two defects fixed here).

Follow-ups (not in this PR)

🤖 Generated with Claude Code

GLinnik21 and others added 6 commits October 19, 2026 22:19
…rival history

The seated Collections tile popped its late fan in one frame (FRAMES-4 a1-coll). card_motion keys
a card's art history by its occurrence in the frame; app::run::draw walks the page as discovery,
then one replay per stale glass source, then the visible walk. The dissolve that starts when the
art lands makes the header glass's source stale, so a replay appears on the landing frame and the
visible draw moves from occurrence 1 to 2, which has no sample the frame before and shows whole.

This test reproduces that frame structure with the real backdrop walk scopes and fails today:
the visible walk shows 1.0 on the landing frame. No fix in this commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Root cause (DEBUG-5, the seated Collections tile popping its late art in one
frame): card_motion::History keyed a card's art phase by the draw's place in the
whole frame, the n-th call to Scope::card for one (owner, asset). The
application draws the page several times a frame (the discovery walk, one replay
per stale glass source, then the visible walk), so the visible draw was
occurrence 1 on a still frame and occurrence 2 on a frame with a replay. When
late art lands, the dissolve it starts makes the header glass's source stale, so
a replay starts on the landing frame; the visible draw moved to an occurrence
the previous frame never had, read as art that was there from the first draw,
and showed whole in one frame while the discovery and replay draws dissolved
underneath.

Fix, in the shared layer only: the first walk of a frame that draws a card
advances its history (verdict, art phase, how much of the art shows) and stores
the answer in the frame's sample; every later walk of that frame reuses it and
records nothing, so discovery, replay and visible draw the same alpha. A card's
occurrence now counts its draws within the current walk, so two copies inside
one walk (outgoing and incoming surfaces) stay distinct, and a card only a
later walk draws still advances its own history there. gfx::backdrop gains
walk_serial(), the id of the walk that is drawing; it lives in the Walk, so it
comes back when a nested walk's scope drops (the visible walk is entered first
and resumed after discovery and the replays). No caller changes: resolve_card_art
is the only Scope::card site. Module docs of card_motion, backdrop and the ui
guide describe the rule.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ow's leading edge

Adds the leading-band field to the draw census (inert for now) and the card_row
tests for the leading dissolve: a within_tile caption gliding with dx < 0 must
record a leading band over the window's first LABEL_EDGE_FADE px, one at rest
or parked must draw crisp, and the band must grow in with the travel. The
gliding and growing-in tests fail on this tree: nothing draws the band yet.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…eading edge too

The shared text-fade program gains a leading horizontal band (u_tlead, alpha 0 to 1,
gated like the other bands so an unused one costs a uniform compare), threaded through
draw_text_fade and draw_text_fade_tracked (re-anchored per cluster like the trailing
band). Painter::text_fade_edges takes both bands; text_fade is now its trailing-only
form, so existing callers are unchanged. card_row's block_text hands a within_tile run
its window and dissolves the part that has glided past the left edge over the
window's first LABEL_EDGE_FADE px, the trailing rule untouched.

A run at rest draws crisp, and the band grows with the travel (none at zero, the full
24 px from 24 px of travel on) so the first glide frame, a fraction of a pixel past the
edge, does not dim the head of the line in one step; a line parked at the end of its
travel, which sits on the edge to within an ulp, is also treated as at rest. The fade
program keeps its link-failure fallback to plain text.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… and the two-sided fade

Comment-only. The doc of late_art_dissolves_in_the_visible_walk_when_a_glass_source_replay_starts_with_it
described each walk's draw as its own occurrence in card_motion's history, which stopped being true
with e3d8283 (occurrences count within the current walk; later walks reuse the first walk's
sample); it now tells the defect in the past tense and says what holds. History::observe_in documents
the invariant its reuse path relies on (no walk draws a card both before and after a nested walk that
also draws it). text.rs no longer says the horizontal fade relies on a sentinel width (the shader gates
on `to > from` for every band), and tracks_panel.rs no longer says fs_text_fade has no y-axis twin
(it has u_vfadeT/u_vfadeB and Painter::text_fade_v).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@GLinnik21
GLinnik21 merged commit 1a91d21 into main Oct 19, 2026
19 checks passed
@GLinnik21
GLinnik21 deleted the crx-a1coll branch October 19, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant