Repository navigation
presentations export: a picture is kept only from a frame drawn after its staging (tracker P4 (presentations, export)) - #329
Merged
Conversation
… its staging The Deck-actions case in e2e/presentations-export.spec.ts now and then found two identical PNGs among the three the all-slides export saves (four sightings in a week). A probe that ran that export 160 times on a hosted Mac (run 40805188367, master's code) caught 9: seven times slide-02 was byte for byte slide-01 (the body's picture showed the cover) and twice slide-03 was slide-02 (the hidden slide's showed the body), idle and under load alike. Each time the picture was the slide staged before: the export window copied its surface before the compositor had drawn the new staging. STAGE's two animation frames show only that the page has handed its staging to its compositor; the copy is of the frame drawn last. Each staging now draws a mark of its own (two colours in turn) along a row added below the window's 1920x1080, in the same task as its last change, and the capture copies the picture's rect down to that row and keeps it only when the row shows the mark, else copies again after the window's next paint; a window that has not drawn the staging in 10 s fails the export naming the slide rather than give a wrong picture. The staging also hides the viewport's scrollbars, which would lift the fixed mark off the last row (the review's finding, with "always" scrollbars). Every picture taken through the deck window gains this: the all-slides PNGs, PPTX pictures, the PDF's embeds, a design's PNG. Unit tests: a window whose compositor draws each staging 20 ms late gives cover, body, gone (master: cover three times), and one that never draws it fails naming the slide (master: resolves with the stale picture). The e2e case now checks each file shows its own slide, and on failure prints each file's name, the slide it was captured for, its sha256, size and what it shows. Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…n, within a bound Chromium's compositor now and then refuses a capturePage copy (it rejects with UnknownVizError): the merge-tree gate of #329 met it once at e2e/design-export.spec.ts:267 (run 40811348904, a flaky pass), and CI-opt's hosted flake row has it at :193 from before the staged copy. The browser view's still already copies again a frame later (src/main/browser/view.ts); the deck window did not, and stagedCopy can now take more than one copy per staging. stagedCopy asks again 16 ms after a refusal, at most four times, then fails the export naming the slide; any other failure of the copy is not retried. Unit tests: a window whose first copy is refused gives its picture on the second; one that keeps refusing fails after five copies naming the slide; another rejection fails at once. Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM
added a commit
that referenced
this pull request
Oct 29, 2026
…ly from a frame drawn after its staging, and asks again when the compositor refuses a copy) and PR #326 (comment-mode picks move until the frame hears them); tracker rows P4 (W) and P4 (presentations, export) closed, the hosted flake row's signature (5) with them Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
This was referenced Oct 29, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The flake and its cause
e2e/presentations-export.spec.ts, "the export entries under Deck actions save each format where the owner chooses", now and then found two identical PNGs among the three that PNG (all slides) saves (tracker row "P4 (presentations, export)"; sightings 40125301159, 40124518939, 40743240635, 40797738368).A throwaway probe, not in this PR, ran the all-slides export 160 times on a hosted Mac, half of them with every core busy, and classified each PNG by its top-left pixel. On master's code (40805188367), 9 of 160 exports were wrong, idle (4 of 80) and loaded (5 of 80) alike:
slide-02.pngwas byte for byteslide-01.png: the body's picture showed the cover;slide-03.pngwas byte for byteslide-02.png: the hidden slide's picture showed the body.Each wrong picture was the slide staged just before, so the window was copied before the deck had moved to its next slide. No two writes raced to one name. The export window is an offscreen BrowserWindow, and
capturePagecopies the frame the compositor drew last.STAGE's tworequestAnimationFrames show only that the page has handed its staging to its compositor, not that this frame has been drawn yet. The cover never shows the fault: the page as loaded already shows the cover on top.With this change, the same probe (40806676854) got 160 of 160 right.
The change (
src/main/presentations/export.ts)stagedCopycopies the picture's rect down to that row and keeps it, cut to the rect, only when the row shows this staging's mark. Otherwise it copies again after the window's next paint. A window that has not drawn the staging within 10 s fails the export, naming the slide, rather than give a wrong picture.scrollbar-width: noneon the root). With macOS's "always" scrollbars, an unclipped element could otherwise bring a horizontal scrollbar that lifts the fixed mark off the last row. The reviewer's Electron probe showed that would make a valid element export time out.Every picture taken through the deck window goes through this: the all-slides PNGs, the single PNG and
artifact_screenshot's slide, PPTX pictures and element fallbacks, the PDF's embed pictures, and a design's PNG and PDF embeds.A copy the compositor refuses (second commit, 93f01d5)
Chromium's compositor now and then refuses a
capturePagecopy: it rejects withUnknownVizError. The merge-tree gate (run 40811348904) met it once, as a flaky pass ate2e/design-export.spec.ts:236, failing at :267. CI-opt's hosted flake row has the same signature at :193 from before this change. The browser view's still already retries this (src/main/browser/view.ts); the deck window did not, andstagedCopymay now take more than one copy per staging.stagedCopynow asks again 16 ms after a refusal, at most four times, then fails the export naming the slide. Any other rejection fails at once.Tests
src/main/presentations/export.test.ts): a stand-in window whose compositor draws each staging 20 ms late. The three slides come back cover, body, gone; on master they come back cover three times. A window that never draws the staging fails, naming the slide; on master it resolves with the stale picture. Both new cases fail against master'sexport.tsand pass here. The drawn-offset case now checks the region of the picture, not of the copy.slide-02.png, the capture of slide body: sha256 7b2700baeab1…, … bytes, shows cover).Runs
On the head, 93f01d5:
e2e:designon the hosted Mac lane, three runs, each 19 passed with noflaky:line: 40812927732, 40813782435, 40814055771.e2e:presentationson the hosted Mac lane: 40812927709, 38 passed with noflaky:line.On the first commit (1023501), unless named otherwise:
export.ts.e2e:presentationson the hosted Mac lane, five runs, each 38 passed and 10 skipped with noflaky:line: 40807586667, 40808055109, 40809237836, 40809682777, 40810027141.pptx/picturestook 13.8, 17.7, 11.0, 18.0 and 13.7 s at loads 12 to 17, against 14.3 s at load 15 for master on a hosted Mac (40743240635). No measurable cost; the 55 s budget is far off.Review
doperpowers reviewer-medium on 816da78..3fa504c. Its one finding, P2 (the scrollbar case above, found with an Electron probe), is fixed in this head and has no test of its own: a hosted Mac's scrollbar setting cannot be forced from the e2e. doperpowers reviewer-low on the second commit (1023501..93f01d5): no findings.
Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)