Repository navigation
Conversation
Every simulator capture ran the host-side system-surface probe, two pgrep -f spawns plus ps reads, about 50-100ms per capture and two or three captures per settled press. A ready runner answers the same question from XCUIApplication.state of every registered host in a few milliseconds, and its answer decides the route since #3873. Ask it first, and run the process probe only when no runner is ready or the read fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
Review follow-up: a probe that cannot answer sends the capture to the runner, not to the bridge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent review (Codex, read-only) of |
|
This PR is ready at 8ad34e6. The code looks right, and all 16 reported checks pass. No conflicts. Not blocking, and you can take or leave these. The runner read in snapshot-route.ts (https://github.com/callstack/agent-device/blob/8ad34e6/packages/platform-apple/src/snapshot-route.ts#L129) now runs on every eligible simulator capture, before the bridge-disabled check and before any host process exists. If the runner reports ready but does not answer, a capture can wait up to the 1s read timeout. The removed test in snapshot-route.test.ts also pinned that a disabled generation never pays the foreground reads, and the new order drops that. A short note in the ADR or PR body would cover both, or you could skip the read after a recent failed read for the device. Could the runner-first, probe-second composition move into one presence resolver beside the two probes, so the route makes one call that returns present, absent or unknown? That would also let you trim the long comment above the capture path. I did not run a live device or simulator, so the performance numbers and the "few milliseconds" read latency are unverified. I did not read the runner recovery or transport timeout path in depth, so whether a timed-out read leaves the session intact rests on the #3873 design. I confirmed the test regression claim by reading the code, not by running the tests at the base commit. Merge once #3873 lands and this PR is retargeted to main. |
|
* origin/main: feat(test-app): add a Bluesky-depth heavy feed screen (#3884) fix(android): read a child that vanished mid-read as gone (#3901) feat(ios): route iPad Simulator snapshots through the host AX bridge (#3895) Prepare shared resource ownership and selection for #3325 (#3887) refactor(kernel): track held execution locks in keyed-lock (#3879) perf(ios): ask a ready runner about surface hosts before spawning probes (#3877) fix(ios): keep the bridge while a surface host only lingers (#3873) perf(ios): synthesize taps on resolved in-app back controls (#3880) fix(macos): open a running app by its own path instead of its bundle id (#3889) fix(macos): accept mixed-case bundle ids in open (#3867) fix(macos-helper): scroll SwiftUI forms whose rows are scroll-area children (#3888)
* origin/main: fix(android): read a child that vanished mid-read as gone (#3901) feat(ios): route iPad Simulator snapshots through the host AX bridge (#3895) Prepare shared resource ownership and selection for #3325 (#3887) refactor(kernel): track held execution locks in keyed-lock (#3879) perf(ios): ask a ready runner about surface hosts before spawning probes (#3877) fix(ios): keep the bridge while a surface host only lingers (#3873) perf(ios): synthesize taps on resolved in-app back controls (#3880) fix(macos): open a running app by its own path instead of its bundle id (#3889) fix(macos): accept mixed-case bundle ids in open (#3867) fix(macos-helper): scroll SwiftUI forms whose rows are scroll-area children (#3888)
Summary
Stacked on #3873; retarget to
mainonce it merges.Every iOS simulator capture ran the host-side system-surface probe first: two
pgrep -fspawns pluspsenvironment reads. That costs 50–150 ms per capture, and--settlemakes 2–3 captures. Since #3873, a ready runner's read of every registered host'sXCUIApplication.statedecides the route anyway, and it answers in a few milliseconds.The route now asks a ready runner first:
#3873's later refinement step is gone, since a
presentfrom the probe now only arrives when the runner could not answer. The ADR 0004 paragraph is updated.4 files.
Validation
pnpm check:affected --run --head d2dcc82027: passed.10bc49d00e, 3 of 4 cases.snapshot -i, daemon request time:10bc49d00e: 194–316 ms (median ~281), 2pgrep+ 4psspawns per capture.d2dcc82027: 110–142 ms (median ~117), 0pgrep, 3ps(target resolution).🤖 Generated with Claude Code