Skip to content

fix(core): a spring retarget committed late starts at its frame - #10607

Merged
cixzhang merged 3 commits into
meta:mainfrom
vjeux:fix/motion-retarget-starts-at-its-frame
Nov 9, 2026
Merged

cixzhang merged 3 commits into
meta:mainfrom
vjeux:fix/motion-retarget-starts-at-its-frame

Conversation

@vjeux

@vjeux vjeux commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

User impact

A retarget committed late, behind a busy main thread, jumps: 42 px in one frame behind a 200 ms block, up to 15.5 px on a loaded Switch.

Problem and solution fit

  • A retarget keeps the call's clock, so its curve runs before a frame shows it.
  • UIKit starts a retarget's added spring at its commit (iOS 26.2 simulator: 0.24–0.66 pt rms; the call's clock misses by 80–99 pt).
  • The channel now waits for the next frame, which keeps the call's clock or, over 34 ms late, restarts each spring from the screen. One read per frame judges lateness; calls in one callback share a clock.

Expected behavior and authority

spec:AST-094 FR6, amended here for the spec owners' stamp: "A retarget's spring that the browser commits late starts at that frame, from the value on screen there… Calls made in one callback… share the clock of its first call…" Row "FR6 late commit" verifies it.

Smallest restoration

  • Disclosed (FR6 gap): a retarget made inside a page's frame or ResizeObserver callback shows its new curve one frame later, pinned by a unit test.
  • Disclosed (FR6 gap): a starved compositor can show a frame 40 to 60 ms after the main-thread frame that builds it. A curve dated to its call or frame then first shows that far in. At an earlier head with the same frame rule, a loaded Switch stepped 4 to 6.5 px in 9 of 20 runs (1 of 20 at CI's quota).

Evidence

  • Red-first: on main's animator (31eeed6f80), 14 units fail, 13 of them in "a spring retarget committed late starts at its frame", and both block cases.
  • 200 ms block (Chromium, 3 runs per arm): a retarget made in a task steps 42 px back on main; here it starts from the screen, within 0.73–0.78 px. One made in a page frame callback shows one frame later, then within 0.66–0.76 px.
  • Siblings (fix(core): a resize during a pager's settle keeps where it was heading #10592's pager, 7 children retargeted in one ResizeObserver callback): 0.52–0.60 px apart at the previous head, 0.05 px at most here.
  • Loaded Switch (Chromium, 2 CPUs, 12 busy loops): late-lift steps of 5–15.5 px in 13 of 18 runs on main.
  • Normal speed (Chromium, 6 runs per arm): equal fits (rms before/after: Switch 0.15/0.18 px, BottomSheet 0.68/0.67, Carousel 0.13/0.10).

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • Unit: the motion folder (992 tests); core's ui project (20,812 tests); core TypeScript (rc 0).
  • Browser, every interaction spec on 83cfae2 (main 241712b), which this head changes only in comments, records, the changeset's wording and one unit case: Chromium 1,388 passed, 30 skipped; WebKit at CI's settings 1,202 passed, 216 skipped. One harness self-test, which reads the shader-cache marker the container script writes, passed once that marker was in place.
  • The second commit's frame-exact late-lift proof on 83cfae2: CI quota 20 of 20, arm 4 of 4 judged (6 named placement misses); its 8 mutants were caught with the same engine and proof. It passes on main too: it guards exactness, not the late-commit rule.
  • Dependent audits: the 14 audit spec files of the 22 Core folders that import the animator, in Chromium, on a Storybook built and stamped at 83cfae2: 205 of 205.
  • WebKit with a 75 ms process stall at a pager's resize retarget, at an earlier head with the same frame rule: 3 misses in 120 on main and 3 in 120 there.
  • Android exit timing (storybook-delete): main none/73 ms, head none/70 ms (6 interleaved rounds; main max gap 95 ms)
  • ESLint, Prettier, check:knowledge and check:changesets.

Writing rubric results

  • R1 narration: none.
  • R2 research: none; the fits are here.
  • R3 evidence: the row names proofs.
  • R4 rejected alternatives: none.
  • R5 change references: none.
  • R6 open questions: none.

@vercel

vercel Bot commented Nov 8, 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 8, 2026 10:30pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 8, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 8d36049

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
SegmentedControl 95.9 kB (+1.4 kB) · 6.9 kB CSS (0) — — · — · —
PowerSearch 286.4 kB (+1.4 kB) · 24.1 kB CSS (0) — — · — · —
BottomSheet 67.8 kB (+1.3 kB) · 7.7 kB CSS (0) — — · — · —
32 more components
Component Size LoC Visual · A11y · RTL
DateInput 186.2 kB (+1.3 kB) · 17.0 kB CSS (0) — — · — · —
Lightbox 122.3 kB (+1.3 kB) · 10.6 kB CSS (0) — — · — · —
Slider 109.0 kB (+1.3 kB) · 8.8 kB CSS (0) — — · — · —
DateTimeInput 207.9 kB (+1.3 kB) · 18.7 kB CSS (0) — — · — · —
Switch · Storybook 103.6 kB (+1.3 kB) · 9.9 kB CSS (0) 1,734 (0) ✓ · ✓ · ✓
TimeInput 161.6 kB (+1.3 kB) · 16.0 kB CSS (0) — — · — · —
ChatLayout 82.7 kB (+1.3 kB) · 10.5 kB CSS (0) — — · — · —
SideNav 113.9 kB (+1.3 kB) · 11.4 kB CSS (0) — — · — · —
Popover 90.7 kB (+1.2 kB) · 14.2 kB CSS (0) — — · — · —
Markdown 187.2 kB (+1 B) · 20.6 kB CSS (0) — — · — · —
Table 124.5 kB (+1 B) · 18.3 kB CSS (0) — — · — · —
ContextMenu 108.1 kB (0) · 17.4 kB CSS (0) — — · — · —
DropdownMenu 97.0 kB (0) · 17.6 kB CSS (0) — — · — · —
MultiSelector 94.7 kB (0) · 16.8 kB CSS (0) — — · — · —
Pagination 109.7 kB (0) · 17.8 kB CSS (0) — — · — · —
Selector 99.6 kB (0) · 17.4 kB CSS (0) — — · — · —
TableCell 109.4 kB (0) · 17.9 kB CSS (0) — — · — · —
Tokenizer 91.4 kB (0) · 18.8 kB CSS (0) — — · — · —
MoreMenu 97.2 kB (−1 B) · 17.6 kB CSS (0) — — · — · —
TableHeaderCell 109.0 kB (−1 B) · 17.7 kB CSS (0) — — · — · —
lab/ChatEmojiPicker 105.4 kB (new) · 773 B CSS (new) — — · — · —
lab/ChatReactionBar 106.6 kB (new) · 1.1 kB CSS (new) — — · — · —
lab/CommentComposer 150.8 kB (new) · 1.9 kB CSS (new) — — · — · —
lab/Comments 349.7 kB (new) · 2.5 kB CSS (new) — — · — · —
lab/CommentThread 342.9 kB (new) · 2.4 kB CSS (new) — — · — · —
lab/NavigationScreen 82.1 kB (new) · 1.5 kB CSS (new) — — · — · —
lab/NavigationStack 82.1 kB (new) · 1.5 kB CSS (new) — — · — · —
lab/PageControl 75.0 kB (new) · 709 B CSS (new) — — · — · —
lab/TabBar 76.7 kB (new) · 1.8 kB CSS (new) — — · — · —
lab/TabBarItem 3.8 kB (new) · 1.8 kB CSS (new) — — · — · —
lab/TourStep 97.1 kB (new) · 590 B CSS (new) — — · — · —
richtext/RichTextEditorToolbar 277.7 kB (new) · 454 B CSS (new) — — · — · —

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

API changes: cli +22 · ~7 · −0 (against the merge base's committed report); theme-butter +1 · ~0 · −0 (against the merge base's committed report); theme-y2k +1 · ~0 · −0 (against the merge base's committed report)

Committed API report behind this build: cli 29 rows, core 34 rows, theme-butter 1 row, theme-y2k 1 row; run pnpm api:report.

31 API changes (advisory)
Package Where Signature Usage
+ cli ./api · Functions · function exportSearchIndex function exportSearchIndex @experimental: (options?: { cwd?: string | undefined; package?: string | undefined }) => Promise<SearchIndex> import {exportSearchIndex} from '@astryxdesign/cli/api'; exportSearchIndex(…)
+ cli ./api · Functions · function rankSearchIndex function rankSearchIndex @experimental: (query: string, indexes: SearchIndex | SearchIndex[], options?: { type?: SearchDomain | undefined; limit?: number | undefined }) => Promise<SearchResponse> import {rankSearchIndex} from '@astryxdesign/cli/api'; rankSearchIndex(…)
+ cli ./api · Types · type DocsListChild type DocsListChild = DocsNodeChild & { topic: string; description: string; children?: DocsListChild[]; childCount?: number } import type {DocsListChild} from '@astryxdesign/cli/api'
+ cli ./api · Types · type DocsListNamespace childCount?: number | undefined import type {DocsListNamespace} from '@astryxdesign/cli/api'; const x: DocsListNamespace = {childCount: …}
+ cli ./api · Types · type DocsListNamespace children?: DocsListChild[] | undefined import type {DocsListNamespace} from '@astryxdesign/cli/api'; const x: DocsListNamespace = {children: …}
+ cli ./api · Types · type SearchIndex type SearchIndex import type {SearchIndex} from '@astryxdesign/cli/api'
+ cli ./api · Types · type SearchResultEntry deprecated?: ComponentDeprecation | undefined import type {SearchResultEntry} from '@astryxdesign/cli/api'; const x: SearchResultEntry = {deprecated: …}
+ cli ./authoring · Types · interface ComponentDeprecation interface ComponentDeprecation import type {ComponentDeprecation} from '@astryxdesign/cli/authoring'
+ cli ./authoring · Types · interface ComponentIconSlotDoc interface ComponentIconSlotDoc import type {ComponentIconSlotDoc} from '@astryxdesign/cli/authoring'
+ cli ./authoring · Types · interface ComponentIconSlotStateDoc interface ComponentIconSlotStateDoc import type {ComponentIconSlotStateDoc} from '@astryxdesign/cli/authoring'
+ cli ./authoring · Types · interface MultiComponentDoc deprecated?: ComponentDeprecation import type {MultiComponentDoc} from '@astryxdesign/cli/authoring'; const x: MultiComponentDoc = {deprecated: …}
+ cli ./authoring · Types · interface SingleComponentDoc deprecated?: ComponentDeprecation import type {SingleComponentDoc} from '@astryxdesign/cli/authoring'; const x: SingleComponentDoc = {deprecated: …}
+ cli ./doc · Types · interface ComponentBaseDoc deprecated?: ComponentDeprecation import type {ComponentBaseDoc} from '@astryxdesign/cli/doc'; const x: ComponentBaseDoc = {deprecated: …}
+ cli ./doc · Types · interface SubComponentDoc deprecated?: ComponentDeprecation import type {SubComponentDoc} from '@astryxdesign/cli/doc'; const x: SubComponentDoc = {deprecated: …}
+ cli ./doc · Also exported from an earlier entry point · ComponentDeprecation ComponentDeprecation (./authoring) import {ComponentDeprecation} from '@astryxdesign/cli/doc'
+ cli ./doc · Also exported from an earlier entry point · ComponentIconSlotDoc ComponentIconSlotDoc (./authoring) import {ComponentIconSlotDoc} from '@astryxdesign/cli/doc'
+ cli ./doc · Also exported from an earlier entry point · ComponentIconSlotStateDoc ComponentIconSlotStateDoc (./authoring) import {ComponentIconSlotStateDoc} from '@astryxdesign/cli/doc'
+ cli ./json · Also exported from an earlier entry point · DocsListChild DocsListChild (./api) import {DocsListChild} from '@astryxdesign/cli/json'
+ cli ./json · Also exported from an earlier entry point · SearchIndex SearchIndex (./api) import {SearchIndex} from '@astryxdesign/cli/json'
+ cli ./template · Also exported from an earlier entry point · ComponentDeprecation ComponentDeprecation (./authoring) import {ComponentDeprecation} from '@astryxdesign/cli/template'
+ cli ./template · Also exported from an earlier entry point · ComponentIconSlotDoc ComponentIconSlotDoc (./authoring) import {ComponentIconSlotDoc} from '@astryxdesign/cli/template'
+ cli ./template · Also exported from an earlier entry point · ComponentIconSlotStateDoc ComponentIconSlotStateDoc (./authoring) import {ComponentIconSlotStateDoc} from '@astryxdesign/cli/template'
~ cli ./api · Functions · function search function search: (query: string, options?: { cwd?: string | undefined; type?: "template" | "component" | "hook" | "theme" | "doc" | undefined; limit?: number | undefined }) => Promise<SearchResponse> → function search: (query: string, options?: { cwd?: string | undefined; type?: "template" | "component" | "doc" | "theme" | "hook" | undefined; limit?: number | undefined }) => Promise<SearchResponse> import {search} from '@astryxdesign/cli/api'; search(…)
~ cli ./api · Types · type SwizzleCopyResponse data: { component: string; package: string; outputDir: string; filesCopied: number; files: string[]; usesStyleX: boolean; feedback?: SwizzleFeedback | undefined } → data: { component: string; package: string; outputDir: string; filesCopied: number; files: string[]; usesStyleX: boolean; dependencies: Record<string, string>; marker … #84d9505b import type {SwizzleCopyResponse} from '@astryxdesign/cli/api'; const x: SwizzleCopyResponse = {data: …}
~ cli ./authoring · Types · interface MultiComponentDoc theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[] } → theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[]; componentIcons?: ComponentIconSlotDoc[] } import type {MultiComponentDoc} from '@astryxdesign/cli/authoring'; const x: MultiComponentDoc = {theming: …}
~ cli ./authoring · Types · interface SingleComponentDoc theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[] } → theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[]; componentIcons?: ComponentIconSlotDoc[] } import type {SingleComponentDoc} from '@astryxdesign/cli/authoring'; const x: SingleComponentDoc = {theming: …}
~ cli ./authoring · Types · type TemplateCategory type TemplateCategory = | 'Dashboard - Analytics' | 'Dashboard - Comparison' | 'Dashboard - KPI Summary' | 'Dashboard - Monitoring' | 'Dashboard - Executive Summary' | 'Dashboard - Sco … #e7c18378 → type TemplateCategory = | 'Dashboard - Analytics' | 'Dashboard - Comparison' | 'Dashboard - KPI Summary' | 'Dashboard - Monitoring' | 'Dashboard - Executive Summary' | 'Dashboard - Sco … #a8be998f import type {TemplateCategory} from '@astryxdesign/cli/authoring'
~ cli ./doc · Types · interface ComponentBaseDoc theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[] } → theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[]; componentIcons?: ComponentIconSlotDoc[] } import type {ComponentBaseDoc} from '@astryxdesign/cli/doc'; const x: ComponentBaseDoc = {theming: …}
~ cli ./doc · Types · interface SubComponentDoc theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[] } → theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[]; componentIcons?: ComponentIconSlotDoc[] } import type {SubComponentDoc} from '@astryxdesign/cli/doc'; const x: SubComponentDoc = {theming: …}
+ theme-butter Public attributes · attr data-astryx-pressable attr data-astryx-pressable (public data attribute) [data-astryx-pressable] { … }
+ theme-y2k Public attributes · attr data-astryx-pressable attr data-astryx-pressable (public data attribute) [data-astryx-pressable] { … }

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 commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 8, 2026, 10:45 PM UTC

@cixzhang

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

/approve-spec cdc8442

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 8, 2026

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

Requesting changes. The FR6 amendment has an engineering owner's approval at this head, and the late-commit restart works for retargets made in ordinary tasks (the new Chromium case passes here and fails on the base branch), but these issues need fixing first:

  • A retarget made inside a page requestAnimationFrame or ResizeObserver callback commits in that frame, yet noteShown counts from the next frame, so a late next frame restarts the spring from the old curve and the element jumps back (26 px in one frame in Chromium).
  • At a late frame lookAtShown replaces a velocity the call passed, such as a release velocity, with the on-screen velocity, which contradicts FR6's release clause and the documented velocity option.
  • Where the animator's frames stop while the element's document stays visible (a Document Picture-in-Picture window whose opener tab is hidden), a continuing call never finishes and later replays from the old curve, because the hidden-page check reads only the element's document.
  • The changeset and the new FR6 sentence say every late retarget starts at its commit frame, but played curves and coasts keep the call's clock, so either extend the restart to them or narrow both texts.
  • The new "FR6 late commit" row cites a loaded-Switch frame proof that this pull request does not contain, so add the proof or drop it from the row.

Any fix commit needs a fresh /approve-spec for the amended record, and CI has not run on this draft head yet.

[Automated review]

Comment thread packages/core/src/motion/animator.ts Resolved
Comment thread packages/core/src/motion/animator.ts Resolved
Comment thread packages/core/src/motion/animator.ts Resolved
Comment thread packages/core/src/motion/animator.ts Resolved
@vjeux
vjeux force-pushed the fix/motion-retarget-starts-at-its-frame branch from cdc8442 to 25f8fee Compare November 8, 2026 03:19
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 8, 2026
@vjeux
vjeux force-pushed the fix/motion-retarget-starts-at-its-frame branch from 25f8fee to 80101f4 Compare November 8, 2026 03:23
@cixzhang

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 80101f4

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 8, 2026

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

Requesting changes. This head fixes all five earlier findings, and an engineering owner approved the FR6 amendment at this head; two items remain.

  • A second property's retarget before the same late frame keeps its own clock: with an x retarget, a y retarget 20 ms later and the frame 45 ms after the first call, x restarts from the screen but y steps 17 px, while the approved FR6 measures lateness from "the first call that frame commits" (animator.ts:3386), so judge it once per frame and add a two-property case.
  • Miss: the title "a retarget starts at the frame that commits it" claims every retarget at any commit, but on-time commits, played curves and coasts keep the call's clock (FR6, and the tests at animator.test.ts:2387 and :2492), so retitle it to the late spring case.

A fix commit needs a new /approve-spec at its head. CI has not run on this draft head.

[Automated review]

Comment thread packages/core/src/motion/animator.ts Resolved
Comment thread packages/core/src/motion/animator.ts Resolved
@vjeux
vjeux force-pushed the fix/motion-retarget-starts-at-its-frame branch from 80101f4 to 83cfae2 Compare November 8, 2026 20:09
@vjeux vjeux changed the title fix(core): a retarget starts at the frame that commits it fix(core): a spring retarget committed late starts at its frame Nov 8, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 8, 2026
@cixzhang

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 83cfae2

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 8, 2026
@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 8, 2026

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

Requesting changes: the FR6 amendment has an engineering owner's approval at this head, and the late-commit restart works, but one item remains.

  • Calls in one task do not share one clock, as the approved FR6 ("Calls made in one task share the clock of its first call"), its "FR6 late commit" row and the changeset say: callTime (animator.ts:781-798) ends the clock at the next microtask checkpoint, which a browser runs after every event-listener, frame and observer callback, so two callbacks 5 ms apart start 5 ms apart; keep the clock until the task ends and add a two-callback case, or narrow FR6, its row and the changeset to one callback.

The earlier findings are fixed: lateness is now judged once per frame across properties and animators, and the title names only the late spring case. A fix commit needs a new /approve-spec at its head. CI has not run on this draft head.

[Automated review]

Comment thread packages/core/src/motion/animator.ts Resolved
Comment thread packages/core/src/motion/animator.ts Resolved
vjeux added 2 commits November 8, 2026 12:52
A call that continues motion keeps the clock of the call. When the
browser commits it late, behind a busy main thread, the screen shows
the old curve until that frame, and the new curve then shows already
advanced: the element jumps. A retarget behind a 200 ms block stepped
back 42 px in one frame.

Such a call now notes what the screen shows of each property that it
changes: the old curve or the value at rest, and any rebase since. Its
channels wait for the animator's next frame callback, which rebuilds
them from the call's own time. When that frame comes more than
LATE_START_MS after the first call it commits, on any animator, each
spring that the calls leave starts there instead, from the value on
screen, as UIKit's added spring starts at its commit. It keeps a
velocity that its call handed it, such as a release's, and otherwise
takes the one on screen. An additive spring adds to the curve on
screen from there. A played curve or a coast keeps the call's clock.

Motion calls made in one callback share the clock of its first call,
so the children of a pager line up after a retarget. A call more than
LATE_START_MS after that first call starts a new clock.

A call made inside a frame callback of the page waits for the next
frame too, so it shows its new curve one frame later. A rebase before
that frame moves the old curve with the element. stop() before a late
frame freezes where the screen shows, and the call finishes at the end
of the curve it starts. A hidden page draws no frames, nor does the
frame source of a hidden opener, so its calls keep their own clock.

AST-094 FR6 drops its limit for other retargets, restarts only a
spring that the browser commits late (more than 34 ms after the first
call), shares one clock per callback, names the one-frame-later case and
a starved compositor's lag as gaps, and gains a verification row for
a late commit.
With a retarget that starts at the frame that commits it, the
late-lift proof no longer allows a skip at a late commit. The page
notes every translate curve of the thumb: when it was made, when the
browser started it or the page set its start, when it ended, and its
keyframes.

Each presented frame must show, within 1 px, the curve the compositor
has at that frame's own time. That is the travel, a curve started
after the lift, or the off side's rest after the last one ends.
Curves replace one another only in order. A frame that matches no
curve fails as UnprescribedFrameError.

Each turn back that the frames show starts within 1 px of the newest
curve the browser started before it, and after the held lift. It
plays TRACKING or TRAVEL to the off side. A lift that lands out of
place still fails as LiftPlacementError, and too few frames as
starved.

The proof does not check when a curve is committed. Under the freeze
and the held lift, the page cannot tell where a curve was made. That
is a frame's callbacks, or a task after that frame. So a turn back on
its call's clock that meets the curve before it, but whose frame came
late, can pass here. The animator's unit tests of a spring retarget
committed late pin that rule. An on-time frame keeps the call's
clock, and a late frame starts the spring there from the screen.
@vjeux
vjeux force-pushed the fix/motion-retarget-starts-at-its-frame branch from 83cfae2 to 036b00d Compare November 8, 2026 20:56
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 8, 2026
@cixzhang

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 036b00d

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 8, 2026

@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 draft head yet, so the required checks still have to pass before merge.

The FR6 amendment has an engineering owner's approval at this head, and the earlier finding is fixed: FR6, its row and the changeset now scope the shared clock to one callback, which is what callTime does, and a new case pins the microtask-checkpoint boundary. Behind a 200 ms block in Chromium, the retarget now starts within 0.8 px of a spring from the screen, where main steps 42 px.

  • Optional: FR6's "a call more than 34 ms after that first call starts a new clock" has no unit case yet; one with a second call 40 ms into the same run would pin it.

[Automated review]

@vjeux
vjeux marked this pull request as ready for review November 8, 2026 21:25
@cixzhang

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 8d36049

@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 FR6 amendment has an engineering owner's approval for this revision, and every CI check has passed.

Merging main leaves this change's own patch as it was, and the motion and SnapPaging suites pass together on the merged code, including both 200 ms block cases in Chromium.

  • Optional: shifted() in animator.ts keeps a played curve's source, which main's rebase clears, so two animators rebased by different offsets in one task can share one interim bake; adding source: undefined there keeps the keyframe cache's contract.
  • Worth knowing: a SnapPaging settle that retargets a running settle is now rebuilt in each child's own frame callback, so it no longer gets main's single shared bake.

[Automated review]

Comment on lines +3579 to +3586
const shifted = (segment: Segment, offset: number): Segment =>
offset === 0
? segment
: {
...segment,
target: segment.target + offset,
at: t => segment.at(t) + offset,
};

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: main's rebase clears source when it moves a played curve (source: undefined), as Segment.source's JSDoc asks. This copy keeps it, and the per-task keyframe cache keys on source, not on the offset. So when two animators play one curve object, then each retargets and rebases (by 10 and 30 px) in one task, rebuildShown gives the second one the first one's interim keyframes: 55 px where its shifted curve is at 75 px, until the next frame replaces them. Adding source: undefined here keeps the cache's contract.

@cixzhang
cixzhang merged commit 3fb73b3 into meta:main Nov 9, 2026
76 checks passed
@vjeux
vjeux deleted the fix/motion-retarget-starts-at-its-frame branch November 9, 2026 00:12

This branch was successfully deployed

1 active deployment
Preview — 8d360497 Deployed Nov 8, 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