Only fail the settle loop on observed motion, not starvation#148
Merged
Conversation
Under CPU starvation (a cold, loaded CI runner) a single settle pass (16ms sleep + layout + quarter-res render) can cost over a second, so the three passes stability needs don't fit the 2.5s budget and settleContent failed static content as "Snapshot content never settled" — ~50% of cold CI runs on the About screen, whose capture still matched its reference. Reproduced locally by duty-cycling SIGSTOP/SIGCONT on StuffTestHost (1.4s stopped / 0.12s running). The budget now bounds *observed motion*: .timedOut requires a change seen past anchor establishment, a change-free loop keeps running until it can prove stability, and a hard cap at 4x the budget gives up as the new .starved outcome naming the pass count. Deadlines measure with ContinuousClock (closing that TODO), and settle failures now name the full snapshot identifier via renderSnapshotImage(of:named:...), so a timeout in a 16-image matrix says which configuration. Verified: the same duty-cycle starvation that produced four settle timeouts now runs the About suite green (103s, every capture extended past its budget and still matched the reference), and the full StuffSnapshotTests scheme passes unstarved. New SnapshotRenderingSupportTests pin all three ending conditions. Co-authored-by: Cursor <[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.
Summary
Snapshot content never settledfromSnapshotRenderingSupport.swift:38) that hit the About suite on cold, loaded runners — including the red run on Drop the stale WhereCore dependency from StuffTestHost #144, which was this flake, not that branch's changes.StuffTestHost(1.4s stopped / 0.12s running); post-timeout frames were byte-identical, and the captures still matched their references..timedOutrequires a change seen past anchor establishment; a change-free loop keeps running until it can prove stability, giving up only at a hard cap of 4× the budget with a new.starvedoutcome naming the pass count (an environment failure, not view motion). Genuinely moving content still fails at the budget exactly as before.renderSnapshotImage(of:named:...)), so a timeout in a 16-image matrix says which configuration — the gap that made the CI failures undiagnosable from the result bundle.ContinuousClock, closing that P2 in the moduleTODOs.md; docs (README.md,AGENTS.md,TODOs.md) updated in the same change.Test plan
SnapshotRenderingSupportTestspin all three ending conditions: starved-but-static settles (pre-fix code always failed this), observed motion times out at the budget, unsampleable content ends.starvedat the hard cap.SnapshotKitTestingTestsbundle green on the checkout simulator.StuffSnapshotTestsscheme green unstarved (no behavior change for healthy runs)../swiftformat --lintclean.Made with Cursor