Repository navigation
refactor(ios): walk the lit windows once per multi-type element read - #4250
Conversation
Size Report
Startup median (7 runs, lower is better):
|
|
At 1fda404, I found no code defect, all 16 checks pass and there are no conflicts; the open item is live device evidence. The change narrows keyboard, focus, toolbar and flat-query-sweep reads from app-wide to lit-panel windows on a lit-panel request, and adds a window walk to each read. The evidence doc says the tester app flows did not dispatch and the Duo pose was not verified. So nothing shows that keyboard detection still works on a foldable lit panel, or that click/get/is/wait/find and screenshot/record still work on an ordinary simulator. The unit fixtures stub the window list, so they cannot show whether the real keyboard window falls inside Not blocking, and fine to take or leave: (1) capture routes now pay one extra main-thread orientation read per frame they never use, because I did not build or run the Swift runner, and I did not reproduce the mutation experiment. I trust the Sendable and MainActor changes from green CI. |
|
Evidence moved from the deleted
Re-attribution at
|
There was a problem hiding this comment.
All reported issues were addressed across 43 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Apex SentinelVerdict: Since the last review: 0 new · 0 still open · 1 no longer raised No findings. Reviewed with this repository's own Sentinel configuration ( Feedback goes in the review comment threads, as a reply under the inline comment of a finding: Reply Useful? Reply Comment Earlier reviewsReview of
|
| Where | Finding |
|---|---|
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerRequestPanel.swift:121 |
🆕 elementQueries can now be called with no types, silently reading as "no matches" |
Reviewed with this repository's own Sentinel configuration (a68693c72e7c).
Review of e5108879 · 06.11.2026 04:59 UTC
Apex Sentinel
Verdict: approve
Since the last review: 1 new · 0 still open · 0 no longer raised
1 finding(s): 1 minor.
🟡 Minor (1)
| Where | Finding |
|---|---|
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/UnitTests/RunnerElementSearchTests.swift:6 |
🆕 Four new proof tests pass at the base commit and guard owners this PR does not change |
Reviewed with this repository's own Sentinel configuration (b42c7c265f07).
Review of 29dd9581 · 05.11.2026 22:49 UTC
Apex Sentinel
Verdict: approve
Since the last review: 0 new · 0 still open · 7 no longer raised
No findings.
Reviewed with this repository's own Sentinel configuration (e6ac165961de).
Review of 5962b0d0 · 05.11.2026 22:16 UTC
Apex Sentinel
Verdict: request_changes
7 finding(s): 3 major, 4 minor.
Required fixes
- Unbooked lit-panel search throws on geometry reads that used to book the window
- Keyboard query moved outside containment makes scroll, swipe and keyboard reads throw
- captureRunnerFrame re-books the request's search onto SpringBoard
🟠 Major (3)
| Where | Finding |
|---|---|
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerElementSearch.swift:74 |
Unbooked lit-panel search throws on geometry reads that used to book the window |
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Keyboard.swift:293 |
Keyboard query moved outside containment makes scroll, swipe and keyboard reads throw |
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift:54 |
captureRunnerFrame re-books the request's search onto SpringBoard |
🟡 Minor (4)
| Where | Finding |
|---|---|
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerElementSearch.swift:11 |
unowned runner reference in ElementSearch traps instead of failing the read |
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Keyboard.swift:296 |
Keyboard reads are scoped to app windows; a sibling keyboard node can read as absent |
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextInputProbe.swift:105 |
probeTextInputs now runs a full lit-panel window walk per call after booking |
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextInputProbe.swift:218 |
Removed liveContentTranslation containment is not documented in help |
Reviewed with this repository's own Sentinel configuration (e6ac165961de).
There was a problem hiding this comment.
Apex Sentinel: 7 new findings on 5962b0d. The verdict and the full list are in the summary comment.
5962b0d to
29dd958
Compare
|
The code at 29dd958 looks right to me, and it fixes the problems from the earlier review: the keyboard, capture and geometry changes are reverted, and the text-input probe now walks the lit windows once. With those reverts, the live Duo runs in the PR body cover the reads that still change. Of the five new tests, only the walk-count test can fail on main; the other four pin existing behavior. All 17 checks are green at this head, and there are no conflicts. The one open item is the simplicity question below. Not blocking, and fine to take or leave: RunnerElementSearchTests.swift holds three tests (keyboard dismiss, frame sampling, surface geometry) that never reach ElementSearch, and testUnbookedLitPanelContentTranslationBooksTheRequestWindow in RunnerRequestPanelTests.swift pins liveContentTranslation, which this diff does not touch. They guard the earlier draft, not this change. The rule is that each test lives with the code it covers, so these could move to their owning test files or be dropped if main already covers them, leaving testTextInputProbeWalksTheLitWindowsOnce as the regression test. Simplicity question: ElementSearch keeps only the old function parameters (root, litDisplayID) plus a RunnerTests back-reference for holdingRecordedIssues, record and the unit-test flag, and the only behavior change is hoisting roots() out of the per-type loop. Would variadic types on main's existing elementQueries(app:matching:) and elementQueries(root:matching:litDisplayID:) (walk roots once, then types.flatMap) give the same single walk with no new type, no runner back-reference and a smaller diff at the 8 call sites? |
|
Rebased onto |
29dd958 to
e510887
Compare
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on e510887. The verdict and the full list are in the summary comment.
|
At e510887 the code still looks right: the rebase keeps the reverts to main, and the earlier threads stay fixed. All 17 checks pass, there are no conflicts, and the production patch is identical to 29dd958, so the live Duo and single-panel runs from that head still cover it. The one open item is the simplicity question from the last review. Could Not blocking, and fine to take or leave: The open inline thread about tests that pass on main still applies (#4250 (comment)); the reply there addresses a different file. |
e510887 to
3ff7a1c
Compare
|
Adopted the variadic |
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 3ff7a1c. The verdict and the full list are in the summary comment.
|
Thanks for the update. Since the earlier review (#4250 (comment)), the simplification now walks the lit windows once, and the code reads correct at 3ff7a1c. All 17 checks pass, and the diff is Swift runner code only. CI does not run the Duo lit-panel device lanes. There are no conflicts. Before merge, the lit-panel fill route needs a live Duo run at this head. The lit-panel text-input lookup is Not blocking, and you can take or leave these: the diff adds about 60 test lines for an +8/-6 change, and three of the four new tests pin behavior the diff does not touch and pass on main, so you could move them to a separate PR. The two variadic overloads near RunnerRequestPanel.swift#L127 repeat the same No inline thread from the earlier heads still applies. You can resolve the thread about a call with zero types (#4250 (comment)), because all 9 call sites pass one or four types and a guard could never fire. You can also resolve the thread about proof tests passing on base (#4250 (comment)), because it was withdrawn at 3ff7a1c and the file it named is deleted. |
elementQueries takes variadic element types, resolves its roots once and flatMaps over the types in the same order, so a text-input lookup walks the lit-panel window list once instead of once per input type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…loads Both variadic elementQueries overloads repeated the same flatMap over roots and types. A private queries(matching:in:) builds them for both.
d634d05 to
4321ec2
Compare
|
Updated head: The fetched branch already contained the shared private Device: iPhone Duo, iOS 27.1, Executed setup and validation: git fetch origin
git switch --detach origin/refactor/element-search
git rebase origin/main
pnpm install --frozen-lockfile && pnpm build
pnpm format
AGENT_DEVICE_XCUITEST_INCLUDE_UNIT_TESTS=1 AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH=/private/tmp/pr4250-unit-derived AGENT_DEVICE_XCUITEST_DESTINATION='platform=iOS Simulator,id=4F879835-4AB3-4046-B033-5AB769209DD4' pnpm build:xcuitest:ios
/Applications/Xcode-27.1.0.app/Contents/Developer/usr/bin/xcodebuild test-without-building -xctestrun /private/tmp/pr4250-unit-derived/Build/Products/AgentDeviceRunner_AgentDeviceRunnerUITests_iphonesimulator27.1-arm64.xctestrun -destination "platform=iOS Simulator,id=4F879835-4AB3-4046-B033-5AB769209DD4" -derivedDataPath /private/tmp/pr4250-unit-derived -parallel-testing-enabled NO "-only-testing:AgentDeviceRunnerUITests/RunnerTests/testTextInputProbeWalksTheLitWindowsOnce" "-only-testing:AgentDeviceRunnerUITests/RunnerTests/testUnbookedLitPanelContentTranslationBooksTheRequestWindow" "-only-testing:AgentDeviceRunnerUITests/RunnerTests/testKeyboardDismissIgnoresAFailedLitPanelWindowWalk" "-only-testing:AgentDeviceRunnerUITests/RunnerTests/testFrameSamplingResolvesTheLitPanelWithoutBookingIt"
pnpm check:affected --run --head 4321ec2f0671bc97a138b645b0cd7823b3104c21
git push --force-with-lease origin HEAD:refactor/element-search
AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH=/private/tmp/pr4250-live-derived AGENT_DEVICE_XCUITEST_DESTINATION='platform=iOS Simulator,id=4F879835-4AB3-4046-B033-5AB769209DD4' pnpm build:xcuitest
AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH=/private/tmp/pr4250-macos-derived pnpm build:xcuitest:macos
AGENT_DEVICE_STATE_DIR=/private/tmp/pr4250-live-state pnpm clean:daemonAll four selected tests passed (0 failures). The affected gate passed with Outstanding live verification: the runtime's higher-priority device instructions require the installed Device-panel CLI for interaction; this task explicitly requires the worktree CLI to prove this head. I did not substitute release-runner evidence. Therefore Form press/fill/read-back/snapshot were not executed, read-back value is unavailable, and there are no live |
|
Live Duo run at d634d05 (3ff7a1c plus the shared
Both open threads are resolved (zero-type call and withdrawn base-proof thread). I kept the four tests in this PR rather than splitting them out. |
|
Live Duo run repeated at 4321ec2, the current head. The run used the same Duo (iOS 27.1), a runner rebuilt from 4321ec2 with Xcode 27.1, the branch's own CLI and a fresh daemon:
All 17 checks pass at 4321ec2. |
|
At 4321ec2 I found no problems, and the earlier review is fully addressed: the new commit shares one query builder between the two overloads, and your live Duo run at this head covers fill with read-back, press and All 17 checks pass, there are no conflicts, and nothing else blocks merge. |
Summary
Multi-type element reads now resolve the lit-panel windows once, then build queries in the existing type/root order. Both variadic
elementQueriesoverloads use one private query builder. Text-input lookup requests its four types together. Six Swift files; follow-up to #4122 and #4189.The three tests for existing behavior remain beside their owners. No scope expansion.
Validation
Head
4321ec2f0671bc97a138b645b0cd7823b3104c21, rebased onto current main.git range-diffconfirms both commits are unchanged by the rebase.pnpm install --frozen-lockfile,pnpm build,pnpm format: passed.pnpm check:affected --run --head 4321ec2f0671bc97a138b645b0cd7823b3104c21: passed,exactCommit=true, receiptrun-9OObp6.4F879835-4AB3-4046-B033-5AB769209DD4, with unit-test compilation enabled and isolated DerivedData.CI owns coverage, integration and hosted device lanes. CI cannot replace the outstanding live Duo verification.