Repository navigation
Commit 4d5c384
perf(ios): read each resolved text input through one snapshot (#3882)
* perf(ios): read each resolved text input through one snapshot
On iOS every attribute read from a live XCUIElement re-runs its query, and
each query snapshots the whole app (~90-110 ms on Bluesky's React Native
Search screen). A fill read identity, frame, and value one attribute at a
time and resolved the field again right before each post, so it made ~37
queries.
- Resolution returns the snapshot it read; value, frame, identity, and the
replacement baseline come from that snapshot.
- The focus step hands its post-focus read to the entry, and a post reuses
the last read when nothing was dispatched since it was taken. After a
clear, the field resolves again under its bound identity.
- The point lookup runs one query for all four text input types, reads each
candidate through one snapshot, and still hands out per-type handles.
Bluesky Search fill, runner type: 5.6-6.2 s -> 3.3-3.7 s.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fix(ios): keep each fill read tied to the input it named
Two reuses from the one-snapshot change could pair a read with the wrong
input:
- The point lookup counted per-type positions across candidates read from
a shared query that each re-ran it. An input that left the app between
two candidate reads shifted the later positions, so a handle could name
another input than the snapshot it carried. Each handed-out handle now
reads as the candidate's identity and frame; on a mismatch the lookup
runs the per-type queries, whose handles read through their own
snapshots.
- The warmup kept its read across the pause it takes for an unreadable
value or an expired deadline, so the next post skipped the identity
check and could type into a successor. Only a read that no pause
follows is reused now.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fix(ios): fall back when any point-lookup position moved
The point lookup validated a handle only for a candidate at the point,
after the point filter. An input of another type that left the app after
an earlier position's read moved a later input into a position already
read, so the input at the point was never read: the next position read
an input elsewhere, which the filter dropped, and the last position no
longer existed and was skipped. The lookup returned no input without
falling back, so a resolved-coordinate fill failed with
NO_TEXT_INPUT_AT_POINT and a coordinate tap could lose its typing
witness.
Every position now must still exist and every handle must read as its
position's input, at the point or not; otherwise the lookup runs the
per-type queries. A position's existence is read only when its snapshot
fails, so a lookup reads each candidate twice, as before for the input
at the point.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* refactor(ios): look up text inputs through per-type queries only
The shared elementType IN query saved three queries per point lookup but
needed index rebinding, a validation snapshot per candidate, and a
fallback for every shift race. Per-type handles never shift across types,
so the lookup now reads each type's query and snapshots each candidate
once, reading existence only when the snapshot fails. Bluesky and
test-app fills measured no slower.
An unbound target that resolves through its refresh point now keeps the
snapshot the point lookup read instead of reading the input again.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* refactor(ios): let one reader own the reuse of a text input read
Every resolver now returns ResolvedTextEntryInput, which owns the
exists-first and snapshot-first reads. TextEntryReader hands a read out
again until the next dispatch or pause, replacing the post-focus and
undispatched reads tracked at each call site. The point lookup's
snapshots answer identity, so its consumers stop probing candidates
again. A fill reads the counted field 17 times instead of 19.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* refactor(ios): verify and repair an append through the text entry reader
Append verification, the repair decision, and the repair itself read
through TextEntryReader, so a verification starts from the read its
check took and the repair dispatches through the reader. The clear's
caret tap takes its frame from the read it clears. A read that raises
logs its exception, and every input comes from a named read.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>1 parent 1778e24 commit 4d5c384
12 files changed
Lines changed: 489 additions & 236 deletions
File tree
- apple/runner/AgentDeviceRunner
- AgentDeviceRunnerUITests
- UnitTests
- AgentDeviceRunner
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
133 | 167 | | |
134 | 168 | | |
135 | 169 | | |
| |||
513 | 547 | | |
514 | 548 | | |
515 | 549 | | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
| 550 | + | |
524 | 551 | | |
525 | 552 | | |
526 | 553 | | |
527 | 554 | | |
528 | 555 | | |
529 | 556 | | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
530 | 577 | | |
531 | 578 | | |
532 | 579 | | |
| |||
690 | 737 | | |
691 | 738 | | |
692 | 739 | | |
| 740 | + | |
| 741 | + | |
693 | 742 | | |
694 | 743 | | |
695 | 744 | | |
| |||
702 | 751 | | |
703 | 752 | | |
704 | 753 | | |
| 754 | + | |
| 755 | + | |
705 | 756 | | |
706 | 757 | | |
707 | 758 | | |
| |||
724 | 775 | | |
725 | 776 | | |
726 | 777 | | |
| 778 | + | |
727 | 779 | | |
728 | 780 | | |
729 | 781 | | |
| |||
732 | 784 | | |
733 | 785 | | |
734 | 786 | | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
735 | 799 | | |
736 | 800 | | |
737 | 801 | | |
| |||
774 | 838 | | |
775 | 839 | | |
776 | 840 | | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
777 | 856 | | |
778 | 857 | | |
779 | 858 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
| 338 | + | |
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
| 355 | + | |
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| |||
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
366 | | - | |
| 366 | + | |
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
0 commit comments