touch-select.spec.ts:246 flaked once on chromium-390 (full suite, #854 head) #1134

Open
opened 2026-11-14 15:35:36 +00:00 by kayg · 2 comments
Owner

Seen on the #854 full-suite run (head 730a6dd33 = dev 8b00393b0 + tables), project chromium-390, CI=1 --retries=0 --workers=1:

e2e/touch-select.spec.ts:246 "the block follows the finger, inside the page, with a ring that fills, then settles back": expect(far).toBeGreaterThan(10) got NaN at line 261 (the transform read back as no number: the block's transform was empty at that frame).

Not reproducible: --repeat-each=10 on the same head, same project: 10 passed. Per the flaky rule it does not block. Likely a timing read of the transform before the first move frame is applied; the test could poll sideways() until it parses.

Seen on the #854 full-suite run (head 730a6dd33 = dev 8b00393b0 + tables), project chromium-390, `CI=1 --retries=0 --workers=1`: `e2e/touch-select.spec.ts:246` "the block follows the finger, inside the page, with a ring that fills, then settles back": `expect(far).toBeGreaterThan(10)` got `NaN` at line 261 (the transform read back as no number: the block's transform was empty at that frame). Not reproducible: `--repeat-each=10` on the same head, same project: 10 passed. Per the flaky rule it does not block. Likely a timing read of the transform before the first move frame is applied; the test could poll `sideways()` until it parses.
Author
Owner

Stability lane (15 Nov), dev 42c219afd: reproduced on x86 under load, cause narrowed, not fixed

e2e/touch-select.spec.ts:246, chromium-390, --repeat-each=30, one slot job: dev-01 (load average ~23) failed 5 / 30 (and 13 / 30 and 11 / 30 and 10 / 30 in instrumented runs); 0 / 100 and 0 / 60 and 0 / 100 on quieter moments and on dev-02 (aarch64).
Failures are at the first read (expect(await sideways()).toBe('translateX(10px)'), line 255; Received: ""), not the NaN of the issue's later read. Instrumented findings:

  • touch.ts does claim the swipe (SWIPEDBG ms 1..7, claimed true every time) and follow() sets translateX(6px) and translateX(10px) on the right line (linesOf found "Plans fo", the right block) and creates the ring.
  • In failing runs, a second CodeMirror update() (one transaction, one effect, no doc change) arrives 8 to 21 ms later, and a MutationObserver on the content shows the line's style attribute reset from transform: translateX(10px) to nothing in that update (CodeMirror's setAttrs removes attributes it does not know when a line is redrawn). Every line then has an empty transform while the ring is still there.
  • So the imperative el.style.transform of blocks/follow.ts on a CodeMirror-owned .cm-line is lost when any update redraws the line; the next touchmove sets it again, so on a phone it is a one-frame flicker, and the spec reads in that gap. Which update it is, I could not identify (the stack capture slowed the run enough to stop the failures).
    A fix would re-apply the pull's transform from an EditorView.updateListener (same task as the redraw, before paint). Not done in this lane because I could not reproduce after instrumenting to verify it.
## Stability lane (15 Nov), dev `42c219afd`: reproduced on x86 under load, cause narrowed, not fixed `e2e/touch-select.spec.ts:246`, chromium-390, `--repeat-each=30`, one slot job: dev-01 (load average ~23) failed **5 / 30** (and 13 / 30 and 11 / 30 and 10 / 30 in instrumented runs); 0 / 100 and 0 / 60 and 0 / 100 on quieter moments and on dev-02 (aarch64). Failures are at the **first** read (`expect(await sideways()).toBe('translateX(10px)')`, line 255; `Received: ""`), not the NaN of the issue's later read. Instrumented findings: - `touch.ts` does claim the swipe (`SWIPEDBG ms 1..7`, `claimed true` every time) and `follow()` sets `translateX(6px)` and `translateX(10px)` on the right line (`linesOf` found "Plans fo", the right block) and creates the ring. - In failing runs, a second CodeMirror `update()` (one transaction, one effect, no doc change) arrives 8 to 21 ms later, and a `MutationObserver` on the content shows the line's `style` attribute reset from `transform: translateX(10px)` to nothing in that update (CodeMirror's `setAttrs` removes attributes it does not know when a line is redrawn). Every line then has an empty `transform` while the ring is still there. - So the imperative `el.style.transform` of `blocks/follow.ts` on a CodeMirror-owned `.cm-line` is lost when any update redraws the line; the next `touchmove` sets it again, so on a phone it is a one-frame flicker, and the spec reads in that gap. Which update it is, I could not identify (the stack capture slowed the run enough to stop the failures). A fix would re-apply the pull's transform from an `EditorView.updateListener` (same task as the redraw, before paint). Not done in this lane because I could not reproduce after instrumenting to verify it.
Author
Owner

Evidence for #1134 (PR #1185, head d2e4f08d5, base dev 81c7fb951)

Which update: the picker's lazy install, transforms/picker.ts loadPicker -> slot.reconfigure(install(m)), a compartment reconfigure (reconfigured: true, no doc change, no selection). Found with a ring buffer in the page, flushed only on failure: it stores the raw transactions (no stringify while running), a MutationObserver on .cm-content, and performance.mark at every reconfigure site. A stringify in the hot path stopped the failures (0/250), the raw-reference version didn't. Reproduced on dev-01 under a cargo-build load: 21/150 and 9/60. Captured failure:

t=88.5  update  setHold effect (holdFor, before follow)
t=93.3  follow mark
t=94.8  line style -> transform: translateX(10px)
t=172.9 mark rc:picker
t=173.6 update  compartment reconfigure, reconf=true
t=177.4 .cm-content style rewritten; .cm-line style transform -> null

Both captured dumps with marks showed rc:picker (2 of 2 that survived tail); CodeMirror's updateInner locks the content height and sync rewrites every redrawn line's attributes, which is the wipe.

Gates (dev-01 x86 chromium, dev-02 aarch64 webkit):

  • touch-select.spec.ts:246 chromium-390 --repeat-each=150 under load: 150/150 (unfixed, probe build, same load: 21/150).
  • touch-select.spec.ts whole file --repeat-each=50 chromium-390 (dev-01): 800 passed.
  • touch-select.spec.ts whole file --repeat-each=50 webkit-390 (dev-02): 800 passed.
  • touch-select select-rows selector-fit chromium-1440 + chromium-390 (dev-01): 29 passed, 27 skipped (phone-only skips).
  • same, webkit-1440 + webkit-390 (dev-02): 28 passed, 28 skipped. There are no gestures* specs; touch-* is just touch-select.
  • svelte-check: 0 errors (19 warnings, none in these files); apps/web vitest 319 passed; packages/editor tsc clean and vitest 671 passed.
  • iPhone sim (own iOS 27.0 sim, iPhone 18 Pro, deleted after; app from this branch, real server, seeded note, via a localhost proxy): a one-finger swipe across "Plans for" selects the block (filled circle, tint, block bar). Shot taken after the finger lifted, not mid-drag, so this shows the pull and select still work on real iOS Safari, not the frame-by-frame follow.

Caveats: the server binary was the existing stab build (42c219afd) on dev-02 and one built from the probe commit on dev-01; Rust diffs from 42c219afd to base are refactors only, and the specs are frontend-only. dev-02 had 46 GB free (floor 50), so I did not build there. No perf ticket (see PR).

## Evidence for #1134 (PR https://git.kayg.org/kayg/calternal/pulls/1185, head d2e4f08d5, base dev `81c7fb951`) **Which update:** the picker's lazy install, `transforms/picker.ts` `loadPicker` -> `slot.reconfigure(install(m))`, a compartment reconfigure (`reconfigured: true`, no doc change, no selection). Found with a ring buffer in the page, flushed only on failure: it stores the raw transactions (no stringify while running), a MutationObserver on `.cm-content`, and `performance.mark` at every `reconfigure` site. A stringify in the hot path stopped the failures (0/250), the raw-reference version didn't. Reproduced on dev-01 under a cargo-build load: 21/150 and 9/60. Captured failure: ``` t=88.5 update setHold effect (holdFor, before follow) t=93.3 follow mark t=94.8 line style -> transform: translateX(10px) t=172.9 mark rc:picker t=173.6 update compartment reconfigure, reconf=true t=177.4 .cm-content style rewritten; .cm-line style transform -> null ``` Both captured dumps with marks showed `rc:picker` (2 of 2 that survived `tail`); CodeMirror's `updateInner` locks the content height and `sync` rewrites every redrawn line's attributes, which is the wipe. **Gates (dev-01 x86 chromium, dev-02 aarch64 webkit):** - `touch-select.spec.ts:246` chromium-390 `--repeat-each=150` under load: **150/150** (unfixed, probe build, same load: 21/150). - `touch-select.spec.ts` whole file `--repeat-each=50` chromium-390 (dev-01): **800 passed**. - `touch-select.spec.ts` whole file `--repeat-each=50` webkit-390 (dev-02): **800 passed**. - `touch-select select-rows selector-fit` chromium-1440 + chromium-390 (dev-01): 29 passed, 27 skipped (phone-only skips). - same, webkit-1440 + webkit-390 (dev-02): 28 passed, 28 skipped. There are no `gestures*` specs; `touch-*` is just touch-select. - svelte-check: 0 errors (19 warnings, none in these files); apps/web vitest 319 passed; packages/editor `tsc` clean and vitest 671 passed. - **iPhone sim** (own iOS 27.0 sim, iPhone 18 Pro, deleted after; app from this branch, real server, seeded note, via a localhost proxy): a one-finger swipe across "Plans for" selects the block (filled circle, tint, block bar). Shot taken after the finger lifted, not mid-drag, so this shows the pull and select still work on real iOS Safari, not the frame-by-frame follow. **Caveats:** the server binary was the existing `stab` build (42c219afd) on dev-02 and one built from the probe commit on dev-01; Rust diffs from 42c219afd to base are refactors only, and the specs are frontend-only. dev-02 had 46 GB free (floor 50), so I did not build there. No perf ticket (see PR).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#1134
No description provided.