Repository navigation
Hold the simulator's settled capture until an armed autopause lands - #1235
Merged
Merged
Conversation
The `player` screenshot scene failed two runs of three at 287f19a (no `simvideo: first picture decoded`, no `autopause: Pause accepted`). Its settled capture fired on a player that was still loading: the capture's quiet is wall clock, `autopause` cannot even arm until six seconds into the run, and on a busy host the debug simulator runs a frame a second with a main-thread hang of seconds when Play starts, so the first tick after the stall finds the screen unchanged for longer than the quiet and photographs a picture-less, un-paused player. `ScreenshotArms::pending` held the capture for every other armed edge (libtype, libgrid, libshelf, libmenu, clockstop) but not this one. `autopause` now owes the capture its Pause: the debt is read once, held from the first frame (an unread trigger counts as owed, as an unread `clockstop` does), and paid when the Pause lands. A 60 s ceiling stops a Pause that never lands from holding the capture back for good; the arm logs `autopause: gave up` and the scene fails on its `expect` lines. The debt is kept current in `each_frame` before the arms that can return early. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ceiling prose The line that holds the frames before the arm arms itself was untested: both tests passed edges_left in by hand, so dropping `!sc.pause_tried` reintroduced the flake with both green. It is now a pure `pause_edges_left`, with a test that fails without that clause. The comment on `autopause_debt`'s call gave a false reason for its placement: detail_arm, collection_arm and play_arm each set their latch before returning false, so each returns false on at most one frame and that frame skips `shot::tick` too. The module doc's "every arm gives up after CEILING_MS" now names the two arms that wait up to a minute. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
What failed
The macOS simulator's
playerscreenshot scene was flaky: 4 to 5 of 10 runs failed, capturing a player with no picture and no pause.Cause
The settle rule
shot::settled_due = !busy && age >= 2000ms && quiet >= 1500msholds the capture whileScreenshotArms::pending()is true, butpending()ignored the scene'sautopausearm.autopause_armcannot fire until 6 s after boot (on the Player route), and the scene's Pause lands about 14 s in. So a quiet 1.5 s while the player loads settled a frame with no picture and no pause.Log signature: failing runs settled 2.0 to 3.5 s after the first frame with no
simvideo: first pictureand noautopause: Pause accepted; passing runs settled 13.7 to 16 s in with both.Fix
ScreenshotArmsgains aPauseDebt(Unread/Owed/Paid), counted inpending().autopause_debtkeeps it current fromeach_frame.pause_triedunset), and while it is armed and waiting on its playhead. That mapping is a small pure function,pause_edges_left(pause_tried, script_armed).AUTOPAUSE_CEILING_MS, besideclockstop's) stops the hold so a scene whose playhead never arrives fails on itsexpectlines, withautopause: gave up; the pause never landedin the log, instead of on the driver's timeout. The module//!now says which two arms wait up to a minute rather thanCEILING_MS.hostsim); nothing changes on the television.Evidence
tools/screenshots.pyrun exited 0.pending()clause removed.make test-hostsim T=autopause:test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 1324 filtered out(the third isautopause_stays_owed_on_the_frames_before_its_arm_arms_itself).not armed yet: the Pause is still to come, 2 passed, 1 failed) when!pause_triedis dropped frompause_edges_left, and passes with it restored.bash ci/check-deps.sh: all gates green.python3 ci/check-module-layers.py: green.Not covered
shot::tickreadsLAST_CHANGEbefore that iteration'sshould_presentrecords it, so "quiet" can span a long main-thread stall in scenes no arm holds (for examplefailure).🤖 Generated with Claude Code