Repository navigation
Home: serve the parked hero backdrop from the retained region cache - #1302
Merged
Merged
Conversation
While Home is parked at the hero the backdrop (wash, art, scrim) is static, but it was re-shaded every frame: ~2.6M of the frame's 9.5M GPU_ACTIVE cycles on the television. Paint it once into the shared region cache (gfx::region_paint) and serve one quad until an input changes. Painter::cached_ground is the exact-semantics sibling of cached_region (only through a plain painter); Backdrop::ground_key names the picture by every input it draws (wash corners, per-layer art id/revision/size/position, scroll offset, hero alpha, the ground-mode switches) and refuses a name while anything moves, so a slide or a settling spring draws live. Glass and the discovery/source passes decline the region and draw live, so their recorded draw arguments and source pixels are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fter a trip to the grid A bare Spring::step parks the dive one ulp off its target with a velocity of ~1e-44 and keeps it there, so the backdrop's rest test (dive velocity exactly 0) was false for the rest of the page's life after the first Hero -> grid -> Hero trip and the cache never engaged again. Land it like the art and wash springs. A reveal spring with no texture behind it no longer vetoes the name, and the cached_ground doc says what a non-plain painter does to the region ask. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… lands exactly The dive's Spring::land (previous commit) changes the hashed state of the page from the frame the dive to the second shelf lands (frame 198 on): present, input, result, land, effect, focus and hit counters all stay zero. Attributed by replaying the committed anchors against a build with only that call removed (all three SAME). Re-recorded on the unchanged shape; only the recording segment is replaced and Targets and Resolve replay SAME, three runs at 1920x1080 and one at the CI window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Home's backdrop draw now takes main's shared side and shelf shade (the scrim), so the cached ground is named by it too: WashScrim::paint_bits (ink, the shader's mode and every uniform) joins Backdrop::ground_key, and HomeScreen::backdrop_shade builds the frame's shade once for the draw and for the name. The one-pass hero ground switch main removed leaves the key (two renderer switches remain). The replay anchor is main's, to be re-recorded after the dive landing. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… re-recorded The entry (frames 198 on, 64 of 262) described a re-record of 1-boot-home-chip-grid that is not in this tree: the anchor here is main's historical AppFrameV4 fixture, which the dive landing diverges from frame 154 (46 of 200 frames, every other counter zero). The entry returns with the re-record. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Home's snap dive now lands exactly (Spring::land), which moves the recorded canon of the anchor from frame 154 (46 of 200 frames, every other counter zero). The fixture was a historical key-only AppFrameV4 recording the current recorder cannot emit, so it is re-recorded as a current AppFrameV5/codec-6 recording (state_fp 13512213413816145485, 266 frames) with plxnative-rec rerecord, which keeps the anchor flag. This retires this one fixture's V4 ledger; 6-settings-family stays a V4 fixture and replays SAME. The pins follow: recorder.rs's fixture preflight row takes the current shape and 266 frames, and the frozen-V4 manifest loop drops the fixture; test_harness.py's fingerprint table takes the current state_fp. The README gets the census entry and no longer calls this fixture historical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fixture is now a current-format recording: its manifest is closed-enum structural like the -current fixture's, so the outbound guard refuses it by the same rule, and the policy census counts 266 frames for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es its own state Review findings on #1302. - Backdrop::ground_key tested only the reveal spring's velocity, but bind leaves a spring at velocity 0 where it jumps (a replacement at the draw) and where non-resident art arrives (parked at 0.0): a resident layer at pos < 1.0 got a name for one frame and paid a full 1928x1088 fill wasted the next. A resident layer is stepped toward 1.0 and landed there, so it is settled only at exactly 1.0 with no velocity (both layers). The reveal alpha drops out of the name: a named layer is always at 1.0. Two tests fail against the old gate (the spring states directly, and art arriving at draw_page's bind). - The screen read renderer process state (tex_ledger::revision, art_wash_ok, wash_ink_ok). Painter::cached_ground now takes the texture ids the picture samples and gfx::region_ground_key mixes each one's revision and the two program switches into the key, so the screen's name holds only the screen's own state. The revision assertion moves to a gfx test. - Docs: tests/README.md no longer states a stale Home frame count; region_frame_end names which pages ask every frame now that Home is a second caller; the ui CLAUDE.md bullet follows the new split. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GLinnik21
marked this pull request as ready for review
November 16, 2026 16:40
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.
What
While Home is parked at the hero, its backdrop (the AmbientWash, the hero art over it and the scrims) is static, but it was re-shaded every frame. On the television (Mali HWCNT,
frame.ui, before this change) the ground'sgradplusimageclasses cost about 2.6M of the frame's 9.5M GPU_ACTIVE cycles (about 3.9 ms at 672 MHz), frames finished about 0.5 ms past the compositor's aim instead of 2.5 ms early, and grid-pong / hero-pong missed 18-50 refreshes per 60 cycles against 5-15 before. About 82% of the screen is unchanged frame to frame in grid-pong.This paints the backdrop ONCE into the existing retained-texture region cache (
gfx::region_paint) and serves it as one quad until an input changes. No damage-region renderer; no new cache.Design
Painter::cached_groundis the exact-semantics sibling ofcached_region(one private body,cached_in, behind both).cached_regionserves its picture as a GROUP, so a painter's alpha, gain or translate is applied to the texture; a ground's primitives take the alpha one by one (Painter::ambientmixes the wash toward the app ground), which is not the group's blend. So a ground is served only through a plain painter (Painter::is_plain: a page at rest, not dipping, not sliding) and drawn live through any other. The Under posters preview'scached_regionis unchanged.Backdrop::ground_keyholds only the screen's own state: the exact bits of the wash's twelve corner springs (AmbientWash::paint_bits), each art layer's texture id and decoded size, the dive (env.sp, from which the art's offset and the hero's own alpha follow) and main's shelf shade (WashScrim::paint_bits). The renderer folds in what only it knows:Painter::cached_groundis handed the texture ids, andgfx::region_ground_keymixes in each one'stex_ledger::revision(a texture re-specified under one name is another picture) and the two program switches the ground's paths read.AmbientWash::at_rest, each resident art layer standing at exactly 1.0 with no velocity, the dive) and there is no slide. This needed one real fix beyond the cache: the dive was only everstepped, and a bareSpring::stepparks one ulp off its target with a velocity of ~1e-44 and stays there, so after the first Hero -> grid -> Hero trip the cache would never engage again.HomeScreen::updatenow lands the dive (Spring::land), as the art and wash springs already are. A regression test (the_backdrop_has_its_name_back_after_a_trip_to_the_grid) failed before that call ((3e-45, -1.8e-44)) and passes after.backdrop::discovering()/blur_source_pass()), so the ground still declares and draws its primitives there exactly as before and GLASSDIFF keys on the same arguments; the inline capture andsample_control_groundread the framebuffer, which holds the same pixels.region_resident_bytes()was already summed there); it is one slot, one picture on screen at a time, andregion_frame_endgives it back on any frame no page asked (the grid, a dipped page, another screen).ci/check-deps.shledgers unchanged. The key is a pure function of the screen's own state; the fill and the quad are the renderer's./tmp/plxnative-nopreviewcachenow also draws the Home backdrop live (same binary A/B).Evidence
On head 0695176 (origin/main 8e8330a merged in; review fixes in the last commit):
Merge. Main's Home changes since the branch point (refactor(ui): complete owned presentation and replay inputs #1392, refactor(sans-io): complete machine input and effect boundaries #1358, Polish the Home hero, Continue Watching, and Detail shading #1310-RC 2 polish: Yellow reaches SRT/ASS tracks, timed skip prompts follow the countdown, hero title gap #1345, Continue Watching: a server that answers second no longer hides its newest cards behind the deck #1405) are taken as they are. The ground is now named by main's shelf shade as well:
WashScrim::paint_bitssits besideAmbientWash::paint_bits, andBackdrop::drawandground_keytake the shade. Polish the Home hero, Continue Watching, and Detail shading #1310 removed the one-pass hero ground, so the key reads two renderer switches (art_wash_ok,wash_ink_ok).Tests.
make check: exit 0, everytest result:ok with 0 failed (screens 2179 passed, app 1420, hostsim app 1627, ui 1637, gfx 261, media 2136, hostsim media 2416), and the Python harnessRan 745 tests … OK.make check-nodef: exit 0.make ARM_PROFILE=release: exit 0.the_backdrop_has_its_name_back_after_a_trip_to_the_gridfails with theSpring::landcall removed (the dive parks at(3e-45, -1.8e-44)) and passes with it.Replay anchor
1-boot-home-chip-grid, replaced. With the dive landed, it DIVERGED from f=154 (46 of 200 frames) in Targets and Resolve, with every other counter zero. Replaying the committed anchors against a build with only theSpring::landcall removed gave all SAME, so the divergence comes from the dive landing. The fixture was a historical key-onlyAppFrameV4recording (refactor(ui): complete owned presentation and replay inputs #1392), and the current recorder cannot emit that format. It was therefore re-recorded withtools/plxnative-rec rerecordas a currentAppFrameV5anchor (state_fp 13512213413816145485, 266 frames,anchor: truekept). This retires that fixture's V4 ledger.6-settings-familystays a V4 fixture that replays SAME. The pins (recorder.rs,test_harness.py,test_replay_fixtures.py) and the README census follow the change.make check-replayran three times, once at 960x540:SAME=6 REFUSED_EXPECTED=2 unexpected=0.Simulator pixel diff (before the merge). Cached against live, on the same binary: 1 to 5 pixels of 2,073,600 differ, each by 1 LSB. Main's shade inside the cached ground has not been pixel-diffed after the merge.
Review fixes (0695176).
bindleaves a spring at velocity 0 on a jump or when art arrives, and that would have cost one wasted fill. Two tests fail against the old gate.tex_ledger, program switches). The renderer mixes them in instead (gfx::region_ground_key, with its own test).make check(136 steps, all ok),check-nodef,check-replay(SAME=6 REFUSED_EXPECTED=2 unexpected=0) andmake ARM_PROFILE=release. Re-measured on the TV: grid-pong cached, GPU_ACTIVE p50 7.20M, 1 region fill in the run.Simulator pixel diff, after the merge (same binary,
--cw-art-fixturemock, hero pinned; the cached legs againstnopreviewcachelegs, with a free-running spinner at the top right masked):gradfalls from about 2.07M to under 45k px/s, andpanelfrom 4.9M to 2.8M px/s.Television
Measured 2026-11-16 on the dev set:
make ARM_PROFILE=release deployof the merged branch (verify-deploy: 47 files match),tests/run.py --fps --mock. Every pair is the SAME binary, and the control leg armsplxnative-nopreviewcache, which draws the backdrop live.grid-pong (the hero is parked and focus walks the first shelf; this is the case the cache targets). Pacing legs ran with no profiler, panel off, four interleaved pairs. The figure is missed refreshes per 60 cycles:
The cached leg wins every pair.
worst_msp50 is 19.5-20.0 ms cached against 23.5-24.3 ms live.Mali HWCNT,
frame.ui(--extra-trigger plxnative-hwcnt=frame.ui, panel on, one pair; the miss counts of these legs are not quotable):So p50 is 3.15M cycles lower, about 4.7 ms at 672 MHz, or -30 %. JS1_ACTIVE falls from 2.54M to 0.24M. L2 external write beats fall from 245k to 30k per frame. The worst cached frame, which includes the fills at each settle, is still below the worst live frame.
hero-pong (the hero flips every 600 ms, so a slide is always in motion and the cache is bypassed by design). Panel on, two pairs: cached 106 / 90, live 89 / 112. No change, as designed.
home-idle, cached: PASS, 59 loop/s, about 1 fps presented. It was not A/B'd, because the idle screen does not redraw the ground per frame.
Kernel scheduler trace (
tools/tv-sched-trace.sh --app, two 6 s windows per leg in a grid-pong run armed withframecb+framering=17,analyze-sched-trace.py --latch, panel on):With the cache, the trace windows hold no GPU-late frame. That includes the windows' share of the fills at each settle, so the fill frame did not show up as a spike. The trace covers 12 s of each 120 s run, whose bench misses were 35 cached and 63 live.
Not run: home-hero and home-cw-row-walk.
🤖 Generated with Claude Code