Skip to content

fps: real hold and tap scenes, and the bench counts a present deferred by the capture fence - #562

Merged
GLinnik21 merged 3 commits into
mainfrom
cards-press-scenes
Oct 8, 2026
Merged

GLinnik21 merged 3 commits into
mainfrom
cards-press-scenes

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

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. Companion to #561, which fixes the regression these scenes found.

New scenes

A dev trigger plxnative-holdbench[=<n>[,<period_ms>[,tap]]] drives real presses through the remote's input path:

  • hold: OK down, held past the long-press threshold so the press-in, the hold fill and the menu open all run; the menu is dismissed with Back. OK is never sent while a menu is up (bench::press_allowed, bench::press_close_key, pinned by tests).
  • tap: OK down, cancelled by a direction key before the threshold, so the press spring runs without activating anything.

Scenes, all --fps --mock: home-hold, collection-hold (30 holds), home-tap, collection-tap (40 taps). A cycle that found no card or opened no menu fails the scene.

Bench metric

missed uses the present-to-present interval, but any skipped loop iteration cleared the previous present stamp, so the bench fell back to work time. A present held back by the capture fence was indistinguishable from an idle skip. Now a skip caused only by the fence (Frame::deferred) keeps the 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 (latency) and not graded. Idle skips behave as before. Scenes can set a bench_iv_max_ms ceiling.

This only changes diagnostic bookkeeping: fr.present is computed before and never reads the new flag, and the fence, frame budget and framedump hooks are untouched.

Effect on existing numbers: every bench scene (push, modal, deep, hero-pong, grid-pong) and the heartbeat's frame pacing now include fence holds they used to drop. Under the new metric hero-pong and grid-pong read 10-12 missed per 60 cycles (iv max 37-47 ms), the same with and without #561; their limits are unchanged, so the earlier 7-18 band is not comparable.

Limits, measured on the television (2026-10-08, one run each, debug build with ARM_PROFILE=release, mock, panel on)

scene without #561 with #561 limit (missed / iv ms)
home-hold 525 missed, iv 53.4 81, iv 46.7 110 / 55
collection-hold 498, iv 48.2 41, iv 42.6 60 / 50
home-tap 12, iv 34.2 4, iv 31.2 8 / 40
collection-tap not run 3, iv 33.2 8 / 40

The hold scenes fail on a tree without #561. The tap scenes carry bench_drift_ms 4.0 (one run tripped the 2.0 default at +2.87 ms). defer_first read 0 in every run, so that field is exercised by unit tests only.

Tests

  • bench: a deferral after the first present is missed refreshes; one before it is latency; an idle skip still resets the interval. heartbeat: a deferred present keeps the cadence and an idle skip breaks it.
  • hostsim: the hold bench opens the item menu from a real hold and dismisses it with Back only (0 OK edges while a menu is up); the tap bench cancels without activating.
  • harness: parsing of old and new bench lines, bench_iv_max_ms, a ceiling that fails the 21 fps open, the scenes' mock blocks and limits.

Not host-tested: a hold on a Collection page card (covered by the television run).

Verification

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

🤖 Generated with Claude Code

Gleb Linnik and others added 3 commits October 8, 2026 22:14
…tion (holdbench, home/collection-hold and -tap scenes)

The item-menu scene opens the menu directly and grades the settled panel after a warmup, and
plxnative-press taps a card and navigates away, so nothing measured the dip, the hold capsule's fill,
the menu opening out of the hold, or its dismissal. plxnative-holdbench[=n[,period[,tap]]] runs
counted cycles through the remote's own key path on a Home, Library or Collection card: OK-down and
nothing else for a hold (never a key-up, never an OK while a menu is up), Back only while the item
menu is up; the tap variant sends a direction key before press::LONG_MS, the app's real cancel path.
Each cycle logs a bench: kind=hold line, and grade_bench fails a cycle that pressed nothing or opened
no menu. Scenes home-hold, collection-hold, home-tap and collection-tap run under --fps --mock; their
limits are the frame budget and are not yet measured on the television.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ps menu open grades as missed refreshes

The bench's missed count uses the present-to-present interval, but any skipped loop iteration cleared it, so a deliberate fence deferral looked like an idle skip and a 47 ms open (14 ms of work) read as 0 missed. The loop now tells a deferral (fence held, window active) from an idle skip and only seeds the stamps for the former. Deferrals before a half's first present are reported as defer_first, later ones count in missed; scenes may cap the worst interval with bench_iv_max_ms. The press scenes get provisional target limits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…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
GLinnik21 merged commit 3c59432 into main Oct 8, 2026
18 checks passed
@GLinnik21
GLinnik21 deleted the cards-press-scenes branch October 8, 2026 19:27
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