Repository navigation
fix(ios): wait for host headroom before screenshot boot - #188014
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. What this changesThis PR checks host CPU headroom before creating each iOS screenshot simulator. Example: After eight iPhone and iPad screenshots, the host has only 7% idle CPU.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this maintainer-authored PR adds a focused mitigation through the existing readiness owner; the timeout diagnostic needs an actionable recovery instruction. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherFastlane owns serial screenshot simulator creation, capture, and cleanup; it now invokes qualification's shared CPU readiness helper before creating each device and records the phase through existing diagnostics. flowchart TD
A[Fastlane screenshot lane] --> B[Check simulator inactivity]
B --> C[Shared CPU headroom helper]
C --> D[Create and boot simulator]
D --> E[Capture screenshots]
E --> F[Shut down and delete simulator]
C --> G[Stop on headroom timeout]
Technical reviewBest possible solution: Retain the shared readiness check, make its timeout explain recovery, and complete the planned hosted acceptance. Do we have a high-confidence way to reproduce the issue? Current main demonstrably creates screenshot simulators without CPU admission, and the cited hosted capture job failed; this review did not reproduce a CPU-induced Watch shutdown or independently establish its cause. Is this the best way to solve the issue? Reusing the existing readiness owner is the smallest focused mitigation and preserves cleanup, exact boot-state checks, and capture assertions, but it does not establish why Apple terminated the earlier boot. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0b81496b64ab. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +4, Tests +17, Docs 0, Other +12. Total +33 across 6 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 29, 2026, 9:34 PM ET / October 30, 2026, 01:34 UTC. |
Closes #188012
What Problem This Solves
Screenshot capture can start a fresh Watch simulator while the host is still saturated after the phone/tablet captures. In CI 40981704279, all eight iPhone/iPad captures and their cleanup passed, but Watch boot ended during migration before installation. The runner had only 4–7% idle CPU around Watch boot. The same shutdown signature predates this branch (#172730); the precise Apple shutdown cause remains unknown.
User Impact
Before creating each screenshot simulator, require ten continuous seconds with at least 30% idle host CPU. A host that cannot meet that condition within five minutes fails before the next device starts. This is a contention mitigation. Both predeclared fresh hosted screenshot flows passed on their first attempts; the precise Apple shutdown cause remains unknown.
Why This Change Was Made
Reuse qualification's existing headroom helper through its native Node command-line entry point, within the existing simulator lifecycle owner. No new timer or readiness policy. Fresh devices, serial ownership, clean builds, exact
Bootedverification, cleanup, and all capture assertions remain intact. Boot and capture are not retried, and their deadlines are unchanged. The existing resource timeline recognizes the added headroom phase.Evidence
simulator created without CPU headroom. With the candidate, all 30 focused Fastlane, headroom, and resource timeline tests pass (1.20 s Vitest; 2.44 s complete wrapper). The lane fixture also proves that a Watch headroom timeout preserves the eight completed screenshots, starts no Watch simulator, and performs no installation.f126f05fd9521e2977f2b7921ff49522fde0b552: scoped-clean at P0–P2, no findings; complete Fastfile, shared helper, qualification caller and timeline supplied. Hosted ClawSweeper found one P3 timeout-message issue, now addressed with explicit recovery guidance. Its pending-hosted-proof observation is resolved by the results below.Hosted acceptance, recorded before candidate execution
Run the complete combined iPhone/iPad/Watch screenshot flow on two fresh hosted runners at the same candidate SHA: the normal PR screenshot job and the existing screenshot-only workflow operation. Require all nine PNGs, both phone/tablet native capture groups, successful Watch boot/install/launch/capture, and owned-device cleanup. Record each headroom duration and full result, including failures. A passing run is not proof of Apple's internal crash cause or a measured performance improvement. No release upload, production service changes, runner upsize, weakened assertion, or blind retry.
Completed hosted acceptance
Both predeclared runs passed at candidate
7a19f1f5098cfd3c99388cd089aca688ac0b8cefon fresh hosted runners, without retries. The PR job tested merge revisiond10f521563292ed3dc8265297aff5ebc06751e2a.27A9275) and pinned Node 24.22.1, proving the native Node entry point on the hosted runtime. Release upload and qualification jobs were skipped in the screenshot-only operation.ios-screenshots-40985114310-1,ios-release-screenshot-diagnostics-d10f521563292ed3dc8265297aff5ebc06751e2a, andios-release-screenshot-capture-d10f521563292ed3dc8265297aff5ebc06751e2a.74875a1899edchanges only the timeout text to tell operators to let competing host work finish or stop it, then rerun the screenshot lane. Seven headroom tests, focused type-aware lint, formatting, and diff checks passed after that wording change. Final-head PR CI settled with no failed or pending checks. The final revision also passed a third fresh PR screenshot capture and its screenshot-evidence check; the simulator implementation is unchanged from the two predeclared runs.This adds an intentional readiness wait; it is not a performance-speedup claim or proof of Apple's internal shutdown cause.