Skip to content

test(interaction-harness): the frozen arm shows only pre-block steps - #10189

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:test/harness-frozen-arm-steps
Nov 6, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:test/harness-frozen-arm-steps

Conversation

@vjeux

@vjeux vjeux commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Maintainer impact

The harness self-test "against a compositor-only control in the same window" fails on loaded WebKit runners. Its frozen arm "moved on 2 of the 49 frames the control moved", where the check allowed 0 or 1.

Intended invariant

The harness's busy-window verdict fails a main-thread animation through a block: it shows no motion from inside the block, and its stall outlasts the control's.

Change

The check allowed one move: a frame presented as the block starts can still show the last step. Traced on starved runners, on the control's clock, the compositor presented steps from before the block well inside it: up to three, as late as 230 ms in. The verdict counts each as a move.

The arm now logs each step with its time on the page clock. Each new position shown in the judged part must be a step set in the 800 ms before the block, within one cast step. A step from inside the block fails it. The verdict still fails the arm, with its stall longer than the control's; the moved count is no longer pinned.

Evidence

WebKit in the CI container image, Chromium on a 2-core pin, the arms interleaved on one machine:

  • Failure before the change: re-judged by the harness from 56 recorded runs, main's check fails 5, each where two late steps showed. Under live load, it failed the count check in 2 of 48 WebKit runs on a 2-core pin and 1 of 16 Chromium runs.
  • Success after the change: the same 56 runs pass. Live, 0 of 48 and 0 of 16 failed the new check.
  • A step from inside the block is caught: injected every 20 ms of each run's judged part, 1902 of 1902 are flagged. Keeping every step since the arm started instead, up to 59% escape once the loop wraps.
  • The steps a late frame showed were at most 261 ms old. The 800 ms window stays clear of a wrap, and each position matches within the cast's 2 px step (largest read error 1.35 px).
  • A separate known failure mode, tracked separately: on a 2-core runner, the slow-cast compositor arm can see too few control frames to judge. This change leaves it as it is.
  • Product/runtime behavior verified unchanged: the diff is one test file.
  • CI impact: none; no workflow or CI script changes.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

node internal/interaction-harness/scripts/webkit-container.mjs --workers=2 \
  --repeat-each=12 -g "against a compositor-only control in the same window" \
  internal/interaction-harness/src/harness.interaction.browser.spec.ts

Run with the container on two cores. As commits not for landing:

  • a frame dump on main: 8205ae7;
  • the recorded runs and both replays, with a README: d16b574.

Prettier, ESLint, pnpm lint, the harness's type check and review:pre are clean.

The self-test's main-thread arm failed on a loaded WebKit runner:
moved on 2 of the control's frames, where its check allowed 0 or 1.
That bound assumed one frame at the block's start could still show
the last step. Traced on a starved runner, the compositor presented
the page's last steps from before the block well inside it: up to
three of them, as late as 230 ms in.

The arm now logs each step with its time. The check traces every new
position shown in the judged part to a step the page set in the
800 ms before the block, within one cast step. A step from inside
the block fails it. The verdict still fails the arm, with its stall
longer than the control's. How many frames it counts as moved is no
longer pinned: that depends on how many late steps a runner shows.
@vercel

vercel Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 6, 2026 12:32am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 6, 2026
@astracat-bot

astracat-bot Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 6, 2026, 12:41 AM UTC

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 48df37e

Storybook · Sandbox · built from this PR's head

Package size: measured; main has no measurement of the merge base to compare yet.

API changes: none in this pull request

Committed API report behind this build: cli 19 rows, core 23 rows; run pnpm api:report.

Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet.

Tracing each new position in the judged part to a step set in the 800 ms before the block tests what the frozen arm is for, without depending on how many late frames a loaded runner presents.

Next step: mark the pull request ready for review and have a maintainer add the ci:run label so CI runs, since the branch is in a fork.

[Automated review]

@vjeux
vjeux marked this pull request as ready for review November 6, 2026 00:49
@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 6, 2026
@cixzhang
cixzhang marked this pull request as draft November 6, 2026 00:54
@cixzhang
cixzhang marked this pull request as ready for review November 6, 2026 00:54
@cixzhang
cixzhang merged commit 7e0e78e into meta:main Nov 6, 2026
224 of 241 checks passed
@vjeux
vjeux deleted the test/harness-frozen-arm-steps branch November 6, 2026 02:36
cixzhang added a commit to vjeux/astryx that referenced this pull request Nov 6, 2026
cixzhang added a commit that referenced this pull request Nov 6, 2026
…e Motion cross-fade and the touch hit area through Core's internal touch entry (#9669)

* chore(core): Lab's PageControl reaches the shared animator, the Reduce Motion cross-fade and the touch hit area through Core's internal touch entry

Internal entries land with their first user. Lab's PageControl animates its
strip and dots with each element's one shared animator, where the strip's
slide and a dot's size and fade compose. It reads the Reduce Motion
cross-fade's timing, and it grows toward a 44 px target under a finger with
the touch hit area that Core's own controls use. So
`@astryxdesign/core/internal/touch` also re-exports, by name:

- `animatorFor`, an element's shared animator, as Core's components reach
  it (no public API has the name);
- `reducedMotionFade`;
- `useTouchHitArea` and `touchHitAreaStyles`, the touch hit area's hook and
  its layer.

Named re-exports only, of code already on main: no behavior change, no
docs, no root re-export, no new entry, and the
`@astryx/no-core-internal-import` lint rule already limits the entry to
Core and Lab. The entry's test checks it re-exports the same values Core
imports by path, and the touch bundle test lists the four names among
those the public entry does not export.

* Merge branch 'main' into c23/l1-pagecontrol-core

* Merge branch 'main' into c23/l1-pagecontrol-core

# Conflicts:
#	packages/core/src/internal/touch.test.ts
#	packages/core/src/internal/touch.ts
#	scripts/touch-support-bundle.test.mjs

* Merge main into the PageControl lab entry branch (#10189 landed)

* Merge main into the PageControl core re-exports branch

* Merge main into the PageControl touch entry branch

* Merge main into the PageControl touch entry branch

Co-authored-by: Cindy Zhang <[email protected]>
cixzhang added a commit that referenced this pull request Nov 6, 2026
…e, a finger scrubs, every pointer pages (#9684)

* chore(core): Lab's PageControl reaches the shared animator, the Reduce Motion cross-fade and the touch hit area through Core's internal touch entry

Internal entries land with their first user. Lab's PageControl animates its
strip and dots with each element's one shared animator, where the strip's
slide and a dot's size and fade compose. It reads the Reduce Motion
cross-fade's timing, and it grows toward a 44 px target under a finger with
the touch hit area that Core's own controls use. So
`@astryxdesign/core/internal/touch` also re-exports, by name:

- `animatorFor`, an element's shared animator, as Core's components reach
  it (no public API has the name);
- `reducedMotionFade`;
- `useTouchHitArea` and `touchHitAreaStyles`, the touch hit area's hook and
  its layer.

Named re-exports only, of code already on main: no behavior change, no
docs, no root re-export, no new entry, and the
`@astryx/no-core-internal-import` lint rule already limits the entry to
Core and Lab. The entry's test checks it re-exports the same values Core
imports by path, and the touch bundle test lists the four names among
those the public entry does not export.

* feat(lab): PageControl, UIPageControl's indicators: a tap steps a page, a finger scrubs, every pointer pages

PageControl is a row of page indicators, the current one highlighted, that
pages like UIPageControl on iOS 26 (measured on the iOS 26.2 simulator):

- What it draws: 9.67 px indicators 8 px apart, at most ten slots; with
  more pages the row is a window whose edge slots shrink and slide on
  UIKit's spring; the old indicator fades out after a change.
- How it pages: the app owns the page (`page`, counted
  from 1 as Pagination counts it, `totalPages` and `onChange`). A tap on
  either side of the current indicator asks for the next or the previous
  page (mirrored in RTL); a finger that travels 16 px scrubs to the
  indicator under it and jogs past a window's edge; a press held 155 ms
  shows the held platter and dims the others. A vertical swipe stays the
  page's scroll.
- Every pointer: with a mouse or a pen a click steps one page
  toward its side and a drag scrubs; the platter, the dimming, the window's
  slide and the fades stay the touch presentation, on a coarse pointer.
- Reduce Motion: every change fades in 200 ms, nothing travels.
- Accessibility: one adjustable `slider` ("Page 3 of 5"); the arrow keys,
  Home and End change the page. Under a coarse pointer an invisible hit area
  grows the control toward 44 px, as far as its neighbours allow.
- A mouse scrub on a cropped long row holds the row still until the lift, so
  the page stays the dot under the pointer.

Its measured values live in its own table (pageControlTable.ts): only
PageControl reads them, so they stay in Lab. It reaches Core's pan and tap
recognizers, each element's shared animator, the Reduce Motion cross-fade,
the touch hit area and the touch presentation through Core's internal touch
entry.
`astryx discover` lists it, and the registry has its route.

Its timing holds on a loaded runner. A jog step commits in the timer's own
task (`flushSync`): a render scheduled after it could wait behind a busy
page's other tasks past the next step, and two steps would show as one. A
jog step counts from when the previous one was due, so a timer that runs
late does not slow the run (after
a stall longer than a step, from the late step: no burst). The window's
slide starts 50 ms after the change at a start time on the document
timeline, for the strip and every dot, which a busy main thread cannot push
back as it would a timer. The held-platter proof dates each read on the
page's clock from the touch, the clock the 155 ms runs on, and the slide
proof dates the change at the lift's first event, the task the change
commits in, not by the next frame or the end of that task. The slide's
storyboard arms the harness's hold before the tap (`armHold`), so the page
holds the motion as it starts, however late the test reads it. The RTL
scrub holds the finger 6 px past the content's edge, where the jog steps
about once a second, so exactly one step comes before the lift with
hundreds of milliseconds to spare.

The unit tests' media-query stub answers from the case's pointer at every
read: Core's gesture host keeps the `(pointer: coarse)` list it asked for
when the document's host was created, so a stub that froze its answer let
an earlier mouse case's pointer reach a later touch case (that case failed
after any mouse case, and passed alone).

Its hit area is Core's shared one: `useTouchHitArea` keeps the insets live,
paused while a scrub runs, and `touchHitAreaStyles.layer` draws the band, as
in CheckboxInput, RadioListItem, ListItem and InfoTip.

* Merge branch 'main' into c23/l1-pagecontrol-core

* Merge the updated lower stack branch into c23/l1-pagecontrol

* Merge branch 'main' into c23/l1-pagecontrol-core

# Conflicts:
#	packages/core/src/internal/touch.test.ts
#	packages/core/src/internal/touch.ts
#	scripts/touch-support-bundle.test.mjs

* Merge the updated lower stack branch into c23/l1-pagecontrol

# Conflicts:
#	internal/shadcn-registry/routes.lock.json
#	packages/cli/assets/discover/official-packages.json
#	packages/lab/src/index.ts

* Merge main into the PageControl lab entry branch (#10189 landed)

* Merge the updated lower stack branch into the PageControl branch (own diff unchanged)

* fix(lab): PageControl's held look and current indicator change at once under Reduce Motion

Under Reduce Motion a press colour's onset and a selection colour apply
at once. So a held finger's platter and the dots' dimming show with no
fade, and only their release keeps the 200 ms fade on a coarse pointer.
The current indicator changes at once on every page change.

* Merge main into the PageControl core re-exports branch

* Merge the PageControl core re-exports branch into the Lab PageControl branch

* Merge main into the PageControl touch entry branch

* Merge main into the PageControl touch entry branch

* Merge the PageControl touch entry branch into the Lab PageControl branch

Co-authored-by: Cindy Zhang <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — 48df37e8 Deployed Nov 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants