Repository navigation
gfx: Home's ground under the shelves is one flat colour, drawn as a clear - #1017
Merged
Merged
Conversation
Home's ambient wash (UltraBlur corner colours as a page-wide bilinear gradient, plus the atmospheric ramp of scrim ink, ±1-LSB dithered) was one full-screen shader pass on every frame. Wherever the ground has no photograph (Home's shelves and grid once the hero is culled, Detail while its still has no texture) it is now ONE flat colour drawn as a glClear of the rect's pixel box: no fragment is shaded. Where the ground has art nothing changes. ui: AmbientWash::draw_ground with no art takes the ramp and hands Painter::ambient four equal corners of AmbientWash::flat_ground, the mean of the wash's four drawn corners with the ramp folded in at its mean alpha over 64 rows (the mix vs_ambient.vert does per vertex), snapped to exact 8-bit codes. gfx: draw_ambient_impl turns four equal corners with no ink into clear_flat_ground. The decisions are pure and tested: flat_clear (equal corners and no ink -> the corners times dim snapped to codes, so a clear never depends on GL_DITHER) and ground_clear (open area, scissored box, or nothing; a letterboxed surface and a render-target override are never cleared bare). The clear colour the context holds is recorded and put back, so every glClearColor now goes through the pub set_clear_color, including the app's player-route clear (its extern is gone); a source-scan test fails on any other call in gfx.rs. Measured on the dev television (Mali-T820) with the approved scratch of this look: Home's grid scene 9.8M -> 7.94M GPU cycles/frame (-1.86M). The PR re-measures this implementation. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…earlier Home frame stay layered The previous commit flattened every `draw_ground` call with no art. That also fired where the look was never approved and made the ground jump between gradient and one colour in a single frame: Home during every hero SLIDE, while art is HELD and while the hero's texture is still PENDING, and Detail before its still loads and once it scrolls away. ui: `AmbientWash::draw_ground` with no art is origin/main's layered picture again, byte for byte. The flat path is its own method, `AmbientWash::draw_flat_ground`, with the same contract (true = the ramp was taken). Home calls it only once the hero is culled (`sp >= HERO_ART_CULL`), the frame from which no art is drawn at all; every other Home frame and all of Detail draw exactly as on main. The ramp sample count is `RAMP_SAMPLES` (it is a sample count, not a list cap, so `ci/check-list-caps.py` passes). gfx: a flat ground clears unscissored only when the viewport is the whole drawable (`surface::viewport_fills_drawable`: origin 0,0 AND the drawable's size). An origin of zero alone proves nothing, because `surface::recompute` floors a centred letterbox: a 1-px remainder leaves vx == 0 with a column outside the viewport. Otherwise the clear is scissored to the viewport box. Prose the flat ground made false is corrected (the dither claims in gfx, dither.glsl, idle.rs, run.rs, widgets.rs, Detail's `ground` doc), and the tests pin the split: `draw_ground` with no art is the layered picture, `draw_flat_ground` takes the ramp, and Home goes flat only at `sp >= HERO_ART_CULL`. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…cs the flat clear made false Part 1. AmbientWash::draw_flat_ground folded Home's atmospheric ramp into the flat colour, but that path never runs on a real frame: Home's hero_a is (1 - sp/0.55).clamp(0, 1), which is 0 for every sp >= HERO_ART_CULL, so the ramp is None whenever the flat ground is drawn. The fold (RAMP_SAMPLES, the mean-alpha mix, the bool return) is removed: draw_flat_ground(p, r) draws the wash's mean on exact codes and nothing else, and Home's culled branch is `draw_flat_ground; false`, leaving the layered ramp path the only ramp drawer. Pixel-identical on every real frame. The tests that reached the fold only by forcing hero_a = 1.0 at the cull go with it. Home's flat-vs-layered test now reads the wash's corners through a new draw_census::capture_grounds (the ramp rects can no longer tell the two apart) and takes hero_a from HomeScreen::env; home_has_no_ramp_at_the_cull pins the premise (hero_a == 0 at the cull). Part 2. Prose the flat clear made false: PageGround::CARD_W (Home's culled grid is drawn at the mean of those corners), Detail's PageGround "dithers unconditionally", the overdraw ledger's "exactly" (draw_ambient books a flat ground's clear as an Ambient quad; HWCNT is unaffected), the ~2M-fragment cost claims for a wash on the clear colour (a clear at rest, shaded only while the corners settle), and surface.rs's "nothing else knows the drawable size". Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Oct 24, 2026
Brings in the Browse B-A section-hubs job and the other changes main gained since fba7a81 (#1017, #1021, #950). Five files conflicted and every one keeps both sides: the Direct arm of StoreJob::admission() lists BrowseHubs, MetaSeason and MetaEpisodes; the runner and the Held docs name both the Browse and the Metadata kinds; bridge.rs's late-job messages name every drain of both stores; docs/sans-io.md numbers Metadata as the tenth store; PINNED_LEDGER_TOTALS is the real sum of the # count: headers (the textual merge produced a wrong-looking pair). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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 and why
Home's ambient wash is the UltraBlur corner colours as a page-wide bilinear gradient, plus the atmospheric ramp of scrim ink, dithered by ±1 LSB. It was one full-screen shaded pass on every frame. On the shelves and grid, once the hero is culled (
env.sp >= HERO_ART_CULL), no photograph is drawn, and the ground is now ONE flat colour drawn as aglClearof the rect's pixel box, so no fragment is shaded. This is a look change, approved by the owner on 2026-10-24 after a side-by-side simulator walk of the demo library ("Hardly can tell apart").AmbientWash::draw_flat_groundhandsPainter::ambientfour equal corners ofAmbientWash::flat_ground, the mean of the wash's four drawn corners (the exact mean of its bilinear gradient), snapped to exact 8-bit codes. It draws no atmospheric ramp. Home has none by then: the hero has faded out bysp = 0.55, sorampisNoneat the cull, and a test pins that premise (home_has_no_ramp_at_the_cull).draw_ambient_implturns any ambient with four equal corners and no ink intoclear_flat_ground. The decisions are pure and tested:flat_clear: corners times dim, snapped to codes, so a clear never depends onGL_DITHER.ground_clear: the open area, a scissored box, or nothing. The whole drawable is cleared unscissored only when the viewport fills it exactly (plx_base::surface::viewport_fills_drawable). A letterboxed surface and a render-target override are always scissored.glClearColortherefore goes throughpub fn set_clear_color, including the app's player-route clear, whose extern is gone. A source-scan test fails on any other call in gfx.rs.Scope: the culled hero only
An earlier cut of this branch flattened
draw_groundwhenever it had no art that frame. On Home that also covers every hero-change slide, held art and a texture still pending; on Detail it covers the frames before the still loads and after it scrolls away. None of those frames were in the approved walk, which pinned the hero, and each would jump the page between gradient and flat in one frame. Sodraw_groundis origin/main's code again, byte for byte. Only Home calls the flat method, and only when the hero is culled, the same frame the approved build switched on. Detail is unchanged.Look evidence (macOS simulator, demo library,
tools/site_video.py render, 1380 frames)The walk: hero, then down to Continue Watching and along it, then Movies, TV and Blender shelves.
Local tests
make test-crate C=plx_gfx:test result: ok. 172 passed; 0 failed; 0 ignored; 0 measured; 0 filtered outmake test-crate C=plx_ui:test result: ok. 1389 passed; 0 failed; 0 ignored; 0 measured; 0 filtered outmake test-crate C=plx_screens:test result: ok. 1706 passed; 0 failed; 0 ignored; 0 measured; 0 filtered outmake test-crate C=plx_base:test result: ok. 225 passed; 0 failed; 0 ignored; 0 measured; 0 filtered outmake check-nodef: exit 0.python3 ci/check-list-caps.pyandpython3 ci/check-module-layers.py: exit 0.draw_groundwith no art still records the layered picture;sp >= HERO_ART_CULL(read throughdraw_census::capture_grounds, a new census of the corners eachPainter::ambientis handed), and a slide before the cull stays layered;hero_ais 0 at the cull, so no ramp exists there.the_ground_goes_flat_only_once_the_hero_is_culled.make checkwas not run locally; CI gates it.Known and left: the overdraw ledger's
gate(Class::Ambient, …)still books the rect's fragments for a clear. Overdraw and profile-graphics attribution therefore over-report Ambient on these frames; HWCNT is unaffected.overdraw.rsanddocs/backdrop-blur-profiling.mdnow say so.Device measurement (webOS 4.5 set, Mali-T820)
main fba7a81 vs this branch eae7f89, both
ARM_PROFILE=release. Each binary was copied into the debug install and md5-checked, then the builds were alternated. Panel off, sound muted, Guest on the mock demo catalog. The last commit (no ramp fold, docs) is pixel-identical on every real frame, because the ramp isNonewherever the flat path runs.GPU load (HWCNT
GPU_ACTIVEcycles a frame, p50; legs main, branch, branch, main):On grid, the share of frames above 8M cycles falls from 99.3% to 12%. The approved scratch build measured the same 7.94M.
Missed refreshes with counters on (the counters add GPU load, so this is a GPU-bound condition, not the production rate): grid 584, 571 → 179, 174; hero 197, 191 → 202, 197.
Missed refreshes without counters (grid-pong, 60 cycles each, two counterbalanced blocks: main, branch, branch, main, then branch, main, main, branch):
No change in the production miss count; the branch's lead in block 1 reversed in block 2. Every slow frame in all eight runs is a back-buffer wait; none is a CPU phase.
So the GPU-late slips shrink, but the full-refresh class sets the count and is not GPU-bound. This change buys GPU headroom; it does not by itself remove grid-pong's dropped frames.
Look (GRAPHIC-plane capture; the TV's own overlays masked; the two captures of each scene are identical):
No linked issue.
🤖 Generated with Claude Code