perf(ios): add lifecycle-safe runner sequence command for hot press series#764
Conversation
Size Report
Startup median (7 runs, lower is better):
Top changed chunks:
|
|
CI is not review-ready yet: Fallow reports one unused export in
This should either become a local constant if only |
|
Non-blocking merge-order note with #763: once the healthy-mutation preflight skip lands, This command is deliberately a lifecycle-tracked mutating interaction and, after a successful sequence, it is exactly the kind of recent healthy runner response that should earn the next hot-command skip. If #763 merges first, please rebase this PR and add |
0a29352 to
1982104
Compare
…eries 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
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.
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
1982104 to
c1d5817
Compare
|
Closes #669
What
Adds a narrow, lifecycle-tracked
sequencerunner command that batches an explicit allowlist of coordinate steps (tap,longPress,drag) into one runner request, and routes the iOS hold/jitter press series through it.buildRunnerSequenceCommand/validateRunnerSequenceSteps(newsrc/platforms/ios/runner-sequence.ts), and the Swift runner rejects non-allowlisted kinds/missing coords withINVALID_ARGSbefore executing anything. Non-fuseable inputs (count=1, Android, doubleTap, tapSeries-eligible, selector presses) keep their existing paths.ok:true+failedStepIndex+ per-step results), so the journal recordscompletedand retains the small payload — lost-response recovery returns observed results without replaying the gesture sequence. In-flight/failed states follow the existing no-replay semantics. Sequence is mutating (not inisReadOnlyRunnerCommand): single-send, conservative recovery.press --count 20 --hold-ms 1500splits instead of tripping the watchdog mid-execution). Worst-case retained response stays far below the journal's 16KB cap (asserted in Swift tests). Ordering is preserved; execution stops at the first failed step; cross-chunk failures rebasefailedStepIndex/completedStepsto global indices.tapcommand; drags route throughkeyboardAvoidingDragPointslike the individualdrag.Bug found during validation
runDirectPressSeriesguarded the awaited interaction with??=, sopress --count Nwith hold/jitter silently performed only the first press (presses 2..N short-circuited once the first result was kept; introduced in #512, also affects Android and doubleTap series). Fixed in a separate commit with a regression test (the old test's mock returnedundefined, which masked the short-circuit).Validation (iPhone 17 Pro Max simulator, iOS 26.2, isolated daemon state dirs)
press 220 600 --count 10 --jitter-px 2tap)??=bug)sequence)completedSteps: 10, 10 per-step results)press --count 25→ exactly 2sequencerequests (20+5 chunks), results aggregated across chunks.press --count 20 --hold-ms 1500(~36s of holds) → 2 budget-split requests, zero watchdog trips, zero session invalidations.pnpm typecheckclean; core + iOS unit suites 406 passed (incl. completed/failed-at-index/in-flight/lost-response recovery, allowlist rejection, chunk rebasing, budget chunking);pnpm build:xcuitest:iossucceeds with new Swift journal-retention and sequence-assembly tests.