Repository navigation
test(studio): a slow frame no longer splits the edit bench's nudge burst into two saves - #8809
Conversation
…rst into two saves The bench pressed each nudge key, then waited for a frame. On CI the frame after the first nudge following a rotate can take 400+ ms (GPU-side), longer than Studio's 400 ms burst window, so the burst saved twice and the undo walk came up one short. The keys of a burst now go back to back through one helper.
Edit accuracy: accurate 273 (base branch 271), smooth 50 of thoseThe gate passes. Newly passing (2)
Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)
Quarantined, measured but not gated (0) |
vanceingalls
left a comment
There was a problem hiding this comment.
Approving at ac77ad94.
I read the diff and the three touched bench files. pressNudges is the only place the bench presses ArrowRight now; the other files in edit-accuracy/ have no arrow-key presses. The sequence nudge step, the single-nudge gesture and the blank-page control all go through it, so they keep one pace. The text-typing step keeps its frame-per-key pace.
The new test in saves.test.mjs uses a page whose frame is 450 ms, longer than CANVAS_NUDGE_COMMIT_DEBOUNCE_MS. It would fail on the old frame-per-key pace, since the keys would land about 900 ms apart. That matches the "fails without the fix:" line in the body.
This changes how the bench presses keys, not Studio. The product still saves a burst once it has had no key for 400 ms, so two keys more than 400 ms apart are still two undo steps. I think that is right for a person pressing keys, since they don't wait for frames. If you want to know whether a slow frame in Studio should be able to split a real user's key-repeat burst, that is a product question and a follow-up, not a blocker here.
The author notes that the sealed-mode pct-nested reload 3.02 px with 2 saves is a different failure and still open. That is not caused by this PR.
All checks are green on this head, including the edit accuracy shards.
|
Bench runs with this branch's pace, as promised in the body. pr grid, Studio built at main
Every one of these runs had 2 saves in each Run 3's two failures are An earlier build (main |
What
The edit accuracy bench presses the keys of one nudge burst back to back, so a slow frame between two keys no longer splits the burst into two saves.
seqrotatenudge-*cases stop failing undo and reload on a run where the frame after the first nudge is slow.Why
The gate has reported
seqrotatenudge-none-center-r0-root-z100andseqrotatenudge-none-pct-r0-nested-z100as Unstable on several PR heads (#8784, #8787, #8794, #8801). One run of three failed with reload 3.03 px and undo false. The other two passed. CI's gate runs the default (unsealed) preview.The bench pressed a nudge key, waited for a frame, then pressed the next. Studio saves a burst once it has had no key for
CANVAS_NUDGE_COMMIT_DEBOUNCE_MS(400 ms,packages/studio/src/components/editor/domEditNudge.ts). In the failing runs, the frame after the first nudge key took 422 ms (#8801) and 397 ms (#8784). So the second key came after the burst had already saved, and the 3 nudges saved twice. From the shard artifacts:With 3 saves, the sequence's two undos leave the rotate's save in place. That gives different bytes on undo, and the reloaded box keeps the rotation without the nudges, 3 px from where the steps left it.
The slow frame is GPU-side. A trace of the nudge step on the devbox shows a 91 ms task on the GPU main thread, plus ANGLE shader-compile work, inside a 111 ms frame. Studio's page ran 18 ms of script in that frame. It appears on the first nudge after a rotate, and not in
nudge-*orseqnudge-*cases. A person's keys don't wait for frames, so two keys 400+ ms apart being two undo steps is Studio working as designed. The bench's pace was wrong.Related work
Refs #8784, #8801 (PR heads whose gate reported the Unstable rows).
How
case.mjs:pressNudges(page, count)presses the burst's keys back to back, then waits one frame. That last frame is the one each caller had after the burst's final key.pressNudgesis now the only code that presses nudge keys. The sequence's nudge step, the single-nudge gesture and the blank-page control all call it, so they keep the same pace.grep -n ArrowRightovertests/e2e/edit-accuracy/*.mjsfinds only the helper.Test plan
fails without the fix:
packages/studio/tests/e2e/edit-accuracy/saves.test.mjs"presses every key inside Studio's burst window, however slow a frame is" fails on the old pace (a frame wait between keys) withexpected 900 to be less than 400. It uses a page whose frame takes 450 ms.npx vitest run tests/e2e/edit-accuracy/inpackages/studio: 13 files, 131 of 131, three runs in a row.The mechanism, on the devbox with main
fbdfd188c4built (the sixseqrotatenudge-*cases, the page-side time of each nudge keydown logged):The 450 ms wait stands in for the slow frame. It gives the CI failure exactly, in both modes.
Still open, not this change: in one of the 18 sealed runs,
seqrotatenudge-none-pct-r0-nested-z100had reload 3.02 px with 2 saves and undo true. That's a different failure, still being looked at.Not run yet: the bench with this branch's pace. Runs of the nudge cases in both modes, and the full pr grid sealed three times, follow in a comment.
No visible change