Repository navigation
perf(ios): skip the simulator accessibility write when this host's preferences already allow it - #4300
Conversation
…eferences already allow it
Size Report
Startup median (7 runs, lower is better):
|
Apex SentinelVerdict: Since the last review: 0 new · 0 still open · 1 no longer raised No findings. Not in the reviewers' prompt (2 files)
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 |
|---|---|
packages/platform-apple/src/core/ios-simulator-accessibility.ts:69 |
🆕 Guard treats an unrecognised or unreadable preferences plist as "enabled" and skips the write |
1 finding below minor not shown (user_settings.min_severity).
Not in the reviewers' prompt (2 files)
packages/platform-apple/src/core/__tests__/fixtures/accessibility-false.plist: no text diff (a binary, empty or mode-only change)packages/platform-apple/src/core/__tests__/fixtures/accessibility-true.plist: no text diff (a binary, empty or mode-only change)
Reviewed with this repository's own Sentinel configuration (83945b7a9f40).
Review of 2909056b · 07.11.2026 08:09 UTC
Apex Sentinel
Verdict: request_changes
1 finding(s): 1 major.
Required fixes
- Guard never skips on a real simulator: parseApplePlist cannot read binary plists
🟠 Major (1)
| Where | Finding |
|---|---|
packages/platform-apple/src/core/ios-simulator-accessibility.ts:70 |
Guard never skips on a real simulator: parseApplePlist cannot read binary plists |
1 finding below minor not shown (user_settings.min_severity).
Reviewed with this repository's own Sentinel configuration (83945b7a9f40).
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 2909056. The verdict and the full list are in the summary comment.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on d64b5e4. The verdict and the full list are in the summary comment.
|
I found no code defects at d64b5e4, and CI is green (17 checks, 0 not passing). I need one more live run before merge: the absent-key case. This PR also skips the guest write when the preferences file exists but has no Not blocking, and you can take or leave these: the The two earlier inline threads, #4300 (comment) and #4300 (comment), no longer apply and can be resolved. The first claimed |
…coped-provider write
|
Absent-key run done, at d64b5e4. I used a fresh iPhone 17 simulator (iOS 26.2), the PR build, and isolated state and lease dirs.
An absent key exposes the full tree, so it stays a skip. I added this to the PR body. The non-blocking items are in dbf6f50:
|
|
I found no code problems at dbf6f50, and the points from my earlier review (#4300 (comment)) are now covered by the live skip run and the binary-fixture tests. I read the head files, the delta diff and your run output. I did not run the simulator or the unit tests, and I did not decode the binary plist fixtures or reproduce the timing numbers. The absent-key run covers iOS 26.2 on an iPhone 17 simulator only, so other OS versions with an absent key are not shown. The two earlier inline threads no longer apply: the binary-plist claim was withdrawn and your binary-fixture tests answer it (#4300 (comment)), and the lookup now sits inside the try (#4300 (comment)). Please resolve both. Of the 17 checks, 16 pass, including check:affected. Smoke Tests is still running (run 42377141314) and has not failed. This change touches the launch guard on the iOS simulator open route, so if that job fails, please check whether it is an iOS simulator open and look for the ios_simulator_accessibility_prepare_failed diagnostic. No conflicts are known. Before merge, Smoke Tests needs to finish green. |
Summary
#4276 made every iOS simulator
openrunsimctl spawn … defaults write com.apple.Accessibility ApplicationAccessibilityEnabled -bool YESbefore the launch, which costs about 0.85–1.05 s (asimctl spawnread costs the same, ~0.9 s). The maintainer review on #4276 flagged it.The launch guard now reads the simulator's preferences file from this host (
<set>/<udid>/data/Library/Preferences/com.apple.Accessibility.plist, parsed with the existingparseApplePlist, ~0.3 ms warm) and writes only when the key is explicitly off. It skips the write when the key is on, 1, or absent (a never-used simulator has no key and its apps expose a full tree). A missing or unreadable file, or a scoped tool provider (Limrun), still writes. Teardown repair stays unconditional.Race accepted: after XCTest teardown the file lags the guest by under 200 ms (measured: +0 ms disk 1 / guest 0; +200 ms both 0). Our own teardown repairs the key; only a foreign teardown within that window is missed.
3 files. Design reviewed with Codex.
Validation
dbf6f508726424a703fa1cd2cedb97dc98a93d5b;pnpm check:affected --run --head dbf6f508726424a703fa1cd2cedb97dc98a93d5bpassed. Timing runs below were taken at 2909056; later commits only add tests and move the host path lookup inside the guard'stry.ios-simulator-accessibility.test.ts: skip on on/1/absent; write on off/0/malformed/missing; re-read on every launch.open --relaunch: main 3188/2407/3458/2566/2703 ms, this PR 2898/1320/1134/1181/1185 ms (first run includes runner startup).open --relaunchwrote it back to 1 before launch.plutil -pshowed the preferences file withoutApplicationAccessibilityEnabled):open --relaunchleft the key absent (no write), AXe read 155 nodes, and the firstsnapshot -ihad 29 nodes. A key=1 run on the same simulator gave 155 and 29.