Repository navigation
Glass menus are frosted, and their open and close fit the frame budget - #1459
Merged
Merged
Conversation
… a thin .36/.44 face The menu body was the underlay field (a colour wash with no shapes), which no face alpha can make read as frost. The host now owns a retained blur of its page snapshot (FrameCache's frost slot: 1/4, 1/8, then Kawase taps at 1.5 and 2.5 texels, sigma ~24 px at 1080p), built once per snapshot at the head of a frame after the capture and freed with the host. fs_glass.frag caps the frosted body's brightest channel under a hard ceiling derived from the ink floors at the face's thinnest alpha. With no frost the field ground and the .78/.86 face stay exactly as they were. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The knee began at 0.6 x FROST_BODY_CEILING (0.2), so nearly every poster pixel was squashed (a 0.43 body came out ~0.28) and the frost read as a flat dark panel. A body at or below 0.9 of the ceiling is now untouched; above it knee + headroom * o / (o + headroom) leaves the knee at slope 1 (the old `scale` that made white land ON the ceiling put a kink there) and never reaches the ceiling, which is derived from the ink floors and did not move. u_frost_cap is a vec2 (knee, headroom) now. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…n every glass
The frost cap sat in fs_glass.frag unconditionally and GPROG is linked with no fallback, so a
Mali GLES2 compiler that rejected it would have taken every glass surface (chrome bands, chips,
menus) with it. The cap is now `#ifdef PLX_FROST`: the plain glass program preprocesses to
exactly what it was before the frost, and the frost variant (FS_GLASS_FROST, the same source
behind the define) is linked with link_optional_program. Only a frozen glass that has a
GlassFrost draws with it. If it does not link, one line is logged ("glass frost prog
unavailable"), no frost is built (FrameCache::frost_possible and frost_build_owed say so) and
menus keep the field ground under the .78/.86 face.
The glass program's ~45 uniform locations were `static mut GL_*`; they are one GlassUniforms
struct now (the RectUniforms pattern), looked up per program, so the variant has its own.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The ceiling test graded the cap alone. The shader dims the body, caps it, then lays the .36/.44 face over it, so the new test runs a white and a black page through that whole chain for every dim role and an appear spring's alpha in between, with the darkest and the brightest dim ink, and holds the primary, secondary and tertiary inks to their floors (4.5, 4.5, 3.0) at both face stops. It also pins the order: capped before the dim, a bright dim ink lifts the white page back over the ceiling and costs the tertiary ink its floor. The two tests share contrast/inks_hold helpers. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…e once, not per pixel per frame On the television the frost composite cost 5.58M GPU cycles at the settled open against 4.62M for the field body it replaced. The cap was 0.69M of it (0.38M executing and 0.31M paid even when its uniform switched it off), the body's dim fetch 0.27M; a composite with neither measured 4.23M. The retained frost gets a body: one 1/8-resolution pass (`fs_frost_bake.frag`, the profiler phase `glass.bake`) that reads the frost and the latched dim field through the mapping the glass's own sharp dim uses, dims, THEN caps (the pinned order), and stores the result in a texture the glass draws. `fs_glass.frag` under PLX_FROST now returns the baked texel with no `dimRGB` and no cap code or uniform; `dimRGB` stays for the sharp source. The bake runs from `popover::host::begin_frame` beside the frost build, whenever the frost's snapshot, the frame's dim or the ceiling changes (every frame of the dim's ramp, never at rest), before any framebuffer-0 draw, and also for a stale frost served to a closing menu. The lowest dim reaches `begin_frame` as a pure value on `ModalPresentation` (`ModalStack::first_dim`, resolved through `UnderlayField::dim_of`, the one function the paint's own note also reads). It is a prediction: a field that latches after the head of the frame is drawn for one frame with the previous body, the ground stage waits like it does for an owed frost, and the next head corrects it. The bake is part of the frost variant's optional link: a driver that refuses either leaves the menus the field ground. Tests: the frost composite has no cap and no body dim and the bake has both in the pinned order; a CPU model of the baked body magnified as the composite samples it against today's per-pixel body, bounded by storage rounding, the field's kink and the cap's concavity; the dim value the bake is fed equals the one the scrim paint notes. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A modal's dismissal re-enters the covered page: the dispatcher re-arms Home's saved-place jump (RestoreMemory) and FocusEngine::enter announces the key it already holds as FocusMoved from==to by Restore. Home damaged the page for it unconditionally, and typed page damage is what retakes a frozen host's snapshot on the close's first frame (the account menu's BACK, chip focused). Home now damages only when focus really moved or the saved-place jump moved the page. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
RestoreMemory reaches the host page of every modal dismissal. A covered page comes back to the place and projection it was frozen at, so it repaints nothing; a body minted again lands at the remembered place and does. The damage moves from FocusMoved's saved-place jump to the event that actually changes the page. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ne frame that corrects it The body is baked at the head of a frame from a prediction of the lowest dim, and the page read a settled menu waits on lands inside draw_scrims_on's sync, after it. The glass then draws the old body for that frame and holds the ground, and the head that bakes the right one only comes if a frame is presented: nothing guaranteed one (the appear spring has rested, the keepalive is 2 s). DimSink::dim_settled hands the sink the dim the field now gives, and GlDims wakes the loop once when a frost body stands for another (popover::host::frost_body_stale). The next head bakes the right body, so the loop rests again. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… pinned through the production sink The player and preview frames never run begin_frame, so a frost left standing there would have read stale against the flat dim of a player panel on every frame. dim_settled is now reported only for UnderlaySource::Page on a frame that is not the video plane. The mock FrameCache can stand a frost with a settable body dim, so GlDims::dim_settled's wake is graded through popover::host::frost_body_stale instead of the fake sink's own comparison. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A page that returns from under a cover raises no damage of its own, and Settings changes the Under posters policy (and Library's sort value line, and the Continue Watching press the deck promises) while it covers one. Those pages read the setting silently, so nothing repainted them once the page-retake safety net at a modal's close goes: Library, Recommended, the collection page, the person page, Search and Detail compare the setting at the head of step, as Home does, and answer a move with page damage. The shared compare is registry::moved. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…nder a cover Uncover, Enter(Restored) and a FocusMoved onto the key the page already holds each raised page damage unconditionally, which retakes a frozen host's snapshot on the close's first frame (the account menu's BACK: three damages on the route rig). The page now compares what a cover can have hidden at the head of step: its tile and option revision, and the Under posters policy it reads at draw. Arrival (Enter(Fresh)) and a focus that really moves still paint. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…t one bind_owner retook the page unconditionally at the flip where a Sheet, an Alert or an Opaque snapshot surface starts closing: the safety net for pages that change under a cover without saying so. Pages now report their own changes (Library, Recommended, the collection and person pages, Search, Detail, Watchlist and Home compare the settings they draw at the head of step), and the host retakes through typed page damage as on any frame. The flip drops only a ground-stage snapshot, for every style, and ModalPresentation's live-host bookkeeping goes with the rule. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…d and not drawn DimSink gains folded() and dim_folded(): the first dim is skipped only when the host says it folded it and the field has a texture to fold (a flat dim, a second dim and an unfolded host keep today's draw). The production sink still answers false and draws, so nothing changes yet. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…olded in FrameCache::draw_folded draws the snapshot through one dithered program (mix of the page and the dim's field ink; alpha a + h.a(1-a), the two blends' own) as the frost unit's fourth, optional member of GLASS_FROST. It declines everything it cannot fold to the plain quad. vs_img.vert gains PLX_FOLD_UV for the field's top-down UV as a bare varying. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…r a cover Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ync is provably a no-op page_pass draws the held page through FrameCache::draw_folded on the visible walk, for a field dim, a settled page latch (ModalPresentation::fold, FoldGate::sync_is_noop at the held page's own epoch), no fade and no video plane; the dim pass then declares that dim through Painter::dim_folded and does not draw it. The fact is cleared at the head of every frame (host::clear_dims, begin_frame). Dispatcher::page_owned is the one definition bridge::page_owned now reads. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…retakes a frozen host Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ozen-host close keeps the page snapshot Co-Authored-By: Claude Opus 5.5 <[email protected]>
…test's leftover server cannot reach them A #[should_panic] test never reaches its closing reset_servers_for_test(), and the hubs-dump discovery test registers one server and panics by design. Only World::build_shelves reset on entry; the scripted and Watchlist constructors did not, so a world built after that test inherited its server. Under default parallelism the test took the serial lock in the gap between two of a_resting_heading_is_always_clear_of_the_chrome's six worlds, and the next one drew Home with a heading missing (found by pairing the failing test with each of the other 85 home_ tests: only that pair failed, 5 of 5, and it passes with --test-threads=1). World::lock now resets the registry and the collections probe for every constructor, and a test leaks a server the way the panic does and asserts the next world starts empty (it failed before the change). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… dim pass TV run 6 measured the dim fold (the lowest modal dim drawn inside the held-page blit, fs_dim_fold.frag) on against forced off on the same session: it costs 0.31M GPU cycles per dim-visible Library menu frame and 0.41M per account-menu frame (Library open steady A1 9.36 / B 9.05 / A2 9.34, drift 0.02), instead of saving the separate dim pass. Reverts b6ffcdd, 04e08d2, c7c803f, 3816605 and 6a60ae1. The frost bake and its dim plumbing (ModalStack::first_dim, UnderlayField::dim_of, ModalPresentation.dim, Dispatcher::modal_presentation_at, DimSink::dim_settled) stay, as do the frozen-host close and the page self-damage that merge ad49973 added. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The menu's frost build was timed as "glass.frost", the name glassload.rs and gpu_timer.rs already use for a different thing (a full-resolution frost quad into framebuffer 0), so one trigger value selected two unrelated measurements. The build is now "glass.frost_build" (call site and PHASES); glassload's stays as it was. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…back A frosted menu's body is the host's frost (one blur of the frozen page per snapshot, the frame's lowest modal dim and the body ceiling baked in) under FROST_FACE; the composite dims only the rim's sharp source. The latched field under FACE is the fallback a glass wears when it has no frost, and a stacked menu draws no glass at all. Rewrites the prose that still said the body was the field, the dim was applied to both pictures, the composite capped the body (u_frost_cap moved into the bake), a host retake rebuilt nothing, and that only a Compact layer starting to close keeps the page snapshot. The screens guide now says Collection and Person still damage on every Uncover/Enter. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…e frame Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… profile chip no longer sits lighter for ~300 ms and then snaps darker Cause: a morph menu's close is over when its droplet has drained into the opener (Morph::closed: no glass, no dim, the opener whole), about 14 frames after BACK, but the container retired the surface only when its own appear spring came to rest (a Sheet ~31 frames, a Compact menu at CLOSING_GONE). The morph does not ride that spring, so for the ~17 frames between, the surface drew nothing while the opener lift still owned the chip and painted it on the stack's latched field (frozen glass, a lighter body than the tab strip's live glass); the "snap darker" was the lift letting go and the chrome pass drawing the chip live. Owner film: chip patch grey 86 for frames 186-203, 77 from 204. Fix, in the shared mechanism for every glass opener: Screen::handed_back (default false), answered by Popover::handed_back (not open, and its morph closed) from the account menu, the Library menu and the Watchlist menu; Surface::faded also reads it, so ModalStack::prune retires the surface on that frame and the lift and the chrome pass change hands once, on the frame nothing else of the menu draws. Sim film of the same scene after: patch 77 from the first frame after the close. Test: a_morph_menus_surface_and_lift_end_on_the_frame_its_droplet_is_gone, Sheet and Compact; red before (droplet gone at frame 15 after BACK with the surface still standing), green after. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ift's alone Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…alpha; a morph carries a join only Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…lass frame 2 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… as the bar draws it the_morph_begins_and_ends_on_the_chip_as_the_bar_draws_it asserted closed_out > 0: that a closing menu still stood on closed frames (no glass drawn, the frame the chip's rect with a circle's corner) after its droplet was handed back. Those frames were the ~17 lingering ones the previous commit removed (the surface now retires on Screen::handed_back, so the closed frame the hand-back lands on is the frame the surface leaves on), so the assertion encoded the bug, not the intent. The test keeps its open leg (the opener is the chip as the bar draws it on every frame, the open begins on a closed frame that is the chip's rect with a circle's corner) and now opens the menu by keys so the chip is the lifted opener, then reads the close's end on both sides of the hand-back: - no frame stands closed (closed_out == 0), the surface is never standing with its popover handed back, and it leaves about 15 frames after BACK (< 24; the Sheet's spring would be ~31); - on the last frame glass is drawn, the opener's re-formed blob is whole on the chip's rect as the bar draws it (centred, bottom edge on the chip's, tint 1), the slab a sliver on its centre, the face back, the lift still owning it; - from the first frame without the surface there is no lift, and the bar draws the chip where it did before the menu opened. Red with Surface::faded's handed_back clause removed (the surface stands with its droplet handed back); green with it. Two comments in the file that described the lingering closed frames are corrected. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…e way and its rows show earlier Co-Authored-By: Claude Opus 5.5 <[email protected]>
A morphing menu lets go of the host on the frame its droplet is handed back (Screen::handed_back, Surface::faded), any other menu when its fade drops below CLOSING_GONE. The morph's glass is never clear: K_OUT carries the close's rows leaving and the glass keeps its frost to the hand-back, the rows first show at lens scale ~0.2 on the third glass frame (0.65 at 67 ms), and a morphing menu sets only the join (clarity 1 is the profile chip's lift on the host snapshot). 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.
Summary
The glass menus (Library and Watchlist Sort & Filter, the +N list, and the profile menu) are now frosted glass rather than a grey field: the frozen page behind the panel is blurred once, under a thin face of rgb(58,58,64) at .36 over rgb(40,40,46) at .44 (the owner's pick from the mock). The pass that follows makes the frost and the menus' existing close costs fit the TV's frame budget together.
The frost (
gfx::FrameCache, profiler phaseglass.frost_build;glass.froststays the name of the experimental full-resolution frost quad inglassload.rs):FROST_MARGIN, aligned to 8) is reduced 1/4 → 1/8 and blurred with two Kawase passes (d = 1.5, 2.5; σ ≈ 24 px). The panel composites that texture; nothing is blurred per frame.FROST_BODY_CEILING= 0.333, derived rather than tuned: the tertiary ink reaches 3:1 at a body of 0.3372, minus 1/255. A soft knee from 0.9 of the ceiling (y = knee + d·o/(o+d)) keeps a bright page from reading flat; at 0.6 the frost was visibly darker than the mock.#define PLX_FROST,FS_GLASS_FROST) linked withlink_optional_program. If it fails to link, the log saysglass frost prog unavailableand the menus keep the field face (MENU_GLASS_FIELD_TOP/BOT, .78/.86). The plain glass program is unchanged. The ~45static mut GL_*uniform locations became a by-valueGlassUniforms.The body bake (
FrameCache::frost_bake_owed,fs_frost_bake.frag, phaseglass.bake): the modal dim and the ceiling are applied once into a 1/8-resolution texture, keyed by the frost epoch, the region, the dim (field texture,tex_ledger::revision, tint) and the cap, instead of per pixel on every frame. The dim reaches the bake asModalPresentation.dim(ModalStack::first_dim→UnderlayField::dim_of,Dispatcher::modal_presentation_at). A page-sourced dim that latches after the head's bake wakes exactly one corrective frame (DimSink::dim_settled→popover::host::frost_body_stale).The account menu's close no longer re-takes the page
The account menu is a Sheet, which freezes its host while open, so
bind_ownerre-took the page on the close's first frame (14.9M GPU cycles, 133% of a refresh). Now a layer that has only started closing drops the ground stage and keeps the page snapshot for every presentation style (ModalCacheKey::began_closingreturns whether it did;kept_host_liveandlive_hostsare gone).That is safe only if a page that changes under a cover says so. Pages now report a setting that moved under a cover at the head of
step, through one shared helper (registry::moved(&mut held, now)plusfx.invalidate(Provenance::Nav)): Home, Library (includingsort_value), Recommended (deck_press), Collection, Person, Search, Detail and Watchlist (caption policy andrev). Home damages onFocusMovedonly when the focus or theplace()fingerprint moved, and onRestoreMemoryonly whenprojected_generationorplace()changed.The morph is frosted the whole way, and its rows show earlier
The owner's direction from an iOS 26 recording: the droplet never reads as clear glass.
Frame::clear,clear_atandFROST_FROM/FROST_TOare gone; the morph hands the glass only its join (clarity 0). From the first glass frame through the close's hand-back the body is the frost underFROST_FACE; a frame where the frost is not built yet wears the latched field under the heavier face, never the sharp page.draw_shadowedasks for the frost before the field check, so the build lands at the head of the open's second frame (O2) and stands when the glass first draws; nothing is added to O1. The rows fade in fromROWS_FROM_AT0.05 (was 0.55; opaque at 0.8, was 0.96), first visible on the third glass frame (~33 ms) at a lens scale of ~0.2, andcontent_alphais capped atground_alpha. The close's row timing is unchanged.The opener is handed back the frame the droplet is gone
After the profile menu closed, the "Demo" chip sat lighter for ~300 ms and then snapped darker (the owner's TV clip). The droplet's close ends ~14 frames after Back, but the surface (and with it the opener's lift, which paints the chip over the lighter latched field) was retired only when the Sheet container's spring rested, ~17 frames later.
Surface::fadednow also retires a closing surface onScreen::handed_back, for every style. In a sim film of the same scene the chip patch read 86 for frames 186-203 and 77 after; with the fix it reads 77 from the first hand-back frame. Regression tests:a_morph_menus_surface_and_lift_end_on_the_frame_its_droplet_is_gone(fails without the fix) and the rewrittenaccount_menu_route_tests::the_morph_begins_and_ends_on_the_chip_as_the_bar_draws_it(asserts the surface leaves at the hand-back and the bar then draws the chip at its resting rect; red without the fix).Tried and reverted: folding the dim into the page
The dim was folded into the held-page blit (
fs_dim_fold.frag) to drop its separate full-screen pass. On the TV (same session, A-B-A, 11 cycles each) it COST GPU time on every dim-visible frame: Library open steady 9.36 / 9.34M with it and 9.05M without (+0.31M), account 7.60 / 7.60M against 7.19M (+0.41M), with 0.02M drift between the two fold-on runs. Thescrimsphase read 0 with the fold, but the folded draw landed in no phase, so only the frame total showed the cost. It is reverted in this branch.Measured on the TV
All builds
ARM_PROFILE=release, debug flavour, mock accounts only (the synthetic PMS checked before any key; the account menu signs in through the loopback plex.tv stand-in). GPU_ACTIVE from Mali HWCNT, median per frame role over 11 cycles; the budget is 11.2M per 60 Hz refresh.glass.frost, renamedglass.frost_buildafterwards) and the panel composite (glass.frozen) costs less than the base glass's (run 5: 4.19M against 4.63M).glass frost prog unavailable,link FAILEDorshader compile FAILEDline in any log.Not fixed here
glass.bakerecords at 2.0M during the dim ramp; not attributed.cards/grid.rs:355andshelf.rs:337/359,library/status.rs:53, theothers_uppath (no Uncover), and the container chrome (not audited).Tests and gates
After the revert and the merge of main (a0a9a4b):
make test-crate C=plx_ui: 1761 passed / 0 failed.make test-crate C=plx_gfx: 280 passed / 0 failed (14 ignored).make test-crate C=app T=route_tests: 122 passed / 0 failed.make test-crate C=plx_screens: segfaults onactual_visible_player_paint_reports_typed_watch_without_mutating_it, which draws through real GL without a context (as on main since refactor(ui): enforce owned runtime and presentation events #1420). Run alone, it crashes the same way. With that one test skipped: 2249 passed / 0 failed.make check-nodef,ci/check-deps.sh,ci/test_ui_boundaries.py(33 OK) andci/check-module-layers.pypass.make(tvdev) linkspkg/plxnative.At the head (554058a):
make test-crate C=plx_ui1763 passed / 0 failed;make test-crate C=app T=route_tests122 passed / 0 failed;make test-crate C=plx_gfx280 / 0 (at the tint lane's head, 15468ee);make check-nodefandci/check-deps.shpass; the ARMmake ARM_PROFILE=releaselinkspkg/plxnative(at fef2164; only comments changed since).make checkand the hostsim suites are left to CI.New tests also cover: no open or close frame of the morph draws a clear body (open, close, either interrupting the other, with and without an opener fill, the fallback); the glass asking for its frost before its field latches; the rows first showing on glass frame 2.
doc-claim-auditoron the morph and hand-back changes: 6 findings, fixed in 554058a.New tests cover:
doc-claim-auditor: 10 findings, all fixed in this branch.pr-reviewer: one round on a0a9a4b (one MINOR, the frost rebuild on a close, above); one on fef2164 (one MAJOR: this description was stale; fixed here).fw-compat-reviewerwas not needed: there are no FFI, linkage ordynlib!changes, and the shader changes are GLSL ES 1.00 runtime sources.No build files changed, so there is no build-bench table.
🤖 Generated with Claude Code