Skip to content

perf(ios): decide Simulator AX bridge viability with a bounded spike #2192

Closed

Description

@thymikee

Parent: #2188

Blocked by: #2189, #2190

Outcome

Run a bounded, disposable iOS Simulator accessibility-acquisition spike and make an explicit GO or
NO-GO decision. The spike compares candidate mechanisms behind #2190's acquisition adapter and must
not alter production routing.

A fast result is insufficient: correctness, lifecycle, cancellation, and bounded-resource evidence
are mandatory. A NO-GO closes the bridge path cleanly while leaving the converged engine and provider
work useful.

Exact scope

  • Compare viable host-side Simulator accessibility mechanisms through one batch acquisition adapter.
  • Include a control using task-owned, pre-boot Simulator accessibility preferences such as
    AutomationEnabled and IgnoreAXServerEntitlements, plus related keys discovered during the
    spike.
  • Apply preference experiments only to disposable task-owned Simulators before boot; record the
    exact plist diff and restore or delete the Simulator during cleanup.
  • Use a framed request protocol with logs on stderr and one batch tree response; never per-node IPC.
  • Report only acquired facts: raw nodes, viewport evidence, target generation, truncation, and typed
    residue. Do not implement visibility, hittability, scope, public depth, or semantic compaction in
    the reader.
  • Bound request bytes, response bytes, node count, traversal depth, CPU work, memory, and duration.
  • Model unsupported mechanism, malformed tree, stale target generation, timeout, cancellation,
    process crash, and transport failure as typed outcomes.
  • Exercise quiet, list, nested-scroll, alert/system-surface, relaunch-during-capture, and XCTest-stress
    fixtures from test(ios): establish snapshot convergence baselines and permanent evidence #2189.

Measurement contract

Use #2189's harness and state definitions. Report raw samples for acquisition and prototype
daemon-side presentation separately, including CPU, memory, payload size, and crash recovery.

Keep candidate-owned observation latency separate from Simulator boot, application launch/readiness,
the current production daemon, and XCTest runner preparation. A bridge measurement must not charge
the candidate for xcodebuild or current XCTest-backed open work that the selected route would
avoid. A threshold stated after app readiness begins only after the expected app generation is
observably ready.

Correctness, fidelity, generation, lifecycle, cancellation, recovery, and bounded-resource gates are
hard. Latency has two tiers:

Hard viability targets

  • warm daemon-resident acquisition p50 under 300 ms and p95 under 500 ms for every representative
    screen;
  • relaunch first usable tree p95 under 500 ms after the new app generation is observably ready;
  • with a booted Simulator and ready app but no resident bridge, bridge bootstrap plus the first usable
    tree p95 under 2 seconds, without starting xcodebuild, an XCTest bundle, or the agent-device
    runner;
  • cold and cold-cold end-to-end timings are still recorded against the exact current-runner control,
    but Simulator boot and application readiness outside the candidate's ownership do not independently
    fail bridge viability. Report those components separately and demonstrate the material avoided
    runner-startup cost.

Stretch optimization targets

  • warm daemon-resident acquisition p50 under 75 ms and p95 under 150 ms after integration;
  • relaunch first usable tree within 250 ms after app readiness.

A stretch miss is an optimization finding, not by itself a NO-GO. Do not revise either tier from the
observed result. Classify #1571-style app-mount unreadability separately from reader failure.

Decision output

Publish a checked-in spike report containing:

  • candidate mechanisms and exact environment/toolchain;
  • fidelity and limitation matrix;
  • cold-cold, cold, warm, and relaunch raw results with readiness and candidate-owned timing boundaries
    explicit;
  • lifecycle, crash, timeout, cancellation, and stale-generation results exercised through the live
    candidate rather than only a generic framed-process fixture;
  • private-interface and Simulator-preference compatibility risk;
  • hard-viability and stretch-target results reported separately;
  • selected route and why, or a NO-GO with failed hard criteria;
  • production interface changes, if any, needed by the next issue.

Non-goals

  • No production backend selection, fallback, runner-demand, open/relaunch, or proxy change.
  • Do not enable private Simulator preferences by default.
  • No XCTest interaction change, physical-iPhone work, public CLI flag, or npm postinstall compiler.
  • Do not keep a candidate merely because it is fast when fidelity or lifecycle gates fail.

Acceptance and evidence

  • Every candidate runs through the same adapter contract and benchmark corpus.
  • The selected candidate, if any, proves app and system-surface fidelity, target-generation handling,
    bounded resources, typed failures, cancellation, and recovery.
  • Missing hierarchy or another acquisition fact is represented as typed residue and evaluated against
    refactor(ios): define snapshot acquisition and presentation contracts #2190's presentation contract; a flat response must not silently claim complete depth evidence.
  • Failure cases are reproducible and distinguish app readiness, bridge bootstrap, acquisition, and
    presentation failure.
  • The report contains an explicit GO or NO-GO against hard criteria, with stretch misses listed
    separately. The productionization issue must not start without GO.
  • Focused harness/tool tests pass; live Simulator measurements and artifacts are attached.

Worker stop conditions

  • Stop with NO-GO if no candidate satisfies correctness and lifecycle gates, even if latency is good.
  • Stop if a hard viability latency target fails after the measurement boundary is independently
    validated; do not use a stretch miss alone as NO-GO.
  • Stop if the experiment requires persistent host preference changes or affects non-task Simulators.
  • Stop if the adapter must manufacture presentation semantics to make a candidate look complete.

Activity

  1. added
    enhancement
    needs-triage
    and removed
    needs-triage
    on Aug 31, 2026
  2. thymikee commented on Sep 1, 2026

    @thymikee
    MemberAuthor

    Both declared blockers are now closed: #2189 closed at 2026-09-01T19:39:07Z and #2190 closed at 2026-09-01T09:33:20Z. The bounded spike remains fully specified and ready-for-agent; no label change is needed. It can now be picked up from the current main snapshot baseline and acquisition/presentation contract.

  3. thymikee commented on Sep 2, 2026

    @thymikee
    MemberAuthor

    Measurement contract reconciled after independent review of the completed corpus. The former 75/150 ms warm and 250 ms relaunch values are retained as stretch optimization targets, not binary bridge-viability gates. Hard usability is now 300/500 ms steady-state, 500 ms after observed app-generation readiness, and 2 s for nonresident bridge bootstrap plus first usable tree. Candidate-owned acquisition is explicitly separated from Simulator boot, app readiness, current XCTest-backed open, and xcodebuild. The existing generated NO-GO report is therefore not a valid final decision under the corrected contract: it conflates readiness costs, uses synthetic rather than live candidate lifecycle evidence, and silently flattens hierarchy. Preserve its raw artifact; supersede its interpretation with narrowly targeted corrected evidence rather than another broad corpus rerun.

  4. thymikee commented on Sep 4, 2026

    @thymikee
    MemberAuthor

    Closed with an explicit GO for the Node-direct SimulatorFrameworkBridge route after #2237 merged. The readable decision report is in-tree; raw exact-revision evidence is preserved at immutable tag evidence/ios-snapshot/44995806ea. Production routing remains unchanged and moves to #2196, then #2197.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions