Skip to content

test(interaction-harness): every WebKit touch play judges the release its page read - #10383

Merged
cixzhang merged 4 commits into
meta:mainfrom
vjeux:test/harness-lift-stall-guard
Nov 7, 2026
Merged

cixzhang merged 4 commits into
meta:mainfrom
vjeux:test/harness-lift-stall-guard

Conversation

@vjeux

@vjeux vjeux commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

WebKit stamps a touch when it arrives, so a loaded runner, or page work in onEvent, can make the page read a rest where the script throws, or a throw where it rests. Only 'spacing' plays judged that. A default-paced play passed on a gesture the page never received: SnapPaging's "three items per view: a flick moves one view…" failed so 6 times in 120 at four workers.

Intended invariant

A touch play reaches the page as scripted, or it fails by name.

Change

  • In WebKit, every real-time play reads its release from the page's own stamps. When the page read a rest where the script throws, a throw where it rests, or too few moves, the play throws:
    • TouchLiftStallError when its own onEvent ran for the lift gap's excess;
    • TouchPageStallError when the page's own listeners held an event;
    • TouchPacingError otherwise.
  • A WebKit play with onEvent now also waits its interval after each answer. Behind its schedule it sent events back to back, so its page work could eat a scripted rest.
  • The earlier send-time bound, blind to a slow dispatch, goes.
  • releaseUnread opts a play out. A play whose page lost events is judged only under 'spacing'.

Evidence

  • Failure before the change: on main's touch.ts, three new WebKit self-tests fail.
    • A last move held 80 ms by a page listener, or 60 ms by onEvent, resolves while the page reads a rest. Here it fails as TouchPageStallError or TouchLiftStallError.
    • A drag with page work in onEvent on every move: its 150 ms rest reaches the page in 33 ms. Here no gap shrinks.
    • Controls pass: a quick onEvent, releaseUnread, Chromium.
  • Mutants (judge only 'spacing', no onEvent attribution, attribute every rest, ignore releaseUnread) each fail a self-test.
  • The gap change, A/B interleaved at one worker on the three plays it fixes (RefreshControl's indicator pull, two LightboxZoom pans): 12 of 30 runs failed by name before, 0 of 30 after.
  • Survey of the 622 WebKit tests in the 43 specs that play touches, CI's container profile:
    • one worker, as CI runs: no new failure (539 passed, 83 skipped);
    • four workers: 4 plays fail by name; 8 tests fail on their own assertions, and the judgment threw in none.
  • Product/runtime behavior verified unchanged: only the harness changes.
  • CI impact (for a change to workflows, actions or CI scripts): 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

  • Harness self-tests at this head: WebKit 117 passed, 25 skipped, in CI's container profile; Chromium 135 passed, 7 skipped.
  • Red-first on main's touch.ts: the three new WebKit self-tests fail.
  • Harness tsc and ESLint: 0. Prettier: clean. pnpm review:pre: 0 findings, merge into main clean.

@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 7, 2026 9:10am UTC

Request Review

@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 7, 2026, 9:17 AM UTC

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

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 6631268

Storybook · Sandbox · built from this PR's head

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

API changes: none in this pull request

Committed API report behind this build: cli 19 rows, core 25 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

@cixzhang

cixzhang commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

/approve-spec b259da5

@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. This is a draft from a fork, so mark it ready for review and have a maintainer add the ci:run label so CI runs.

The new lift check throws TouchLiftStallError only where the page's own release reading sees a rest. The releaseUnread opt-out and both self-tests behave as the description says.

  • Land it in the order the description gives, with or after the SnapPaging, LightboxZoom and SliderTouch fixes. SliderTouch's "a finger lifted outside the tracking bounds coasts back to the lift value" waits two animation frames and a read at its last move, so its lift sits close to the 40 ms bound even on a quiet runner.

[Automated review]

vjeux added 3 commits November 6, 2026 19:32
WebKit stamps a touch when it arrives. A touch play waits for its
onEvent before it sends the next event, so page work there before a
lift delays the lift by a round trip. Past the 40 ms stillness interval
the page reads a resting finger and releases at 0, and the play passed
anyway, unless it was paced by 'spacing'.

Each event reached the page by its answer, and the lift no sooner than
it left. When the gap from the lifting finger's last moved answer to the
lift's send already reads as a rest where the script throws, the play
now fails with TouchLiftStallError. The message names the gap, the
script's gap and onEvent's share of it. A play whose proof reads no
release from its lift opts out with releaseUnread.
The release judgment ran only for plays paced by 'spacing'. A play on
the default pacing whose page read a resting finger, because a loaded
runner or page work in onEvent held the lift back, passed, and the
proof then asserted on a gesture the page never received.

Every real-time play on a driver whose page stamps touches on arrival
now reads the release from the page's own stamps. It fails by name
when that release is not the script's: TouchLiftStallError when
onEvent ran for the lift gap's excess, TouchPageStallError when the
page's listeners held an event, else TouchPacingError. This replaces
the lower bound the lift check used. releaseUnread opts a play out,
and a play whose page lost events is judged only under 'spacing'.
A WebKit play that watched each step (onEvent) went back to its
scripted times after a slow step, so it sent the next events back to
back. Page work in onEvent could eat a scripted rest before the lift,
and the page read a throw where the script rests. Such a play now also
waits its interval after each answer, as any other WebKit play does: a
gap can stretch, but it never shrinks.
@vjeux
vjeux force-pushed the test/harness-lift-stall-guard branch from b259da5 to 81520c1 Compare November 7, 2026 03:45
@vjeux vjeux changed the title test(interaction-harness): a lift held past the stillness interval fails test(interaction-harness): every WebKit touch play judges the release its page read Nov 7, 2026
@cixzhang

cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 81520c1

@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. This is a draft from a fork, so mark it ready for review and have a maintainer add the ci:run label so CI runs.

The three new WebKit self-tests fail on the current driver and pass with this change, and the release judgment, the releaseUnread opt-out and the onEvent gap fix behave as the description says.

Non-blocking:

  • The touch.ts file header (lines 26-30) still says a 'schedule' play with onEvent skips the answer wait, while the README row it syncs with now says no gap can shrink.
  • liftStallError names TouchLiftStallError only when onEvent time covers the whole gap excess, which also holds transport; it held by 0.3 to 2.5 ms in 60 runs here, so a slack term like the page-stall check's HELD_BACK_MS would keep the name on a slower runner.
  • liftStallError repeats readRelease's lifting-finger scan; returning the script's last moved index from readRelease would keep one copy.

[Automated review]

// A driver gives a probe only where the page stamps touches on arrival.
// There, a play behind its schedule never shrinks a scripted gap, so page
// work in `onEvent` cannot eat the rest before a lift.
const keepsGaps = probe != null;

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: every WebKit play now waits for the answer, but the file header (lines 26-30) still says a stall stretches the gesture "unless a 'schedule' play watches each step, onEvent". Its SYNC note asks it to match the README row, which now says "even with onEvent, so no gap can shrink". Dropping the "unless…" clause keeps them equal.

Comment on lines +592 to +606
const id = steps[lift].changed[0]?.id;
let lastMoved = 0;
let at = '';
steps.forEach((step, k) => {
const finger =
step.type === 'touchStart' || step.type === 'touchMove'
? step.changed.find(f => f.id === id)
: undefined;
const key =
finger == null ? at : `${Math.round(finger.x)},${Math.round(finger.y)}`;
if (key !== at) {
lastMoved = k;
at = key;
}
});

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: this re-derives the lifting finger and its rounded positions that readRelease already reads (lines 391-406). If either rounding changes, the attribution measures a different gap from the one the judgment read. readRelease could return the script's last moved index (its coreRelease keeps the moved samples with their indexes) so there is one scan.

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 7, 2026
@vjeux
vjeux marked this pull request as ready for review November 7, 2026 05:12
@cixzhang
cixzhang marked this pull request as draft November 7, 2026 06:59
@cixzhang
cixzhang marked this pull request as ready for review November 7, 2026 06:59
@cixzhang

cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 6631268

@cixzhang
cixzhang marked this pull request as draft November 7, 2026 11:15
@cixzhang
cixzhang marked this pull request as ready for review November 7, 2026 11:15
@cixzhang
cixzhang merged commit ca88398 into meta:main Nov 7, 2026
134 of 135 checks passed
@vjeux
vjeux deleted the test/harness-lift-stall-guard branch November 7, 2026 11:49

This branch was successfully deployed

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