perf(ios-runner): prepare an iPhone coordinate tap without re-reading its window

Merged
IM
4d ago
+352-70

Summary

Before each iOS coordinate tap (what press @ref and press <selector> send), the runner queried the app's windows, re-read that window's frame and screen at dispatch, and ran one SpringBoard modal query per type. On an iPhone with one screen the app fills it, the rule the sole-screen route already uses.

  • Such a tap takes the screen in the app's orientation as its frame. The windows query runs only when synthesis fails, so the XCTest fallback keeps its proof.
  • A gesture whose window fills that screen routes its record to the screen. Placed windows, iPads and multi-screen devices keep the window route. One SynthesizedWindowSource value decides both.
  • One SpringBoard query matches alerts and sheets; alerts still win.
Before / after (iOS 27.2 simulator, Settings)

Builds taking turns, 24 presses of each kind per build, daemon-side medians, load 8–27:

StepBaseHeadDelta [95% CI]
press @ref444 ms318 ms−125 ms [−144, −114]
press 'label="General"'501 ms384 ms−118 ms [−128, −104]
wait text after it98 ms104 mswithin noise
press, wait, back, wait1725 ms1610 ms−115 ms [−164, −87]

Under heavy load: −179 to −199 ms per press.

Validation

  • Base d2a4abe701; head f336513ece. A recorded simulator run at this head (review reply) covers scroll, swipe, back and edge touch in both orientations, and a press under a SpringBoard alert.
  • Runner unit tests pass (7 new); 6 mutants each fail a test.
  • Gate: native-dupes, xctest-selection, packaged-runner-swift passed.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.