Repository navigation
test(AlertDialog): the busy-thread motion proof tells a slow alert from a frozen one - #11927
Conversation
…om a frozen one The proof counted an alert frame as still when its region's mean luma changed by 0.05 or less. Near the fade curve's luma stationary point a moving alert changes it by less than that in one frame (0.043 and 0.049 in two traced misses), so about one run in 200 failed under load with the alert still moving. The cast is lossless, so a frozen alert repeats its luma exactly. The cut is now 0.005: in 400 busy runs the smallest step on a frame the control moved was 0.039 for the entrance and 0.075 for the exit. The judge moves to its own module with unit tests: a frozen alert misses every frame, a slow alert misses none, and one repeated frame counts as a one-frame stall.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 278163a |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| AlertDialog · Storybook | 130.0 kB (0) · 15.5 kB CSS (0) | 448 (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-a11y for Accessibility, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, and it starts when the pull request is marked ready for review.
The lower motion cut is test tuning under the AlertDialog motion verification. The old cut's failure reproduces in the new unit test (2 misses at 0.05, none at 0.005), and the busy-main-thread proof passed 5 of 5 Chromium runs on this head. No changes requested.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: a one-frame luma step under 0.05 near the fade's stationary point caused the flake. Consistent: the traced step pattern gives 2 misses at 0.05 in the new unit test; the trace itself is the author's measurement.
- Claim: the still-frame cut is now 0.005. Verified at
busyMotionJudge.ts:20. - Claim: a frozen alert still fails on its first repeated frame. Verified by the frozen-alert unit case (12 of 12 frames missed) and the zero-miss assertion at
AlertDialog.motion.interaction.browser.spec.ts:1154. - Claim: the stall comparison between alert and control is unchanged. Verified at
AlertDialog.motion.interaction.browser.spec.ts:1155-1158. - Claim: the judge moved to its own module and the browser proof is otherwise unchanged. Verified against the diff; only the cut and a wider control type differ.
- Claim: red first, with the slow-alert case failing at 0.05 and all four cases passing at 0.005. Verified by running the unit test at both cuts.
- Claim: 400 of 400 browser runs pass, with a smallest moving step of 0.039 (entrance) and 0.075 (exit), about 8 times the cut. Consistent: 5 of 5 runs pass here; the 400-run figures were not repeated.
- Claim: typecheck and lint are clean. Verified with
tsc --noEmit -p packages/coreand eslint on the three files. - Claim: test only, with no product, record, API or changeset change. Verified from the file list and identical built API surfaces.
- File
packages/core/src/AlertDialog/__tests__/AlertDialog.motion.interaction.browser.spec.ts: clear. - File
packages/core/src/AlertDialog/__tests__/busyMotionJudge.ts: clear. - File
packages/core/src/AlertDialog/__tests__/busyMotionJudge.test.ts: clear.
A clean merge onto current main; no conflicts.
|
/approve-spec 6196e4e |
There was a problem hiding this comment.
Approved: CI passed on this head, including the Chromium run of the busy-main-thread proof with no missed frame in either phase.
The lower motion cut is test tuning under the AlertDialog motion verification; the old cut's failure reproduces in the new unit test (2 misses at 0.05, none at 0.005), and a frozen alert still misses every frame. A possible follow-up, not needed for this change: this proof keeps its own luma tracker and judge, while the interaction harness's brightness busy proof (used by Lightbox and Switch) already judges fades against the compositor control by capture step, which would retire the hand-tuned cut.
Claims and files checked
Review mode: same-head; reason: none
- Claim: the proof flaked about once in 200 runs with the alert still moving, because a one-frame luma step near the fade's stationary point fell under 0.05. Consistent: the traced steps give 2 misses at 0.05 in the new unit test; the flake rate and the traces are the author's measurements.
- Claim: in the traced misses the frames around the missed one kept stepping the same way while the control moved every frame, so the alert never froze. Consistent: the unit test's slow cast uses those steps with the control moving on every frame; the traces themselves are the author's.
- Claim: the cast is lossless, so a frozen alert repeats its luma exactly. Verified: the proof records a PNG screencast (
AlertDialog.motion.interaction.browser.spec.ts:1101) and reads the mean luma from the decoded pixels over a fixed region (:484,:1121-1126). - Claim: the still-frame cut is now 0.005. Verified at
busyMotionJudge.ts:20. - Claim: a frozen alert still fails on its first repeated frame, and the stall comparison with the control is unchanged. Verified by the frozen and one-stall unit cases and the assertions at
AlertDialog.motion.interaction.browser.spec.ts:1151-1158. - Claim: the judge moved to its own module and the browser proof is otherwise unchanged. Verified against the diff; only the export, a control parameter that needs only each frame's box, and the cut differ from the removed function.
- Claim: red first, with the slow-alert case failing with 2 misses at 0.05 and all four cases passing at 0.005. Verified by running the unit test at both cuts on this head's files; CI's unit job also passed the four cases on this head.
- Claim: 400 of 400 browser runs pass, with a smallest moving step of 0.039 (entrance) and 0.075 (exit), about 8 times the cut. Consistent: CI's Chromium run of the proof at
:1082passed on this head with no missed frame, and 0.039 is 7.8 times 0.005; the 400-run figures were not repeated. - Claim: typecheck and lint are clean. Verified: CI's typecheck and Lint succeeded on this head.
- Claim: test and harness only, with no product, record, public API, default, interaction or changeset change. Verified from the file list, Core's build excluding the test folder, and CI's API change report with no rows.
- Claim: the land path is a spec stamp as a test-only repair, then review, CI and the merge queue, with the motion spec's owner signing off before merge. The spec stamp is present for this head and CI has passed; the owner's sign-off is still ahead.
- Claim: the public text carries no internal context. Verified against the title, description, branch name and commit messages.
- File
packages/core/src/AlertDialog/__tests__/AlertDialog.motion.interaction.browser.spec.ts: clear. - File
packages/core/src/AlertDialog/__tests__/busyMotionJudge.ts: clear. - File
packages/core/src/AlertDialog/__tests__/busyMotionJudge.test.ts: clear.
User impact
No product change. Contributors and CI see the AlertDialog motion proof "present and dismiss keep moving through a 1 s main-thread block, against a compositor control" fail about once in 200 runs under load, while the alert is still moving. After this change it fails only when the alert really stops changing.
Problem and solution fit
longestAlertStall <= longestControlStallis unchanged.AlertDialog/__tests__/busyMotionJudge.tsso unit tests can pin it. The browser proof imports it and is otherwise unchanged.Smallest restoration
Evidence
busyMotionJudge.test.tshas these cases:At the old 0.05 cut, the slow-alert case fails with 2 misses. At 0.005, all 4 pass.
Scope
Components: AlertDialog (tests only)
Testing
vitest run packages/core/src/AlertDialog/__tests__/busyMotionJudge.test.ts: 4 passed (red first, as above).tsc --noEmit -p packages/core: clean.eslint(strict) on the changed files: no errors.test:interaction AlertDialog(the motion proof at:1082): 400 of 400 under load.Owner and land path
Owner: Cindy's Astryx gaps lane 3 (agent). The motion spec's owner signs off before merge. Land path: Specs stamp as a test-only repair, then CodeBunny review on the exact head, then ready, CI, and merge through the drain queue. No release.