Repository navigation
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 maintainer review before merge. What this changesThis PR checks iOS screenshot readiness immediately before entering the existing fallback waits. Example: The chat screenshot launch already exposes RootTabs.Ready with value ready:chat.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open; the focused change preserves readiness guarantees, and no actionable code defect was found. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe XCTest screenshot harness launches each requested app destination, checks its accessibility readiness marker and destination anchor, then passes capture to Fastlane. flowchart TD
A[Screenshot command] --> B[Fastlane capture lane]
B --> C[Independent XCTest app launch]
C --> D[Readiness checks and fallback waits]
D --> E[Destination anchor assertion]
E --> F[Screenshot capture]
Technical reviewBest possible solution: Retain the minimal checks in the existing launch owner only if the declared experiment demonstrates faster capture with every readiness and image check preserved. Do we have a high-confidence way to reproduce the issue? Source confirms redundant wait invocation when readiness is already satisfied, but its runtime cost has not been established by completed measurements. Is this the best way to solve the issue? The patch is the smallest focused approach: it uses the existing launch owner, keeps both fallback deadlines, and adds no state, helper, or competing capture path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ebb10c7f6855. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +2. Total +2 across 1 file. Added test files: 0. View PR surface stats
LabelsLabel changes: No label 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 31, 2026, 1:08 AM ET / 05:08 UTC. |
What Problem This Solves
iOS release screenshots poll for root readiness even when the requested screen is already ready.
User Impact
No app UI changes. Screenshot capture can avoid redundant readiness polling while retaining every readiness condition, destination anchor, independent app launch, and capture.
Why This Change Was Made
Check each readiness condition immediately before entering its existing fallback wait. Preserve separate eight-second appearance and ready-value deadlines, including the non-screenshot launch path. Fastlane idle and animation waits remain unchanged.
Maintainer-requested continuation of the screenshot performance work in #188927. Screenshot-only experiments below do not qualify or upload a release. Do not merge until the measurements are complete.
Evidence
git diff --check: passed.empty_count,file_length, andtype_body_lengthviolations on the pristine base and candidate. No suppressions added.95b5fa5fb78d1c39c0bd364ee3dc9f37a1750c1cthrough the final local patch, P0–P2: scoped-clean, no actionable findings. Local ClawSweeper was unavailable because its structured result contained an unsupportednextStepkey; hosted ClawSweeper reviewed head63db213a65d5ccdcc563c5e6fefb32ec9082f76awith no actionable findings.Measurement rule (declared before the first experiment)
Workload: committed
pnpm ios:screenshotsthrough the existing screenshot-only workflow, onxcode-27-xlarge, diagnostics timeline and startup probe disabled, host indexing disabled by the existing disposable-runner step. Freeze baseline at95b5fa5fb78d1c39c0bd364ee3dc9f37a1750c1cand candidate at this PR's original head. Both experiment refs receive identical workflow-only log/result retention, excluded from this PR.Screen one baseline/candidate pair, then, if promising, collect at least five samples per arm serially in ABAB order. Each sample uses a fresh hosted runner, fresh build, and fresh serial simulators. Do not mix warm repeats into the comparison.
Primary metric: sum of eight root-admission intervals, from the foreground-app wait to the first destination-anchor wait in the XCTest trace. Accept at least eight seconds lower median summed root-admission time, with all eight independent app launches, all assertions, and all nine iPhone/iPad/Watch images successful. Combined device-capture median must improve; per-device capture median and p95 must hold or improve. Report median, nearest-rank p95, range, complete capture-step wall time, attempt counts, and available host/resource identity. Investigate any metric worsening by 20% before proceeding. Root timing alone does not establish whole-pipeline savings. Revert the candidate if it has no measurable gain or weakens capture.
Preliminary screen results
testReleaseChatScreenshotat the preserved Mermaid button assertion. The other three iPhone tests passed; iPad/Watch were not reached. Root checks passed. The recording shows rendering in progress followed by the retryable fallback rather than a completed diagram. No complete candidate timing or speedup is claimed.xcode-27-arm64/20261026.0314.1; baseline observed five logical CPUs, 14 GiB RAM, Xcode 27.1 (27A9275). End-of-capture host snapshots are retained in the run logs.f75786ca75eb279d3b7e46642855cfd9aa058e6ahas byte-identical complete screenshot-test and renderer files to this PR's pristine base. The native root waits were still unconditional. This establishes the pre-existing symptom; the renderer's internal error remains unknown.Replication campaign (declared before its first run)
The initial screen is inconclusive for complete capture time because the candidate failed with the independently verified pre-existing renderer symptom. Start a separate cohort of five full baseline/candidate pairs, serially in ABAB order, using the same two frozen refs, workload, hardware, cold-runner conditions, and original acceptance thresholds above. Report this cohort separately from the initial screen and the iPhone-only diagnostic. Stop on another capture failure for investigation; do not replace failed cohort samples with successful replays. Retain all attempt outcomes and report known residual renderer risk separately from latency measurements. The temporary renderer tracer is excluded from both benchmark arms and this PR. No code or timeout was changed in response to the failure.
No app uploads or merges are authorized in this campaign.
Replication outcome: stopped after the first pair
Readyand oneDeleting, both withmountedPathExists: false. The existing safety guard at Fastfile line 294 rejected multiple registrations before deletion/download or Watch simulator creation. That repair function is byte-identical in baseline, candidate, and current main. This identifies the failing condition; it does not establish why the runner acquired duplicate registrations or rule out timing exposing the existing lifecycle defect.xcode-27-arm64image20261026.0314.1, Xcode 27.1 / 27A9275, five logical CPUs, and 15,032,385,536 bytes (14 GiB) RAM.The following are descriptive single-pair iPhone/iPad measurements from an incomplete cohort, not accepted full-workload medians or p95 estimates. The failed candidate is excluded from successful full-workload statistics.
All eight candidate root checks took the immediate path with no appearance/value polling waits, saving 17.78s in this pair. Overall iPhone capture was nevertheless 9.03s slower. No end-to-end speedup is claimed from a workflow that stopped before Watch.
The campaign stopped as declared: one successful baseline, one failed candidate, no replacement samples, no further dispatches. Five successful samples per arm, per-device median/p95 acceptance, and a complete candidate nine-image run remain unproven. Stabilize the observed Watch runtime lifecycle before spending more full-capture benchmark runs; retain the failed cohorts separately in any future comparison. The readiness patch is unchanged, PR CI remains green, and this PR remains unmerged.
Runtime-fixed replication cohort (declared before its first run)
The separate Watch runtime lifecycle fix is merged in 189217, with a passing long scanner-survival probe and all nine images through the production screenshot lane. The earlier failed cohorts above remain separate and are not replaced or counted as successful samples.
Freeze both new arms on merged base
07ec4dc256bda86b972462c360f47b48e3b29434:4bb9edd1ffa1cacada27b445c3624984c0278b89(bench/ios-readiness-fixed-baseline).4e0ee9955224a5b91a050c68e620df242ba6c629(bench/ios-readiness-fixed-candidate).The arms contain identical runtime fixes and workflow-only evidence retention/host snapshots. Their only difference is this PR's immediate root-readiness checks. Keep the same committed
pnpm ios:screenshotsworkload,xcode-27-xlarge, fresh hosted runners/builds/serial simulators, disabled resource timeline/startup probe, and existing disposable-runner indexing policy.Collect five full baseline/candidate pairs serially in ABAB order. Retain every run receipt and outcome. Stop on a capture failure, changed image inventory/runner image, or a metric regression of at least 20%; never substitute green replays for failed samples.
Keep the original acceptance rule: at least eight seconds lower median summed root-admission time across eight independent launches; improve combined device-capture median; hold or improve per-device median and nearest-rank p95. Require all assertions, nine PNGs, first attempts, and at most one active simulator. Report counts, median/p95/range and complete capture-step wall time. No release uploads. Performance qualification is pending; this PR remains unmerged.
Runtime-fixed pair one: regression investigation
After this investigation, continue the remaining preregistered pairs from the same ledger and frozen heads. Preserve this slower candidate in every final statistic. No code, timeout, sample, final acceptance threshold, or regression alarm is changed. Any new regression alarm stops dispatch for investigation. The final five-pair acceptance still requires combined median improvement and no per-device median/p95 regression; this single pair does not qualify the PR.
Second baseline 41197676096 also succeeded with all nine images, first attempts, eight independent launches/terminations, and serial simulators. Root admission: 19.53s; iPhone/iPad capture: 126.12s / 140.37s; combined: 266.49s; complete capture step: 755s. Runner identity is unchanged. The controller stopped again because the previously investigated candidate remains above the iPad and complete-step alarm thresholds. This adds a second baseline observation, not a second candidate regression. Retain all three samples and continue to the second candidate after rechecking that the alarm is still driven by the same investigated run. Final acceptance remains unchanged and unproven.
Second candidate 41199075241 succeeded with all nine images, first attempts, eight independent launches/terminations, serial simulators, and the same runner identity. Root admission: 4.04s; iPhone/iPad capture: 111.68s / 122.87s; combined: 234.55s; complete capture step: 768s. Relative to the second baseline, combined device capture fell 31.94s and root admission fell 15.49s. Across both retained pairs, however, combined capture median remains 5.96% slower (253.09s baseline versus 268.165s candidate), and final acceptance is unproven. The controller again stopped on the previously investigated first candidate's iPad p95; the second candidate introduced no new maximum. Continue the remaining three pairs after this check, retaining the slow first candidate and unchanged final acceptance.
Third pair: baseline 41200630826 and candidate 41201812363 both succeeded with all nine images and unchanged capture invariants/runner identity. Baseline/candidate: root admission 19.06s / 1.83s; combined capture 266.26s / 250.40s; complete capture step 774s / 794s. At three samples per arm, root medians are 19.53s / 4.04s (15.49s saved); combined capture medians 266.26s / 250.40s (5.96% lower). Per-device worst cases still regress, and complete-step median is 39s slower. The alarm remains the already investigated first candidate's 962s complete step; no new candidate maximum appeared. Keep all samples and unchanged acceptance while collecting the final two pairs. Performance qualification remains incomplete.
Fourth pair: baseline 41202962704 and candidate 41204133914 both succeeded with all nine inspected images, first attempts, eight independent launches/terminations, serial simulators, and unchanged runner identity. Baseline/candidate: root admission 20.38s / 2.90s; iPhone capture 125.03s / 147.46s; iPad capture 116.74s / 155.76s; combined capture 241.77s / 303.22s; complete capture step 790s / 930s.
The controller stopped again before the final pair. This candidate adds a new combined-capture and iPhone maximum. Investigated its paired 61.45s combined increase: 41.23s additional capture overhead outside the suites, 25.09s additional pre-root time, 12.61s additional post-root time, offset by 17.48s saved in root admission. Build time was 1.89s lower; boot/inventory across all devices was 52.79s longer, principally the iPad phase (58.96s versus 101.03s). These traces locate the extra time but do not establish its underlying cause or rule out timing interactions. All eight candidate root checks used the immediate path. No assertions, source, timeouts, samples, or thresholds were changed. Retain both slow candidate observations. After this investigation collect the final preregistered pair; at four pairs combined-capture median is 8.69% slower and qualification remains unproven.
Runtime-fixed outcome: failed qualification
The controller stopped after final baseline 41205573885. Five baseline and four candidate samples were collected, in ABABABABA order. No fifth candidate was dispatched. Every run succeeded with all nine inspected images, first capture attempts, all eight independent app launches/terminations and assertions, and at most one active simulator. That is 72 passing screenshot tests and 81 expected PNGs. The frozen source and exact image inventory were verified for every run. No uploads or release qualification occurred.
Times below are seconds. Nearest-rank p95 equals the observed maximum at these sample counts; this is a small descriptive dataset, not a precise population-tail estimate. All slow samples are included.
Root-admission median falls 16.06s, exceeding the eight-second component target. The full acceptance rule nevertheless fails: combined capture median is higher; both per-device medians and p95s are higher; complete capture-step median is 107s higher. This does not establish that the readiness patch causes all of the additional time. The two slow-candidate investigations above locate substantial time outside root admission but do not determine its underlying cause. No whole-pipeline speedup is claimed.
The final baseline makes rejection conclusive without another hosted run. With the four retained candidate combined times sorted as 234.55, 250.40, 301.78, 303.22, even adding a zero-second fifth candidate gives a 250.40s median, above the final baseline median of 244.32s. At n=5, nearest-rank p95 remains the maximum: adding a fifth candidate cannot lower the existing iPhone 147.46s or iPad 171.47s maxima below baseline 126.12s / 142.98s. The full-step candidate p95 also cannot fall below 962s versus baseline 790s. The prescribed five-sample positive qualification is not claimed; the stopped experiment already cannot satisfy its unchanged thresholds. No sample was removed, replaced, retried, or reclassified as a passing qualification.
All nine runs report runner image
xcode-27-arm64/20261026.0314.1, Xcode 27.1 /27A9275, macOS 27.0.1 /26A434, five logical CPUs, and 15,032,385,536 bytes (14 GiB) RAM. Before/after host snapshots report no swap traffic. High end-of-capture load alone does not identify starvation. Startup/resource probes remained disabled. Queue waits are excluded from measured capture times.The experiment is stopped, no comparison run remains active, and this PR remains open and unmerged. The separate Watch runtime repair is already merged; these results add nine successful full-capture executions of that runtime-fixed source.