Skip to content

test(interaction-harness): judge a play at the component's thresholds - #10501

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:test/harness-touch-thresholds
Nov 8, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:test/harness-touch-thresholds

Conversation

@vjeux

@vjeux vjeux commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

WebKit stamps a touch when it reaches the page. A renderer starved for 100 ms makes the page read a slower flick or a longer hold than the script plays, and the proof judges a gesture the page never received. In SnapPaging, a flick read at 208 px/s settled back under the 300 px/s advance speed. WebKit's touch command ignores a timestamp, and page-side dispatch runs on the same starved thread, so neither can set the gesture's timing.

Intended invariant

A play whose page read the release or the hold across the component's threshold from the script fails by name, never at the proof's assertion.

Change

  • PlayOptions.boundaries: {releasePxPerS?, holdMs?}: a WebKit play throws TouchPacingError or TouchPageStallError when the page read its release, or the hold from the first touch-down to the play's last lift, across a threshold from the script.
  • PlayOptions.release: 'scroll' reads the release as Core's scrollVelocity does; Core's shared test reads every gesture with both.
  • Each pacing error, TouchLiftStallError included, names the longest time the page drew no frame during the gesture.
  • SnapPaging's swipe() passes release: 'scroll' with paging.release.advanceSpeed. No Core proof passes holdMs.

Evidence

  • Failure before the change: an arm whose page holds each move of a flick but the last 60 ms fails 12 of 12 WebKit runs on the proof's assertions (ca16872, NOT FOR LANDING). On this change all 12 fail by name (9472516), e.g. "the page read a release of 203 px/s where the script throws 1000 px/s, on the other side of the 300 px/s the component decides on".
  • Mutant: a scroll filter reading the pan's release (91aa850, NOT FOR LANDING) fails 3 unit cases.
  • Harness self-test, the holdMs proof now that no Core proof passes it: a 40 ms tap whose touch-down the page holds 120 ms fails by name, frame gap over 100 ms, and passes without a bound.
  • SnapPaging's short flick under load (WebKit, two CPUs, six busy loops): 28 of 40 fail, all by name (8 TouchPacingError, 20 TouchPageStallError), none at the proof's assertion.
  • Product/runtime behavior verified unchanged: tests only.
  • 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

  • Unit: 1085 harness and Core gesture tests pass.
  • SnapPaging: WebKit 48 passed, Chromium 43 passed.
  • Harness spec: Chromium 143 passed, WebKit 125 passed.
  • Harness tsc --noEmit: 0 errors. Prettier, ESLint 0, pnpm review:pre: 0 findings against main.

@vercel

vercel Bot commented Nov 7, 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 7:03am UTC

Request Review

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

astracat-bot Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 8, 2026, 7:14 AM UTC

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · f426ecf

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 29 rows, core 40 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. The pull request is a draft from a fork, so CI starts once it is marked ready for review and a maintainer adds the ci:run label.

The threshold judgment, the scroll-release read and the frame evidence hold up, and Core's shared filter test now reads every gesture with both filters, so the copied scroll release cannot drift silently.

  • Non-blocking: the README says each pacing error names the frame gap, but TouchLiftStallError does not carry it (see the inline comment).

[Automated review]

Comment thread internal/interaction-harness/README.md Resolved

@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. The pull request is a draft from a fork, so CI starts once it is marked ready for review and a maintainer adds the ci:run label.

The threshold judgment, the scroll-release read and the frame evidence hold up. TouchLiftStallError now carries the frame gap too, so every pacing error names it, and the new unit cases fail when the frame clause, the scroll read or the hold bound breaks.

  • Non-blocking: the README and the boundaries JSDoc call the hold the first finger's, but readHold spans from the play's first touch-down to its last lift; the two agree for the one-finger taps that use it today (see the inline comment).

[Automated review]

Comment on lines +542 to +543
name when the page read the release, or the first finger's hold from
touch-down to lift, on the other side of the threshold from the script. A

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: readHold (touch.ts:617-634) measures from the play's first touch-down to the lift that ends the play, not one finger's hold. That is the same for the one-finger taps that pass holdMs today, but a multi-finger play whose last lift is another finger's is judged on that span. Consider "the hold from the first touch-down to the play's last lift" here and in the boundaries JSDoc (touch.ts:162-164).

@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 16:22
@cixzhang

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 0f01815

@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 threshold judgment, the scroll-release read and the frame evidence hold up on the merged head, but the description no longer matches the code after the merge with main.

  • After the merge, no Core proof passes holdMs: main now stops a pager's goTo move at the touch, so the edge-button tap in SnapPaging.interaction.browser.spec.ts lost its paging.catchStopMs bound, yet the description still lists that tap under Change and cites "a 40 ms tap read as 141 ms crossed the 85 ms catch time" as impact; please update the description (drop the tap, mark the tap example and the run counts as measured before the merge, and say holdMs is proven by the harness self-test), or bound a hold in a proof where the 85 ms catch still decides.

  • Non-blocking: the README and the boundaries JSDoc call the hold the first finger's, but readHold spans from the play's first touch-down to its last lift (see the earlier inline comment).

The one red WebKit interaction job failed a SnapPaging swipe on a page-stall rest fault that the base already checks, not on the new bounds; a rerun should clear it.

[Automated review]

@vjeux

vjeux commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

@astracat-bot Fixed in the description, with no code change. The edge-button tap and its catchStopMs bound are gone from Change and Evidence, along with the old tap example and run counts. The harness self-test is now named as the holdMs proof, since no Core proof passes it. The hold is described as readHold measures it, from the first touch-down to the play's last lift; the README and JSDoc wording of that span follows separately.

@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 threshold judgment, the scroll-release read and the frame evidence hold up on this head, and the description matches it.

The required test check is red only because pr-interaction-webkit (1/5) failed SnapPaging's a short flick over 300 pt/s moves a page on the existing rest check (the page's own listeners held an event 30 ms), so that lane needs a rerun before this can merge.

Non-blocking: the boundaries docs still call the hold the first finger's, releaseUnread turns boundaries off without saying so (see the inline comments), and the commit message still says the catch tap is judged at catchStopMs, so drop that sentence when squashing.

[Automated review]

A WebKit page reads a touch's timing from when the touch arrives. A
starved renderer can deliver a flick slower than its script, or a tap
held longer, and the proof then judges a gesture the page never got.

A play now names the thresholds its component decides on:
`boundaries.releasePxPerS` and `boundaries.holdMs`. It fails by name
when the page read the release, or the hold from touch-down to lift,
on the other side of a threshold from the script. `release: 'scroll'`
reads the release as Core's scrollVelocity does, and Core's shared test
keeps the two equal. Each pacing error names the longest time the page
drew no frame during the gesture.

SnapPaging's flicks are judged at the paging's advanceSpeed with the
scroll release, and its 40 ms catch tap at catchStopMs.
@cixzhang

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

/approve-spec f426ecf

@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 threshold judgment, the scroll-release read and the frame evidence hold up on this head, and every check passed.

Non-blocking:

  • The boundaries JSDoc and the README still call the hold the first finger's, while readHold measures from the play's first touch-down to its last lift (see the earlier inline comment on the README).
  • releaseUnread: true or realtime: false turns boundaries off without an error; say so in the boundaries JSDoc and the README, or judge the bounds on every real-time WebKit play.
  • The commit message still ends with the 40 ms catch tap at catchStopMs, which this head no longer judges; drop that sentence when squashing.

[Automated review]

Comment on lines +164 to +165
* did not receive. Only a driver whose page stamps touches on arrival
* (WebKit) judges them.

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 bounds are judged only when the play is judged at all (judges in playSteps is probe != null && realtime && !releaseUnread), so releaseUnread: true or realtime: false drops them with no error. The README tells a proof that reads no release from the lift to pass releaseUnread, so a tap proof that follows it and passes holdMs is never judged. Consider saying so here and in the README, or judging boundaries whenever the play is real-time on a stamping driver.

@cixzhang
cixzhang merged commit b87846c into meta:main Nov 8, 2026
78 checks passed
@vjeux
vjeux deleted the test/harness-touch-thresholds branch November 8, 2026 08:05

This branch was successfully deployed

1 active deployment
Preview — f426ecfc 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