Skip to content

improve: reduce iOS screenshot preparation delays - #188927

Merged
joshavant merged 3 commits into
mainfrom
perf/ios-screenshot-host-indexing
Oct 31, 2026
Merged

joshavant merged 3 commits into
mainfrom
perf/ios-screenshot-host-indexing

Conversation

@joshavant

@joshavant joshavant commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

iOS screenshot runners can spend substantial time waiting for CPU headroom between fresh simulators.

User Impact

Reduces the measured simulator preparation cycle on disposable hosted runners. Normal CI capture, screenshot-only runs, and Store/TestFlight release capture use the same host Spotlight setting already used by release qualification. Local commands leave host indexing unchanged.

The optional startup_probe diagnostic keeps indexing enabled because its Spotlight experiment needs indexed positive controls. Existing runner sizes, deadlines, checks, screenshot inventory, and release admission remain unchanged.

Why This Change Was Made

Disable host indexing before checkout rather than changing simulator behavior, adding caches, or relaxing headroom checks. The production change is three existing-command workflow steps; temporary accounting scripts and benchmark inputs are excluded.

Evidence

Acceptance rule agreed before the experiment: five interleaved fresh-runner baseline/disabled samples at one fixed source revision and runner class; lower median and tail total-cycle time with all existing checks passing, followed by a successful full screenshot capture. The total includes the final headroom wait after iPad cleanup.

All 10 samples passed all 25 commands, exclusivity assertions, cleanup, and final headroom. Each used 17d465f42d01b6075247d34feae64045c7b4ff5d, xcode-27-xlarge with 5 available CPUs, image xcode-27-arm64 version 20261026.0314.1, macOS 27.0.1 (26A434), and Xcode 27.1 (27A9275). Both release jobs were skipped. Resource timelines and stack sampling were disabled.

Total simulator cycle Baseline Host indexing disabled
Median 336.5s 226.5s
Observed p95 (linear interpolation, n=5) 376.9s 239.1s
Minimum 196.4s 195.8s
Maximum 380.1s 240.4s

Median improved 32.7%; the slowest observed cycle improved 36.7%. Five samples per condition do not establish a reliable long-term tail estimate. Ranges overlap. This measures the stock simulator cycle, not whole screenshot-pipeline runtime, and does not identify the precise external service responsible.

Most savings came from waiting for headroom: median combined headroom waits fell from 132.0s to 36.0s. Active command totals slightly regressed (180.2s to 186.9s median). In particular, the first iPhone inventory median rose from 25.6s to 29.6s, and the later iPhone status-bar median rose from 1.1s to 3.8s. The complete table below retains these regressions; the accepted primary metric is the complete cycle with safety checks preserved.

All interleaved runs and phase timings

Dispatch from the frozen benchmark branch with operation=screenshots, alternating spotlight_mode=baseline and disabled, and resource_diagnostics=false, startup_probe=false. The committed workload is scripts/ios-simulator-accounting-probe.py at the benchmark SHA.

Pair Baseline Disabled
1 282.7s 195.8s
2 336.5s 221.0s
3 196.4s 233.6s
4 364.1s 240.4s
5 380.1s 226.5s

Phase p95 values use the same linear interpolation across five observations.

Phase Baseline median Disabled median Baseline p95 Disabled p95
resolve-simctl 0.993s 0.965s 1.193s 1.018s
initial-inventory 0.998s 1.282s 1.238s 1.520s
iphone-idle 0.141s 0.133s 0.178s 0.139s
iphone-headroom 26.145s 10.126s 26.187s 10.213s
iphone-create 0.255s 0.249s 0.278s 0.254s
iphone-boot 39.559s 39.920s 47.784s 40.661s
iphone-fresh-inventory 25.628s 29.616s 32.450s 39.185s
iphone-fresh-status-bar 11.979s 11.557s 24.572s 13.677s
iphone-later-inventory 2.787s 2.781s 8.397s 3.416s
iphone-later-status-bar 1.062s 3.796s 1.739s 13.700s
iphone-shutdown 3.724s 3.932s 4.288s 9.446s
iphone-delete 0.213s 0.180s 0.433s 0.436s
iphone-cleaned-up 0.184s 0.173s 0.436s 0.279s
ipad-idle 0.201s 0.197s 0.487s 0.465s
ipad-headroom 90.469s 14.423s 101.258s 20.769s
ipad-create 0.282s 0.339s 0.325s 0.498s
ipad-boot 34.255s 34.102s 35.712s 35.435s
ipad-fresh-inventory 19.345s 19.462s 31.103s 35.019s
ipad-fresh-status-bar 20.486s 17.672s 29.139s 31.300s
ipad-later-inventory 5.273s 2.218s 12.361s 16.572s
ipad-later-status-bar 2.336s 1.964s 14.699s 4.962s
ipad-shutdown 4.391s 3.907s 15.326s 5.655s
ipad-delete 0.203s 0.172s 0.427s 0.198s
ipad-cleaned-up 0.192s 0.170s 0.271s 0.179s
final-headroom 18.270s 11.150s 57.891s 11.440s

Native accounting covers the command and waited-for descendants, excluding external CoreSimulator services. Median accounted CPU was 4.60s baseline versus 4.62s disabled; maximum command RSS was approximately 104 MiB in both. No swaps or block I/O were charged to these commands. These counters do not establish total host CPU, memory, or I/O savings.

Local checks: workflow lint/actionlint/zizmor and formatting passed. The required macOS workflow batch passed (1,034 tests, 10 existing skips; 314.96s total). The focused release-qualification file passed all 96 tests (2.63s wall); its added assertion first failed on the unconditional candidate and passed after exempting the existing diagnostic. Type checking, test-file lint, and the test-line ratchet passed. The 16-line allocation covers the diagnostic contract and the existing source-before-credentials contract, with no new test process or case.

Initial PR CI exposed a test that assumed checkout must be the first release step. Runner setup now precedes checkout, so the test locates checkout by its action identity, exercises the following source-verification shell step, and explicitly verifies that credential-bound steps follow verification. The failure reproduced locally; all 23 mobile-release CI tests then passed (18.12s wall), along with the matching scripts test typecheck, file lint, formatting, and test-line ratchet.

Full screenshot-only capture passed on 7e19257efd914d8edb279d098353ab2dba3204e5: all four iPhone images, all four iPad images, and the Watch image were retained as valid PNGs. The existing capture receipts record successful first attempts for iPhone/iPad; every build/capture/cleanup phase succeeded and recorded one active simulator during capture and zero after cleanup. The capture step took 13m23s; this is a correctness check, not a before/after whole-pipeline speedup claim. Images and diagnostics artifact expires November 14.

Subsequent commits exempt startup_probe=true, add its regression/documentation, and repair the source-admission test. This run used startup_probe=false, so its executed preparation and capture path is unchanged. Qualification and release/upload jobs were skipped; no app was uploaded.

Independent AutoReview completed scoped-clean at P0–P2 on the complete local patch from base 0b1cd5f1d4dd392db586260ade21b43a955e2579, including the source-admission repair subsequently committed as final head 19b6645ff058a57843c34f820a3955f3cac5c13a (correctness confidence 0.96). Local ClawSweeper failed twice on the same structured-output schema error; its first response identified the diagnostic interaction, which was fixed and tested. Neither failed attempt is counted as a completed review. The documented AutoReview fallback supplied the valid independent assessment.

Final-head PR CI passed on 19b6645ff058a57843c34f820a3955f3cac5c13a, including the repaired source-admission shard. The native exact-head watcher reported GREEN; the separate final gate publisher also succeeded.

@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@joshavant
joshavant marked this pull request as ready for review October 31, 2026 01:29
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: XS labels Oct 31, 2026
@joshavant
joshavant merged commit 9f14244 into main Oct 31, 2026
123 of 124 checks passed
@joshavant
joshavant deleted the perf/ios-screenshot-host-indexing branch October 31, 2026 01:53
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
* improve: reduce iOS screenshot runner contention

* fix: preserve Spotlight diagnostic controls

* test: verify release source before credential access
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant