Repository navigation
test(Item): the swipe's busy proof judges a held release by its curve - #11735
Conversation
The release-settles proof armed blockMainThread after a flick, so the block began 50 to 120 ms into the settle. A fast settle then came within its settle bound before the control moved on enough frames, and the judge named that starvation. The test now arms the block before the gesture and plays a held release past the middle of the open width, which settles from rest on the same curve every run. A flick's settle starts at the release velocity, which the touch timing varies, and its fastest approaches come within the bound too soon to judge at WebKit's capture rate. busyWindowProof, a shared judge, changes in two ways. It throws BusyWindowTooLateError when a settle bound ends judging that soon and judging on to the block's end would hold enough of the control's frames, as a held curve that ends too soon already does. And a frame interval counts as a miss only when the animation's own curve moves at least one capture step across it. The replay now serves a marker that rides the caught element and places itself from the cast, so it predicts in WebKit too. AST-094's FR5 verification row says so.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Item · Storybook | 20.3 kB (0) · 6.0 kB CSS (0) | 949 (0) | ✓ · ✓ · — |
Package size: no published package changed; no new dependencies.
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
|
/approve-spec 9bad492 |
There was a problem hiding this comment.
Changes requested: the Item test rework and the owner-approved FR5 verification row look right, but one change in the shared busy-proof judge breaks pooled proofs.
- The new settle-bound
BusyWindowTooLateErrorinjudgeBusyWindow(internal/interaction-harness/src/busy.ts, lines 3113-3138) also runs for each run ofpooledBusyProof, so a starved but on-time run of a short travel is dropped as "began too late" and a pool that passes today can fail (the pooled Switch toggle, Lightbox dismiss and paging,usePagerand PageControl proofs use a settle bound); raise it only frombusyWindowProof's single-window path, or skip it for pooled runs, and add a pooled test whose short travel settles inside an on-time block.
Until that is fixed, the description's "CI impact: none" does not hold. Optionally, the FR5 sentence would match the harness more exactly as "since the last frame that showed a new position", because a hold whose sub-step moves add up to one step still fails.
Claims and files checked
- Item's proof fails about 1 run in 40 in WebKit: unverified, the author's WebKit batches
- Armed after a flick, the block began 50 to 120 ms into the settle: the base test arms after a flick (verified); the timing is the author's
- WebKit's capture switches between about 37 and 75 fps, and the judge read sub-step tail frames as misses: verified in the recorded fixture's 26.7 and 13 ms intervals and the 75 fps tail test, which falls back on the base judge
- FR5's invariant is unchanged and its verification row adds the miss rule: verified, spec.md:1118
- No product code changes; no timeout, retry or skip: verified, no packages/*/src file outside a test
- The test arms the block before a held release past half the open width: verified, ItemSwipeActions spec :1093-1097 (0.6 × the open width)
- The held release settles on one 936 ms curve every run: the fixture uses 935.9 ms; the real-run claim is the author's
- The ahead control dates each frame for the prediction: verified, spec :1082, :1103, :1113 and busy.ts:2241-2250
- The replay serves a marker that rides its element, placed from the cast, so it predicts in WebKit: verified, busy.ts:1159-1194, :1338-1340, :1850-1864, :2228-2238 and the rider tests
- A settle bound that ends judging too soon throws the too-late error when judging on would hold enough frames: verified, busy.ts:3113-3138 and the new control test
- An annotation names each run's prediction or fallback: verified, spec :1120-1124
- Batch results before and after (WebKit and Chromium run counts, reds, refusals): unverified, the author's runs; CI has not run at this head
- Each remaining red is one held 53 to 57 ms frame across which the curve moved a full step: unverified, the author's runs
- Known gap: no test judges a flick's settle under a block: verified, the held release is the spec's only blocked run
- CI impact: none: false, the settle-bound error changes pooled proofs' verdicts (the blocking finding)
- Harness unit tests: 17 files, 317 tests pass, and the three rider tests fail against the previous judge: verified; the new control test fails against it too
- The 75 fps tail passes, a full-step hold fails, and a replay that travels twice as far falls back by name: verified, the three rider tests
- tsc --noEmit for the harness and Core: no errors: verified, both exit 0
- The batches ran at an earlier commit that differs from this head only in comments, a named fallback and a rebase: verified, that commit's patch differs only in comments and the more-than-one-marker split
- Internal API delta: optional rides, and controlFrames and controlFramesWithoutSettle on the too-late error: verified, busy.ts:747 and :3133-3134
- Size +437/−71 in 5 files: verified, numstat
- Writing rubric: one present-tense sentence with no references or project status: verified, the FR5 row text
docs/specs/AST-094-touch-presentations/spec.md: clear; owner-approved; optional wording noteinternal/interaction-harness/src/busy.ts: finding, the settle-bound too-late error breaks pooled proofsinternal/interaction-harness/src/busy.control.test.ts: clear; no pooled case for the new errorinternal/interaction-harness/src/busy.predicted.test.ts: clearpackages/core/src/Item/__tests__/ItemSwipeActions.interaction.browser.spec.ts: clear; the flick-under-block case is replaced, as disclosed
The settle-bound guard sat in judgeBusyWindow, which pooledBusyProof also calls for each run. So a pooled run of a short travel that came within its settle bound early threw BusyWindowTooLateError. The pool then left it out as late, and a pool that passes failed as "0 of 3 runs judged". Only a single window throws now. A pooled run adds its few frames to the pool, as before the guard.
FR5's verification row states the judging rule as the harness applies it: a frame interval counts as a miss only when the animation's own curve moves at least one capture step since the last frame that showed a new position. A hold whose sub-step moves add up to one step still fails. busyWindowProof's description says the same.
The slow controls date a WebKit frame to within about 3.75 ms: the cast often reads a box in 2 px blocks, which is 3.3 ms of their travel. In a settle's tail that rough time can read an anchor early. A frame that shows exactly its curve's position then counts as held. startBusyControl's vernier runs four times as fast on the first control's timeline, in a strip at the viewport's foot. With ahead too, it starts the vernier ahead, half its leg ahead in the strip above. busyWindowProof takes their frames as vernier and vernierAhead. Each frame the slow controls read takes the vernier's time where its two legs are told apart (vernierTime), else the time of the one ahead. A frame neither dates keeps the slow controls' time. The proof's vernier and its notes count the judged frames each vernier dated, and say how each miss and its anchor were dated. A recorded WebKit run whose early anchor failed the proof passes with the vernier, and a real one-step hold there still fails. Without a vernier, nothing changes, and a pooled proof takes none.
The held-release proof starts the vernier and the vernier ahead at the viewport's foot, clear of the row, and passes them to busyWindowProof. Each run notes how many judged frames the verniers dated, and how each miss and its anchor were dated.
|
/approve-spec 92c7e5c |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. This draft comes from a fork, so a maintainer adds the ci:run label and the pull request is marked ready for review to start it.
The held-release proof, the replay that follows the row's marker and the vernier dating all match the touch-presentations spec's FR5, and the FR5 verification sentence carries an engineering owner's approval for this head. The earlier pooled-proof regression is fixed, and its new test fails on the previous judge and passes now.
Claims and files checked
Review mode: full; reason: spec-record
Claims:
- About 1 WebKit run in 40 failed when the block was armed after a flick: author's browser batches; not rerun here (no browser run in this review).
- The block is now armed before a held release past half the open width, one curve every run: verified in the Item swipe spec (0.6 of the open width, block armed before the drag).
- The replay serves a marker that rides the caught element, is placed from the cast and predicts in WebKit too: verified in the harness and by the three rider tests.
- Two verniers run at four times the controls' speed, half a leg apart, in the viewport's bottom 32 px: verified in the harness (100 ms leg, 50 ms offset, two 16 px strips).
- A frame neither vernier dates keeps the slow controls' time, and the proof counts each kind: verified in the harness and the vernier tests.
- A single window whose settle bound ends judging too soon throws the late-block error, and pooled runs do not: verified by the harness tests at this head.
- The FR5 verification row counts a miss only when the curve moves a full capture step since the last new position: verified as the row's text and as what the harness does.
- Only tests, the harness and the record change, with no public API: verified from the file list, the build's test exclusions and a built-surface comparison.
- The harness suite has 18 files and 327 tests that pass: verified.
- The three rider tests fail against the previous judge: verified on the base judge.
- The pooled short-travel test fails on the previous judge with every run dropped as too late: verified on the first commit's judge.
- The vernier tests date frames exactly away from a turn, defer near one, fail the recorded run without the vernier, pass it with the vernier, and still fail a real one-step hold: verified, all pass at this head.
- Typecheck is clean for the harness and for Core: verified.
- Browser batch results (480 WebKit and 120 Chromium runs, frame-dating counts, the other pooled proofs): author-reported; not rerun here.
- 1,515 lines added and 122 deleted across 7 files: verified.
Files:
docs/specs/AST-094-touch-presentations/spec.md: clear (owner-approved sentence; the rest only re-pads the table).internal/interaction-harness/src/busy.ts: clear.internal/interaction-harness/src/busy.control.test.ts: clear.internal/interaction-harness/src/busy.predicted.test.ts: clear.internal/interaction-harness/src/busy.vernier.fixture.ts: clear.internal/interaction-harness/src/busy.vernier.test.ts: clear.packages/core/src/Item/__tests__/ItemSwipeActions.interaction.browser.spec.ts: clear.
Maintainer impact
Item's "a release settles on the compositor" proof fails about 1 run in 40 in WebKit:
Intended invariant
Unchanged: the row settles on the compositor through a main-thread block (
spec:AST-094FR5). FR5's verification row now counts a frame interval as a miss only when the curve moves a full capture step since the last new position. No timeout, retry or skip.Change
aheadcontrol and arms the block before a held release past half the open width: one 936 ms curve every run.blockMainThreadreplays the caught animation for a marker riding its element (rides);busyWindowProof, a shared judge, places it from the cast. It predicts in WebKit too, where a frame predicted under one capture step is too little to judge.BusyWindowTooLateErrorwhen judging on would hold enough.Evidence
Scope
Components:
busyWindowProof, Item's swipe spec,spec:AST-094FR5.Testing
pnpm exec vitest run --project node internal/interaction-harness: 18 files, 327 tests pass. The three rider tests fail against the previousbusy.ts. The 75 fps tail passes, with 3 or more tail frames under one step. A full-step hold fails. A replay that travels twice as far falls back by name.pnpm exec tsc --noEmitforinternal/interaction-harnessandpackages/core: no errors.CI=1 node internal/interaction-harness/scripts/webkit-container.mjs packages/core/src/Item/__tests__/ItemSwipeActions.interaction.browser.spec.ts --workers=1 --repeat-each=240 -g "a release settles on the compositor".pnpm exec playwright test -c playwright.interaction.config.ts packages/core/src/Item/__tests__/ItemSwipeActions.interaction.browser.spec.ts --project=chromium --workers=1 --repeat-each=120 -g "a release settles on the compositor".busy predictionandbusy vernierannotations give its prediction or fallback and its vernier counts, read from a blob report.usePager's settle and PageControl's window slide. All pass in Chromium. In WebKit, the toggle,usePagerand PageControl proofs skip by their own specs, and the rest pass. The four controls, where a slowed page settle must fail the proof, pass in both engines.Writing rubric results
The one edit is a sentence in
spec:AST-094FR5's verification row.R1 narration: none; the sentence states the judging rule in the present tense.
R2 research: none.
R3 evidence: the row names no pull request, issue or commit.
R4 rejected alternatives: none added.
R5 change references: none.
R6 open questions: none touched.
R7 project status: none.
Public and internal API delta
None public. In the internal harness:
BlockedWindow.animationgains an optionalrides.BusyWindowTooLateErrorgainscontrolFramesandcontrolFramesWithoutSettlewhen a settle bound ends judging.startBusyControlandtrackControltakevernier, and withaheadtoo, the vernier ahead.busyWindowProofandpageTimesOnControlstakevernierandvernierAheadframes, and the proof returnsverniercounts.vernierTime,vernierColor,VERNIER_CONTROL_RGB,VERNIER_AHEAD_CONTROL_RGB,ControlTimesOptions,VernierDating,BusyFrameDatingandBusyVernierReadare new exports.busy.ts+650/−67, its tests +514, and a recorded WebKit run as a fixture +260. Item's spec is +46/−10, and AST-094 +45/−45 (one sentence; prettier re-pads the table). No product code.