Repository navigation
test(studio): the edit bench reads an undo once Studio says its reload is done - #8542
Conversation
Edit accuracy: accurate 271 (base branch 271), smooth 57 of thoseThe gate passes. Quarantined, measured but not gated (0) |
terencecho
left a comment
There was a problem hiding this comment.
The final undo and redo now wait for Studio's busy markers to clear across two frame reads before sampling the box. The new fields measure the remaining wait after each history walk. Per-step sampling and scoring stay as before.
The PR body names the regression. All 23 focused tests passed, and bypassing the wait made the new test sample the old box. The broader edit-accuracy run passed 125 of 126 locally. The same iframe initialization failure reproduced with the parent version of the changed harness file under the local Happy DOM setup. GitHub reports green checks at this head.
— tai (automated review)
What
The edit-accuracy bench now reads a sequence's final undo and redo only once Studio says the preview has finished changing. It records how long that took as
undo.shownMsandundo.redoShownMs. Before, under load, a sealed undo could read 240-329 px from where it landed: the box held still while the undo's reload was still on its way, and the bench took that still box as the result.Why
A sequence ends by walking its undos, then its redos, and measuring the box after each walk with
settled().settled()waits for the box to hold still, and for Studio's "preview changing" marker only in keyframed cases (swapPending,case.mjs). #4866 kept that keyframed-only on purpose: waiting in other cases made a later undo land in the preview's burst of requests.settle.test.mjspins that rule, and this change leaves it.On a sealed preview, an undo that can't be applied in place reloads the whole film. While that reload runs, the box doesn't move, so in a case without keyframes
settled()returned early.On the 12 sequences below, at 3 parallel jobs, 3 sealed and 3 unsealed runs alternating, the undo read off right after
settled()in:seqplainkeys-none-pct329 px twice,seqplainkeys-none-center240 px once). Each landed 0.6-2.1 s later.The sequence's commit step already waits for Studio this way before it measures (
restedFor(studioBusy)). The undo and redo walks now do the same.Related work
Refs #7846 (Studio's preview sealed by default): its edit-accuracy gate scores these sequences.
How
shownOnceRested(busy, frame, settle)insequences.mjswaits untilstudioBusyreads clear two frames in a row, through the existingrestedFor. It then returns the settled box and the ms until Studio was clear.settled(). The two times go into the case'sundoresult asshownMsandredoShownMs. Nothing scores them yet, so the gate doesn't change.settled(),swapPendingand every other step keep their timing.No visible change
Bench only; Studio doesn't change.
Test plan
fails without the fix:
packages/studio/tests/e2e/edit-accuracy/settle.test.mjs: "reads an undo's box once Studio says its reload is done, and how long that took". It also fails whenshownOnceRestedskips the wait.Every test under
packages/studio/tests/e2e/edit-accuracy(13 files, 126 tests) passes three runs in a row on Linux.