Repository navigation
Commit 8bb30b5
authored
test(interaction-harness): a busy-window proof can judge a component against a compositor-only control (#8906)
## Why
A busy-window proof judges a compositor animation against a display-rate bound. On a two-core or loaded runner the compositor presents fewer frames than that bound allows though the animation moves on every one: Lightbox's double-tap zoom missed it in 7 of 10 two-core runs. A short fade gives one window too few frames.
## What led to it
Both were written for Lightbox's proofs; only its pull requests carried them.
## Options and tradeoffs
- Loosen the bound: it can't then tell a starved compositor from a frozen element.
- Keep them in Lightbox's pull requests: other proofs would carry its base.
- Their own harness pull request, on main (this one).
## Why this choice
`startBusyControl(page)` mounts a small top-layer box that the compositor animates, tracked from the same screencast. `busyWindowProof(frames, window, {control})` passes when the component moves on every frame the control moves and never stalls longer. Same frames, so no tolerance. One exception: on an easing tail, a run of unchanged frames counts as moved when a single cast step ends it and it is at most a frame longer than the run before; a freeze ends in a larger catch-up. At least four control frames need a visible move.
- `pooledBusyProof(runs)` judges short runs together.
- `{within: dialog}` mounts the control inside an open dialog, for a backdrop proof. `waitForAnimation` and `blockMainThread`'s `during` never count the control's own animation, so on a dialog they still wait for the backdrop's.
- A hold that starts before the block is judged from its first presented change inside it: WebKit presents a just-started compositor animation 130 to 300 ms late. Every frame after that change is judged, so a freeze later in the block still fails.
- Main's three busy self-tests judge against the control.
## How to check it
1. `pnpm exec vitest run --project node internal/interaction-harness/src/busy.control.test.ts`
2. `pnpm test:interaction internal/interaction-harness/src/harness.interaction.browser.spec.ts --grep "busy|control|pooled"`: a compositor animation passes; a rAF one, timed or frame-counted, fails.
## Evidence
- Noise floor: a compositor animation missed no control frame in 180 single and 90 pooled proofs.
- Margin: the rAF mutant moved on at most 1 of 40 to 47 control frames (the one presented as the block starts) and always stalled longer; a frame-counted loop failed all 20 pools.
- Lightbox's five busy proofs: Chromium 30 of 30; WebKit 33 of 40, the rest too few frames.
- Load: main's first busy self-test failed 6 of 32 at 16 workers (every frame moved, stalls 63 to 109 ms); against the control, 48 of 48. Main's other two failed the same way (3 of 16 Chromium runs at 16 workers: "31/31 moved, longest stall 169 ms"); against the control, 32 of 32 per engine.
- The first self-test's rAF run blocked right after cancelling the compositor run, so the compositor kept playing the cancelled animation into the block (the rAF mutant read 6 to 8 changed frames). With two animation frames before the block, a cancel-then-block probe kept moving in 0 of 8 Chromium runs, against 1 of 8 without them.
- BottomSheet's dim in WebKit: under the top-layer control it held 155 to 225 ms into the block while the control moved; with `within` it moves in step with the sheet. On a dialog that animates nothing else, the two waits resolved at once on the control's animation; now they wait for the dialog's own, 6 of 6 per engine.
- Wrapped self-test animations: a turnaround in the block failed 7 of 12; now 12 of 12.
- Red first: every new case fails on main's `busy.ts`.
Local gates at 187ee49: Prettier, ESLint and the harness typecheck pass on the changed files; the root build passes; the core UI suite passes; the node project passes except two process-timing cases in `packages/cli/foundation/release/cache.test.mjs`, which pass when that file runs alone (34 of 34), on this head and on main; the harness browser spec passes in Chromium (56 of 56, in two runs) and in WebKit apart from the backward self-test, a flake on main that #8535 fixes.1 parent 5171ac1 commit 8bb30b5
5 files changed
Lines changed: 1472 additions & 46 deletions
File tree
- internal/interaction-harness
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
152 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
153 | 160 | | |
154 | 161 | | |
155 | 162 | | |
156 | 163 | | |
157 | 164 | | |
158 | 165 | | |
159 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
160 | 208 | | |
161 | 209 | | |
162 | 210 | | |
| |||
0 commit comments