perf(ios): skip runner uptime preflight after recent healthy mutations#763
Merged
Conversation
Reintroduces the #662 adaptive readiness-preflight skip with guardrails for the #702 failure modes. Recency is recorded only from healthy (non-runnerFatal) responses to an explicit mutating-interaction allowlist (tap, tapSeries, longPress, drag, dragSeries, swipe), scoped to the same appBundleId, capped at a 5s freshness window, and lives on the session object so it dies with every invalidation. Startup, no-recent-success, stale, app-switch, and non-allowlisted commands still preflight. A transport failure after a skip clears recency, carries the skip context through status recovery, and never routes into restart-and-replay. Closes #667
Size Report
Startup median (7 runs, lower is better):
Top changed chunks:
|
Member
Author
|
Non-blocking merge-order note: this allowlist is correct against current |
This was referenced Jun 11, 2026
|
thymikee
pushed a commit
that referenced
this pull request
Jun 11, 2026
#763 landed the healthy-mutation preflight skip with a note that the fused scroll command should join the allowlist once it exists. Add 'scroll' to PREFLIGHT_SKIP_ELIGIBLE_RUNNER_COMMANDS, drop the now-resolved code note, extend the per-family skip tests, and update the allowlist enumeration in ADR 0005 and the protocol-optimizations doc. https://claude.ai/code/session_01VokBZWESTDgcnbYwS4DkJo
thymikee
added a commit
that referenced
this pull request
Jun 11, 2026
…and (#760) * perf(ios): fuse scroll frame resolution and drag into one runner command Non-tvOS scroll now sends a single mutating 'scroll' runner command. The Swift runner resolves the interaction frame and executes the same non-synthesized drag path, eliminating the separate read-only interactionFrame request per scroll. The command is lifecycle-journaled with retained response JSON so lost-response recovery returns the result without replaying the gesture. Closes #668 * perf(ios): make fused scroll eligible for readiness preflight skip #763 landed the healthy-mutation preflight skip with a note that the fused scroll command should join the allowlist once it exists. Add 'scroll' to PREFLIGHT_SKIP_ELIGIBLE_RUNNER_COMMANDS, drop the now-resolved code note, extend the per-family skip tests, and update the allowlist enumeration in ADR 0005 and the protocol-optimizations doc. https://claude.ai/code/session_01VokBZWESTDgcnbYwS4DkJo * test: complete scroll plan parity vector mirror Address review on the cross-language parity vectors: - mirror the Swift pixels-plan vector (down, 120px @ 300x600) in the vitest suite so every vector exists in both languages - add amount > 1 clamp and tiny-frame (2x2) vectors to both suites; the tiny frame engages every max(1, ...) floor and the .5 rounding cases where JS half-up and Swift half-away-from-zero must agree https://claude.ai/code/session_01VokBZWESTDgcnbYwS4DkJo --------- Co-authored-by: Claude <noreply@anthropic.com>
thymikee
pushed a commit
that referenced
this pull request
Jun 11, 2026
Rebased onto main with #763 (healthy-mutation preflight skip) and #760 (fused scroll). Per the merge-order note, add 'sequence' to PREFLIGHT_SKIP_ELIGIBLE_RUNNER_COMMANDS so a successful sequence earns the next hot-command skip instead of always taking the conservative_command path. Extend the per-family skip tests and the allowlist enumeration in ADR 0005 and the protocol-optimizations doc. https://claude.ai/code/session_01VokBZWESTDgcnbYwS4DkJo
thymikee
added a commit
that referenced
this pull request
Jun 11, 2026
…eries (#764) * perf(ios): add lifecycle-safe runner sequence command for hot press series Adds a narrow 'sequence' runner command that batches an explicit allowlist of coordinate steps (tap, longPress, drag) into one lifecycle-tracked request with stop-on-first-failure and small bounded per-step results. iOS press series with hold/jitter now issue one sequence request per ~20-step chunk (also budgeted to stay under the runner's 30s main-thread watchdog) instead of one request per press. Sequence responses are journaled and retained, so lost-response recovery returns observed results without replaying the gesture sequence. Closes #669 * fix: perform every press in direct press series runDirectPressSeries guarded the awaited interaction itself with ??=, so presses 2..N were silently skipped once the first result was kept (affects Android series and doubleTap series; introduced in #512). The kept-first-result shape is preserved. * chore: unexport internal sequence chunk budget constant * perf(ios): make sequence eligible for readiness preflight skip Rebased onto main with #763 (healthy-mutation preflight skip) and #760 (fused scroll). Per the merge-order note, add 'sequence' to PREFLIGHT_SKIP_ELIGIBLE_RUNNER_COMMANDS so a successful sequence earns the next hot-command skip instead of always taking the conservative_command path. Extend the per-family skip tests and the allowlist enumeration in ADR 0005 and the protocol-optimizations doc. https://claude.ai/code/session_01VokBZWESTDgcnbYwS4DkJo --------- Co-authored-by: Claude <noreply@anthropic.com>
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.
Closes #667
What
Reintroduces the adaptive readiness-preflight skip from #662 — deliberately reverted in #702 — as a structurally narrower "healthy mutation recency" signal, now covering hot
tap/tapSeriesplus the coordinate-gesture families (longPress,drag,dragSeries,swipe).Why it doesn't reintroduce the #702 failure modes
#702 removed the original skip because unhealthy runners were cached as recently-successful. Each failure mode is now structurally addressed:
runnerFatalcheck. Snapshots, read-only responses, andrunnerFatalok-payloads never refresh it.RunnerSessionobject, which dies with every invalidation/restart. The first command after any restart always preflights.runnerReadinessPreflightFailed, so it can never enter restart-and-replay.appBundleIdto exactly match the recorded one; app switches preflight with reasonapp_activation_uncertain.Decision ladder reasons are exposed in diagnostics: used (
startup/conservative_command/no_recent_healthy_mutation/app_activation_uncertain/healthy_mutation_stale+ age), skipped (recent_healthy_mutation+ age), recovered (skip context restored in status-recovery diagnostics and lost-response hints, as in #662).ADR 0005 and
docs/ios-runner-protocol-optimizations.mdare amended in the same PR. Today's scroll verb is covered viadrag; the fusedscrollcommand from #760 should join the allowlist once that lands (noted in code).Validation (iPhone 17 Pro Max simulator, iOS 26.2)
Per-request diagnostics (
--debug), Settings app:startuprecent_healthy_mutation(age ≈ 210ms)interactionFramepreflights (conservative_command),dragskipshealthy_mutation_staleOne fewer runner request per hot command, zero
ios_runner_session_invalidatedevents, all interactions succeeded.pnpm typecheckclean; full iOS unit suite 287 passed (incl. new per-family skip tests, recency hygiene tests, and reintroduced perf: adapt ios runner uptime preflight #662-era status-recovery/lost-response-guidance tests);ios-lifecycleprovider integration 48 passed.