perf(apple): carry the readied simulator through open and drop the redundant post-boot waits
Merged
TH
14d ago+246+246+012345678901234567890123456789-75-75-01234567890123456789
Summary
open on a shut-down iOS Simulator waited for boot twice and listed devices once too often.
ensureAppleReadyreturns the readied device (booted: true), but open andprepareAppleRunnerdiscarded it. The runner'sensure_bootedthen ran a secondsimctl bootstatus -b(1.4-1.75 s).- After a successful
bootstatus -b(exit 0 only once boot completes), readiness ran anothersimctl list devices -j(~1.4 s). That listing is gone; deadline and cancellation checks remain. - The Apple lifecycle keeps the readied device per request and rebuilds its interactor binding after successful preparation. Open, runner prewarm,
prepare ios-runnerand nowclose(withensureReady) all receivebooted: true. Failed or cancelled preparation keeps the original binding.
8 files, 4 production.
Validation
- Tested commit
991ae15516, rebased onaa1b08ca4d:pnpm check:affected --runpassed (321 files, 2247 tests). - Reverting the two production files (
lifecycle.ts,readiness/runtime.ts) to main fails 8 of the new or updated tests. The runner-session stale-bundles test and the failed-preparation test pass on main too. - Live A/B on one iPhone 17 Pro / iOS 26.2 sim, alternating
mainand branch (shutdown,open com.apple.Preferences,click 'label="General"'), atce1e4a1e36. Round 1 excluded (unrelated runner rebuild); 4 paired rounds:- runner
test-without-buildingstarts 2.96 s sooner afterbootstatus(all rounds: -2.5 to -3.4 s); simctl launchstarts 1.42 s sooner;- median open→first-click -1.6 s, spread +0.2 to -5.0 s (XCTest attach time absorbs part of the gain).
- runner