Skip to content

test(NavigationStack): a push after a heavy commit never skips into its curve - #12990

Merged
cixzhang merged 5 commits into
mainfrom
test/navstack-first-frame-guard
Nov 20, 2026
Merged

cixzhang merged 5 commits into
mainfrom
test/navstack-first-frame-guard

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What this adds

A Playwright interaction test for NavigationStack: a push from rest after a heavy commit never skips into its curve.

  • Setup: a 300 ms synchronous block in the push's commit. From inside that task, the test reads the pushed card's travelled share and frame time in each of the first six frames.
  • Pass condition:
    • The push really happened: the block ran, and every frame found the pushed card.
    • The first moving frame shows no more of the push spring than the time since the frame before it (or since the block ended) allows, plus one frame.
    • The card moves by the third read. The push starts on the first frame after the task, but Chromium can run the first two frames after a long task on one frame time, so the card can still read at rest on the second read.
  • Engines: the same check runs in Chromium and WebKit, with no engine branch.

It guards the first-frame behavior behind a closed WebKit-only proposal (#12737). That skip did not reproduce on a physical iPhone 14 with iOS 26.2, so no engine branch ships, and this test catches a future regression in every engine instead.

Evidence

At this head, 3 runs per engine, workers 1, no retries, stack 370 px:

Engine First moving frame Share of travel Time since the frame before (or the block's end) Bound
Chromium 149 2, 2, 2 0.081, 0.089, 0.099 16.7, 16.7, 16.6 ms 0.324, 0.324, 0.323
WebKit (Playwright 1.61) 0, 1, 1 0.027, 0.494, 0.487 2.0, 58.0, 56.0 ms 0.193, 0.622, 0.611
  • All 6 runs pass. In Chromium, frames 0 and 1 are at rest every run. WebKit's frames after the block are 16–58 ms apart, so a large first step stays inside the elapsed-time bound.
  • Negative control: with the click removed, the test fails in both engines. No push means no pushed card, so the frame trace never completes and the wait for it times out.

Scope

  • Test only (NavigationStack.interaction.browser.spec.ts): no Changeset, no source or record change.
  • Public text contains no internal Meta context.

Overlap checked: #12737 (closed unmerged; this guard replaces its engine-specific test), #12981 (the Heavy Commit story, a separate evidence fixture)

…ips into its curve

A 300 ms block in the push's commit, then the pushed card's travelled
share and frame time in the first six frames. The first moving frame may
show no more of the spring than the time since the frame before it (or
since the block ended) allows, plus one frame, and moves by the second
frame. Same check in every engine; a guard for the WebKit first-frame
question, which did not reproduce on a physical iPhone.
@vercel

vercel Bot commented Nov 19, 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 20, 2026 2:59am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

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

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

Copy link
Copy Markdown
Contributor Author

/approve-spec 4266168

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 86c09b9

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC
lab/NavigationScreen 86.0 kB (0) · 1.5 kB CSS (0) —
lab/NavigationStack 86.0 kB (0) · 1.5 kB CSS (0) —

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

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


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.

Changes requested: the new first-frame guard bounds the push the right way, but it also passes when no push happens at all.

  • NavigationStack.interaction.browser.spec.ts:1264-1267 records a missing pushed card as fully travelled and blockEnd falls back to 0 (:1275-1276), so with no push every assertion passes; record whether each frame found the card, then assert blockEnd > 0 and that every frame read it.

Optional: starting the frame reader in the observer callback right after the block would make "moves by the second frame" count from the task rather than from a second page.evaluate round trip, and a small helper would keep the 300 ms mount block in step with the sibling test's copy. The interaction lanes have not run this test yet, because CI skips while the pull request is a draft.

Claims and files checked

Review mode: same-head; reason: none

  • Claim: a Playwright interaction test that a push after a heavy commit never skips into its curve: verified (lines 1221-1302).
  • Claim: a 300 ms synchronous block in the push's commit, then the card's travelled share and frame time in six frames: verified (lines 1234-1284).
  • Claim: the first moving frame shows no more of the spring than the elapsed time allows, plus one frame: verified, with an extra 0.02 tolerance the description does not mention (lines 1292-1301).
  • Claim: the card moves by the second frame: false when the card never mounts, since a missing card counts as moved; otherwise counted from the reader's first frame, not from the task.
  • Claim: the same check runs in Chromium and WebKit with no engine branch: verified (no engine test in the body; the interaction config has exactly those two projects).
  • Claim: it guards the behaviour the closed WebKit workaround proposed, which did not reproduce on a physical iPhone, so no workaround ships: verified against that pull request's test and closing comment; this is its test without the engine branch, and no source file changes here.
  • Claim: current code passes the check: verified in Chromium (3 of 3 runs); the Linux WebKit figures fit a spring started at the block's end but were not re-run; the Firefox figures were not re-run, and the config has no Firefox project, as stated.
  • Claim: the CI interaction lanes run it on this head: not yet, since they were skipped while the pull request is a draft.
  • Claim: test only, with no changeset, source or record change, and no internal context: verified.
  • Claim: overlap with the closed WebKit change and the separate Heavy Commit story: verified.
  • File packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts: the blocking finding above and the optional notes.

Automated review (maintainer link)

The frames are read from the task that blocks, and each records whether it
found the pushed card. The test asserts that the block ran and every frame
found the card. The heavy commit's length is one constant shared with the
sibling test.
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec acb400a

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

Changes requested: the new first-frame guard fails in Chromium on main's NavigationStack, and the description's evidence comes from the earlier version of the test.

  • NavigationStack.interaction.browser.spec.ts:1296 fails in the Chromium interaction project on main's code (5 of 6 runs, Expected: <= 1, Received: 2), because with the reader started inside the blocking task Chromium's first two reads carry frame times from before the block ended and still show the card at rest, so please allow read 2 with its reason (for example toBeLessThanOrEqual(2), which passed 8 of 8 runs) or keep only the time-normalized share bound, and re-run both engines.
  • The description's Chromium and WebKit pass numbers, and its note that this is #12737's test without the engine branch, describe the earlier reader that started after the click, so please re-measure after the fix and update the Evidence and Overlap lines.

The share bound held in every Chromium run, so the guard's main claim looks right. The CI interaction lanes have not run on this head yet because the pull request is a draft.

Claims and files checked

Review mode: same-head; reason: none

  • Changed rules (0).
  • Adds a Playwright interaction test for a NavigationStack push from rest after a heavy commit: verified (the new test).
  • Setup is a 300 ms synchronous block in the push's task, then the card's travelled share and frame time in six frames: verified (the observer, block and reader, and HEAVY_COMMIT_MS).
  • The first moving frame shows no more of the spring than the elapsed time allows, plus one frame: verified (the share bound, which also allows 0.02 of slack).
  • The card moves by the second frame: false in Chromium at this head (it first moves on the third read).
  • The same check runs in Chromium and WebKit with no engine branch: verified (no engine branch or skip; the interaction config has both projects).
  • It guards what a closed WebKit-only workaround proposed, which did not reproduce on a physical iPhone, so no workaround ships: verified (that pull request is closed unmerged, and its closing comment says so).
  • main passes in Linux WebKit with the stated numbers: not verified (WebKit could not run in this review), and measured with the earlier reader.
  • main passes in Chromium 149 with the stated numbers: false at this head (5 of 6 runs fail).
  • Firefox numbers from a run outside the repository config: the config has no Firefox project (verified); the numbers were not reproduced.
  • The CI interaction lanes run it on this head: not yet (they were skipped while the pull request is a draft).
  • Test only, with no changeset, source or record change: verified (one file under __tests__).
  • Public text has no internal context: verified.
  • Overlap with the closed workaround's test without its engine branch: no longer exact (this head reads frames inside the task and adds the found-card checks); the heavy-commit story is a separate evidence fixture: verified (a story-only draft pull request).
  • File packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts: the two blocking findings above.

Automated review (maintainer link)

…by the third frame

The reader starts in the task that commits the push, so its first frame
paints the new screen at rest and an input task's push starts a frame
later.
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 182dd05

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

Changes requested: the first-frame guard passes in Chromium, but the reason it gives for letting the card first move on the third read describes NavigationStack's clock wrongly.

  • The comment at NavigationStack.interaction.browser.spec.ts:1295-1297 and the description's Pass-condition bullet say an input task's push starts one frame after the reader's first frame, but the push starts in that first frame (its animation's start time is set about 2 ms after the block ends, as transitionClock and the animator's 'next-frame' start document), and the card reads at rest on the second read only because Chromium runs the first two reads after the long task on one frame time, so please keep toBeLessThanOrEqual(2) and reword the reason in the comment and the description to match.

WebKit still has no result for this head, so please fill in both engines' numbers before you mark it ready.

Claims and files checked

Review mode: same-head; reason: none

  • Changed rules (0).
  • Adds a Playwright interaction test for a NavigationStack push from rest after a heavy commit: verified (the new test).
  • Setup is a 300 ms synchronous block in the push's commit, then the card's travelled share and frame time in each of the first six frames, read from inside that task: verified (the observer, block and in-task reader, and HEAVY_COMMIT_MS).
  • The push really happened, because the block ran and every frame found the card: verified (the blockEnd and found-card checks).
  • The first moving frame shows no more of the spring than the elapsed time allows, plus one frame: verified (the share bound, which also allows 0.02 of slack).
  • The card moves by the third frame: verified (the index check; every Chromium run first moved on the third read).
  • The first frame paints the new screen at rest and an input task's push starts at the next one: false (the push starts in the first frame after the task; Chromium's first two reads share one frame time).
  • The same check runs in Chromium and WebKit with no engine branch: verified (no engine branch or skip; the interaction config has both projects).
  • It guards what a closed WebKit-only proposal targeted, which did not reproduce on a physical iPhone, so no engine branch ships: verified (that pull request is closed unmerged, and its closing comment says so).
  • Chromium and WebKit runs at this head are pending: verified (CI skipped the interaction lanes while the pull request is a draft).
  • Test only, with no changeset, source or record change: verified (one file under __tests__).
  • Public text has no internal context: verified.
  • Overlap, where this guard replaces the closed proposal's engine-specific test and the heavy-commit story is a separate evidence fixture: verified (the story pull request is an open, story-only draft).
  • File packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts: the blocking finding above.

Automated review (maintainer link)

…ead move

The push starts on the first frame after the task. Chromium can run the
first two frames after a long task on one frame time, so the card can
still read at rest on the second read. Comment only.
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 21e4d9a

@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: the first-frame guard now gives the right reason for letting the card first move on the third read, and nothing else needs to change. CI has not run on this head because the pull request is a draft; it runs once the pull request is marked ready for review.

Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0).
  • Adds a Playwright interaction test that a NavigationStack push from rest after a heavy commit never skips into its curve: verified (the new test at NavigationStack.interaction.browser.spec.ts:1223-1312).
  • Setup is a 300 ms synchronous block in the push's commit, then the card's travelled share and frame time in each of the first six frames, read from inside that task: verified (HEAVY_COMMIT_MS, the block at :1249-1253, the reader started in the observer callback at :1272).
  • The push really happened, because the block ran and every frame found the card: verified (:1290-1291).
  • The first moving frame shows no more of the spring than the elapsed time allows, plus one frame: verified (:1306-1311, which also allows 0.02 of slack).
  • The card moves by the third read; the push starts on the first frame after the task, and Chromium can run the first two frames after a long task on one frame time: verified (:1295-1298, NavigationStack's clock, and a Chromium probe of the same setup).
  • The same check runs in Chromium and WebKit with no engine branch: verified (no skip or engine branch in the test; the interaction config has both projects).
  • It guards what a closed WebKit-only proposal targeted, which did not reproduce on a physical iPhone, so no engine branch ships: verified (that pull request is closed unmerged, and its closing comment says so).
  • All six runs pass, with Chromium first moving on the third read at a share of about 0.08 to 0.10 under a bound of about 0.32: verified (consistent with 16 of 16 Chromium runs of the same code; each Bound value matches the test's formula).
  • WebKit first moves on the first or second read, within bounds of about 0.19 to 0.62: the author's runs, consistent with the formula; not reproduced here, and CI has not run.
  • Without the click the test fails in both engines, because the frame trace never completes and the wait times out: verified from the code (no card means no reader, so the wait at :1278-1281 runs into the 60 s test timeout).
  • Test only, with no changeset, source or record change: verified (one file under __tests__).
  • Public text has no internal context: verified.
  • Overlap, where this guard replaces the closed proposal's engine-specific test and the heavy-commit story is a separate evidence fixture: verified (the story pull request is an open, story-only draft).
  • File packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts: clear.

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 86c09b9

@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: the first-frame guard has no open findings, and CI passes on this head, including the new test in both the Chromium and WebKit interaction lanes.

Claims and files checked

Review mode: same-head; reason: none

  • Changed rules (0).
  • Adds a Playwright interaction test that a NavigationStack push from rest after a heavy commit never skips into its curve: verified (NavigationStack.interaction.browser.spec.ts:1223-1312).
  • Setup is a 300 ms synchronous block in the push's commit, with the card's travelled share and frame time read in each of the first six frames from inside that task: verified (HEAVY_COMMIT_MS at :77, the block at :1249-1253, the reader started inside the observer callback at :1272).
  • The push really happened, because the block ran and every frame found the card: verified (:1290-1291).
  • The first moving frame shows no more of the spring than the elapsed time allows, plus one frame: verified (:1306-1311, which also allows 0.02 of slack).
  • The card moves by the third read; the push starts on the first frame after the task, and Chromium can run the first two frames after a long task on one frame time: verified (:1293-1298 and NavigationStack's transition clock, NavigationStack.tsx:772-788).
  • The same check runs in Chromium and WebKit with no engine branch: verified (no engine branch in the test; it passes in both CI interaction lanes on this head).
  • It guards what a closed WebKit-only proposal targeted, which did not reproduce on a physical iPhone, so no engine branch ships: verified (that pull request is closed unmerged, and its closing comment says so).
  • Chromium's three runs first move on the third read at a share of about 0.08 to 0.10 under a bound of about 0.32: consistent (each bound matches the test's formula, and the test passes in CI's Chromium lane); the per-run numbers are the author's.
  • WebKit's three runs first move on the first or second read, within bounds of about 0.19 to 0.62: consistent (each bound matches the formula, and the test passes in CI's WebKit lane); the per-run numbers are the author's.
  • All six runs pass, Chromium's first two reads are at rest, and WebKit's frames after the block are 16 to 58 ms apart: the author's runs, consistent with both CI passes and an earlier Chromium probe of the same setup.
  • Without the click the test fails in both engines, because the frame trace never completes and the wait times out: verified from the code (no card means no block and no reader, so the wait at :1278-1281 runs into the 60 s test timeout).
  • Test only, with no changeset, source or record change: verified (one file under __tests__).
  • Public text has no internal context: verified.
  • Overlap, where this guard replaces the closed proposal's engine-specific test and the heavy-commit story is a separate evidence fixture: verified (the story pull request is an open, story-only draft).
  • File packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts: clear.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 20, 2026 03:42
@cixzhang
cixzhang merged commit 5815d02 into main Nov 20, 2026
143 checks passed
@github-actions
github-actions Bot deleted the test/navstack-first-frame-guard branch November 20, 2026 06:05

This branch was successfully deployed

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

Labels

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.

1 participant