Skip to content

test(motion, SideNav): the rail proofs judge the frames a loaded page draws, not a frame rate - #9518

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:test/rail-proofs-frames-drawn
Nov 3, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:test/rail-proofs-frames-drawn

Conversation

@vjeux

@vjeux vjeux commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

Four edge-motion proofs fail on a loaded runner with nothing wrong in the motion, because each read depends on frame timing:

  • The animated-layout spec's two-state case: its expand-start check lands a late frame into the expand (46.9 px against 30), too few frames fail moving > 5, or the collapse ends unread.
  • Its resized-pane case: the collapse ends before its 120 ms hold (48 px against more than 50).
  • The rail spec's tap case: it needs more than 20 frames over the whole tap, and its at-rest read counts the toggle's press feedback (running: 1).

Intended invariant

spec:AST-105 FR9 (the two-state form: one held copy, the edge on its column, a reversal from where the collapse got to), and component:SideNav FR6 with component:AppShell FR17 (the rail's edge on the content's, no width animation, the copy gone at rest). The claims stay; only how a run reads them changes.

Change

  • Two-state and resized-pane cases: the collapse is held at fixed times on its own clock once it rides, instead of read on two real frames; the two-state case holds its expand the same way. The expand's start is read in the task that makes it and bounded at 1.5 px (it measures 0.0) instead of 30 px.
  • Rail tap: in the tap's own task, the sampler holds the running animations, seeks them to every 50 ms of the whole glide by their own starts, reads the rail's edge against the content's, and restores each start, instead of requiring 20 frames. It still judges every frame drawn.
  • At rest: the running count leaves out the toggle's press feedback, as the motion's end-wait already does.

Evidence

  • Failure before the change: seams that delay or starve frames fail main's cases every run and pass the changed ones (Testing).
  • Success after the change: pinned to two cores with 8 and 12 workers, every changed case passes.
  • The tighter checks still bite: a module that dates a change one frame early fails the 1.5 px bound (10.2 px), and the held reads catch a rail copy revealed 50 ms ahead (47.9 px) and a panel moved 20 px mid-expand, even with frames 2 s late.
  • Product/runtime behavior verified unchanged: no product file changes.
  • CI impact: none.

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

pnpm exec playwright test --config playwright.interaction.config.ts --project=chromium packages/core/src/motion/__tests__/animatedLayout.interaction.browser.spec.ts packages/core/src/SideNav/__tests__/SideNavRailMotion.interaction.browser.spec.ts

For WebKit, use the CI WebKit job's container command (internal/interaction-harness/scripts/webkit-container.mjs) with --cpus=4, CI=1, LP_NUM_THREADS=4 and 1 worker.

Local gates at 2e490ae6a6 (this head), one commit on main 653624f84b, under the repository's .nvmrc node (24.22.1):

  • Typecheck, lint and the strict comment lint (no errors; the two warnings in the animated-layout spec are main's), Prettier on the two files, pnpm check:repo, pnpm check:knowledge and pnpm check:changesets. The unit tests that read these spec files pass (6 files, 159 tests).
  • Chromium, the animated-layout spec: 76 of 76 idle, 228 of 228 pinned to two dedicated cores at 4 workers ×3, and the two-state and resized-pane cases 120 of 120 pinned at 8 workers ×24.
  • Chromium, the rail spec: 10 of 10 idle and 30 of 30 pinned at 4 workers ×3; the tap case 24 of 24 pinned at 8 workers ×24 and 36 of 36 at 12 workers ×36.
  • WebKit under the CI WebKit job's command: the animated-layout spec 76 of 76, and the two-state and resized-pane cases ×10, 50 of 50. The rail spec skips WebKit by design.
  • Merges cleanly with main 1d04d40fd3, fix(core): a layout change made late in a long task plays its motion instead of skipping past it #9274 (b158fee2a8) and fix(core): a layout motion's copy carries on the CSS animations and transitions running in it #9534 (c23f803a1d).

Seams at this head, main's cases against this change's:

Seam Main This change
A 150 ms block after the expand is made (a late first frame) 6 of 6 fail: 32.7 px against 30 6 of 6 pass
Every frame of the expand takes 500 ms 6 of 6 fail moving > 5 (5) 6 of 6 pass
A 1.5 s block before the collapse's first frame 6 of 6 fail: no copy seen 6 of 6 pass
The same block in the resized-pane case 6 of 6 fail: 48 px against more than 50 6 of 6 pass
The main thread held 700 ms right after the tap's change 5 of 5 fail frames > 20 5 of 5 pass
A press-feedback release still running on the toggle at rest 5 of 5 fail: running: 1 5 of 5 pass

Mutants at this head:

  • A module that dates a change one frame early: main's two-state case passes 6 of 6; this change's fails 6 of 6 (10.2 px against 1.5).
  • A panel moved 20 px during the expand while the main thread is busy for 2 s: the previous version of this change passes 6 of 6, because it judged no expanding frame; this one fails 6 of 6 (20.1 px).
  • A rail sweep that stops two-thirds through the glide: the previous heldPositions >= 10 check passes 3 of 3; this one fails 3 of 3 (10 positions against 15).
  • A rail copy revealed 50 ms ahead of the content's glide: 3 of 3 fail idle and 3 of 3 with the main thread held 700 ms (47.9 px against 1).

Why the frames run short: an idle run shows no long task in the rail's glide (10 of 10, 43 to 45 frames in the 735 ms glide), while pinned with 8 workers one 255 to 459 ms task starts 8 to 41 ms after the glide does. That is contention, not the motion's own cost.

Not this change: pinned at 8 workers, the rail spec's "under Reduce Motion a tap only cross-fades… with a slow CPU" also fails on main's copy (13 of 32, no fade seen), which #9274 addresses. This change runs no code in that case before its assertions. The comment-provenance baseline check fails on main itself at 653624f84b; this change touches only test files, which that rule excludes.

@vercel

vercel Bot commented Nov 2, 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 3, 2026 1:10am UTC

Request Review

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

astracat-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 3, 2026, 1:20 AM UTC

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 2e490ae

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
SideNav 63.4 kB (0) · 10.9 kB CSS (0) — ✓ · ✓ · ✓
SideNavCollapseButton 43.4 kB (0) · 9.8 kB CSS (0) — ✓ · ✓ · ✓
SideNavHeading 55.9 kB (0) · 10.6 kB CSS (0) — ✓ · ✓ · ✓
2 more components
Component Size LoC Visual · A11y · RTL
SideNavItem 51.8 kB (0) · 10.4 kB CSS (0) — ✓ · ✓ · ✓
SideNavSection 6.6 kB (0) · 3.7 kB CSS (0) — ✓ · ✓ · ✓

Package size: no published package changed; no new dependencies.

API changes: none in this pull request

Committed API report behind this build: core 1 row; run pnpm api:report.

Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.


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.

This looks ready to approve. The four proofs now read the motion on its own clock or count the frames actually drawn, and both specs pass at this head in Chromium, with the reversal starting 0.0 px from where the collapse stopped. One optional follow-up: in the two-state case, expect(moving.length).toBeGreaterThan(5) is now met by the six held collapse reads alone, so an explicit guard (six collapsing reads and one expand start) would state what the case checks.

[Automated review]

// The collapse read on its own clock once it rides, held from the task
// that starts it: frames that come late can neither run it out before
// these reads nor move it between them.
for (const ms of [20, 40, 60, 80, 100, 120]) {

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.

Non-blocking: these six held reads all fall inside the moving window (shown 253.9 to 165.8 px here), so expect(moving.length).toBeGreaterThan(5) further down is now met before any expanding frame is read. With a 2 s block after the expand start, the case passes with no expanding frame judged. If that is intended, an explicit guard (six collapsing reads and one expand start) would say so.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 2e490ae: the case now holds the expand on its own clock too, with explicit guards (6 collapsing reads, 1 expand start, 6 expand held), and still judges every drawn expanding frame.

@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.

This looks ready to approve. The four proofs now read each motion on its own clock, both specs pass in Chromium, and the held rail check still catches a rail copy running 50 ms ahead of the content (47.9 px). One optional follow-up: in the two-state case, expect(moving.length).toBeGreaterThan(5) is met by the six held collapse reads alone, so an explicit guard (six collapsing reads and one expand start) would state what the case checks.

[Automated review]

… draws, not a frame rate

On a loaded runner four edge-motion proofs failed with nothing wrong in the motion:

- The two-state edge case (spec:AST-105 FR9) read its collapse on two real
  frames and the expand's start on the first frame after it. A late frame
  could end the collapse before the reads (no copy seen), leave too few
  frames in motion, or land one frame into the expand (46.8 and 53.0 px
  against 30). The collapse and the expand are now each read held, on
  their own clock, at 20 to 120 ms once they ride, and the expand's start
  in the task that makes it, before any frame. The two agree to 0.0 px, so
  the bound is the reveal case's 1.5 px.
- The resized-pane case read its collapse on two real frames before
  holding it at 120 ms. A late frame could end the collapse first, so the
  hold found nothing to hold (48 px where more than 50 is needed). It is now
  read held the same way.
- The rail tap (component:SideNav FR6) required more than 20 sampled frames
  over the whole tap: a 60 Hz count, mostly of frames before the motion.
  The sampler now judges the glide on its own clock: in the press's own
  task, once the change rides, it holds the page's running animations,
  seeks them to every 50 ms of the content's glide by their own starts,
  reads the rail's edge against the content's at each, and puts each back
  on its own start. Every 50 ms of the glide is judged whatever frames a
  loaded runner draws, and every frame drawn is still judged.
- Read at rest, the rail counted the toggle's own press feedback, which the
  motion's end already leaves out; its late release read as one animation
  still running.

@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.

This looks ready to approve. The two-state and resized-pane cases and the rail tap now read each motion on its own clock, both specs pass in Chromium (and the animated-layout spec in WebKit), and the tighter checks still catch a reversal dated one frame early (10.2 px) and a rail copy running 50 ms ahead (47.9 px), even with the main thread held 700 ms.

[Automated review]

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 3, 2026
@cixzhang
cixzhang marked this pull request as ready for review November 3, 2026 02:59
@cixzhang
cixzhang merged commit e02c955 into meta:main Nov 3, 2026
110 checks passed
@vjeux
vjeux deleted the test/rail-proofs-frames-drawn branch November 3, 2026 03:43

This branch was successfully deployed

1 active deployment
Preview — 2e490ae6 Deployed Nov 3, 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