Skip to content

Item menu: the lifted card is the opener lift's alone, so a taken hold's spring is not page damage - #561

Merged
GLinnik21 merged 2 commits into
mainfrom
menu-open-capture
Oct 8, 2026
Merged

GLinnik21 merged 2 commits into
mainfrom
menu-open-capture

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

An item menu opened by a real hold animated at about 21 fps on the television for the whole ~350 ms open, on every card screen.

Cause

Since #484 a hold the app takes leaves the card on its release spring, and Press::tick reported every moving frame of that spring as page damage. Page damage under an open panel invalidates the frozen host snapshot, so the whole page was re-rendered into the snapshot 7-8 times in a row instead of once. Each capture costs about 1.7 refresh budgets of GPU (HWCNT: GPU_ACTIVE p50 19.3 M cycles in the open window against an 11.6 M budget) and arms the present fence, so frames came out about 47 ms apart. A menu opened by the dev trigger has no press, which is why the item-menu scene read 60.

Fix

  • The lifted opener card is left out of the frozen page pass: Dispatcher::lifted_opener() is the one decision (used by the page pass and by bridge::opener_lift), DrawFrame.lifted carries the element, and cards::Shelf / cards::Grid skip it in draw_card. The lift is the card's only copy, so Hold menu: the card springs back while the item menu opens instead of snapping #484's look (no doubled title) holds without re-capturing.
  • While a card section has left the card out, Press::tick reports no page damage for the spring and lands silently.
  • A change of the lifted element (mount, stand-down while closing, removal) clears the flag and re-takes the snapshot once.
  • Openers that are not card sections (Detail's episode strip and season tabs, hero buttons, Home's hero) keep the previous path unchanged, including its cost.

Measured on the television

Debug build, ARM_PROFILE=release, mock server, panel on. A = main with the hold scenes and the corrected bench metric from the companion PR; B = this change with the same.

scene A missed refreshes B missed refreshes
home-hold (30 holds) 525 81
collection-hold (30 holds) 498 41
home-tap (40 taps) 12 4

Menu-opening window (500-800 ms after OK-down), frame interval p50: 47.6 ms (Home) / 43.9 ms (Collection) before, 16.7 ms after; frames of 22 ms or more: 179 / 197 before, 36 / 34 after. Page captures per cycle: 9-11 before, 2 after (one at mount, one after Back). Captures on Home and Collection show the held card drawn once, above the dim. Controls unchanged: home-grid 60, collection-page 61, search-type 60, item-menu 60; hero-pong and grid-pong the same in A and B.

Left: one ~41 ms frame at mount and one after Back per cycle.

Tests

  • a_taken_holds_release_spring_raises_no_page_damage_under_the_open_menu (hostsim): 14 of 14 moving frames were page damage on main, 0 now.
  • the_lifted_card_is_left_out_of_the_page_pass_and_drawn_by_the_lift (Shelf and Grid).
  • the_lifted_element_reaches_the_page_pass_and_every_change_of_it_retakes_the_snapshot: fails if f.lifted = lifted or the flag-clear / invalidate on change is removed from the dispatcher.
  • a_cancelled_long_holds_spring_is_no_page_damage_once_the_lift_owns_the_card.

The app-level tests run only under --features hostsim.

Verification

  • make check: ==== check: 78 steps — all ok (111s wall, 253s cpu, 4 at once; ...) ====
  • cargo +nightly check --lib --no-default-features: finished clean
  • make check-replay: 3 fixtures, 6 replays, 0 failures

Not captured: Search, Library and Detail card openers (same code path as the two that were), and the lift drawn semi-transparent during a page fade.

🤖 Generated with Claude Code

Gleb Linnik and others added 2 commits October 8, 2026 20:10
…d's spring is not page damage

Since #484 a hold the app takes leaves the card on its release spring, and Press::tick
reported every visibly moving frame of it as PAGE damage. Under an open panel page
damage invalidates the frozen host snapshot (popover::host_refresh), so the whole page
was re-captured on every frame of the ~350 ms spring (7-8 captures instead of the one
designed), each arming the present fence with two skipped iterations: the open ran at
~21 fps on the set. Removing the report alone would keep the dipped card in the snapshot
under the growing lift (the doubled title #484 fixed).

The lifted element is now carried into the page pass (DrawFrame::lifted, from
Dispatcher::lifted_opener, which is the one decision opener_lift now delegates to; a
surface names its opener through Screen::opener) and cards::Shelf / Grid::draw_card leave
it out, so the lift is the only copy of that card, drawn live above the snapshot at the
press's own scale. A card section that skipped it says so (popover::set_lift_owns) and
Press::tick then reports no page damage for the spring, including the landing on rest.
The dispatcher re-takes the snapshot when the lifted element changes (mount, or the lift
standing down while the menu fades). Openers no card section draws (Detail's episode strip
and season tabs, hero) keep the per-frame re-take unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t flag in the app test, fix stale prose

The opener lift's dispatcher half (DrawFrame::lifted handed to the page pass, and the host
snapshot re-taken with the card-section flag cleared whenever the lifted element changes) had no
test: deleting either left every test green. A containers test now drives mount, Back, a focus
move off the opener while the menu fades (stand-down) and prune on the fixture rig, with a fixture
surface naming its opener and the fixture page recording what the page pass was handed; the
host-test snapshot stand-in counts its invalidations so "exactly once per change" is asserted.

The app-level spring test no longer leaves the flag set on its thread, the comments that still
described the page and the lift both drawing a lifted card are made true for card and non-card
openers, and the module doc says the hostsim tests are filtered out of `make test-crate C=app`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@GLinnik21
GLinnik21 merged commit ad36c56 into main Oct 8, 2026
18 checks passed
@GLinnik21
GLinnik21 deleted the menu-open-capture branch October 8, 2026 19:13
GLinnik21 pushed a commit that referenced this pull request Oct 8, 2026
…ction-hold, home/collection-tap)

Measured 2026-10-08, one run each, debug build with ARM_PROFILE=release, mock, panel on.
Hold scenes depend on the item-menu opener-lift fix (#561); the unfixed tree reads 525 / 498 / 12.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21 added a commit that referenced this pull request Oct 8, 2026
…d by the capture fence (#562)

The fps harness could not see a card's own click and long-press animation, and its bench scored a menu that opened at 21 fps as zero missed frames (the regression fixed in #561).

Scenes: a dev trigger plxnative-holdbench[=<n>[,<period_ms>[,tap]]] drives real presses through the remote's input path. A hold keeps OK down past the long-press threshold (press-in, hold fill, menu open) and dismisses the menu with Back; OK is never sent while a menu is up. A tap is cancelled by a direction key before the threshold. home-hold, collection-hold (30 holds), home-tap, collection-tap (40 taps), all under --fps --mock; a cycle that found no card or opened no menu fails the scene.

Bench: a loop iteration skipped only because the capture fence held the present (Frame::deferred) now keeps the present cadence (defer_present_phases), so the next presented frame's interval spans it and counts in missed and iv. Deferrals before a half's first presented frame are reported as defer_first and not graded. Idle skips behave as before. Scenes can set a bench_iv_max_ms ceiling. Only diagnostic bookkeeping changes; whether and when a frame is presented does not.

Every bench scene and the heartbeat's frame pacing now include fence holds they used to drop: hero-pong and grid-pong read 10-12 missed per 60 cycles under this metric (limits unchanged), so their earlier band is not comparable.

Limits measured on the television, 2026-10-08, one run each: home-hold 525 missed without #561 and 81 with it (limit 110, iv 55 ms); collection-hold 498 and 41 (60, 50 ms); home-tap 12 and 4 (8, 40 ms); collection-tap 3 with it (8, 40 ms). The tap scenes carry bench_drift_ms 4.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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