Skip to content

perf(ios-runner): confirm a back button pop from the back buttons before reading the bars - #5304

Merged
thymikee merged 2 commits into
callstack:mainfrom
imranbarbhuiya:perf/ios-back-query-waves
Dec 1, 2026
Merged

thymikee merged 2 commits into
callstack:mainfrom
imranbarbhuiya:perf/ios-back-query-waves

Conversation

@imranbarbhuiya

@imranbarbhuiya imranbarbhuiya commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

After iOS back taps the navigation bar back button, each confirmation read snapshotted every navigation bar, even when the back buttons alone already showed the pop. The candidates are a tree-order subset of the BackButton buttons, so when the labels before the tap are not a subsequence of the labels read now, no bars can keep them. Such a read now answers the pop without the bar query, so a bar read that would fail or hang cannot turn it unverified. Otherwise nothing changes, including the lookup before the tap.

The BACK_NAVIGATION_BAR_BUTTON line gains poppedBy=buttons|bars. A fixture flag keeps the floating back button across the pop, as on the closed iPhone Duo.

Validation

iPhone 17 Pro simulator, iOS 27.2. Base feb94004f5, timed at 8f71338150 (head 65cc2da784 only rewords RUNNER_PROTOCOL.md). Settings, General > Fonts > System Fonts, then back three times; builds alternated, 21 backs per build per round:

median (p90), ms               base         head        delta
head 8f71338150, 2 rounds
daemon                         901 (1019)   833 (956)   -68 (-7.6%)
CLI                            1050 (1162)  954 (1094)  -96 (-9.2%)
aab1deb7ab, 4 rounds (same runner code; head changes tests and a test hook)
daemon                         868 (953)    787 (893)   -81 (-9.3%)
runner confirmMs / lookupMs    180 / 293    106 / 295
  • At head, Safari's edge swipe still runs (outcome=performed changed=yes). At aab1deb7ab, base and head matched on Settings depths 3, 2 and 1, Safari in both orientations, and landscape Contacts.
  • iPhone Duo, closed: poppedBy=bars, then poppedBy=buttons. Open and half-open: the lookup exceeds its 1 s budget at base and head alike.
  • Runner unit tests at head: 790 run, 0 failures, 2 skipped. New tests cover the subsequence rule, the bar title path, a bar query that fails or hangs, and the read deadline; 10 mutants each fail a test.
  • native-dupes, xctest-selection, packaged-runner-swift and check:affected pass.

…ore reading the bars

After the navigation bar back button tap, each confirmation read
snapshotted every navigation bar, even when the back buttons alone
already showed the pop. The candidates are some of the back buttons in
tree order, so when the labels before the tap are not a subsequence of
the labels read now, no bars can keep them. Such a read now answers the
pop without the bar query, so a bar query that would fail or hang there
can no longer turn it unverified. Otherwise the bars are read and the
whole state is compared, as before.

The confirmation read no longer repeats the deadline check its loop has
just made; each button snapshot still checks the deadline.

The runner log line gains poppedBy=buttons|bars, a test hook fails or
hangs the bar query alone, and a fixture flag keeps the floating back
button across the pop, as on the closed iPhone Duo, to cover the bar
title path.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread apple/runner/RUNNER_PROTOCOL.md Resolved
@thymikee

thymikee commented Dec 1, 2026

Copy link
Copy Markdown
Member

Thanks for the speedup. No blocking problems were found in the code at 65cc2da, and the required evidence is in place.

The wording thread on poppedBy no longer applies and can be resolved: the protocol text now says that poppedBy names the evidence that confirmed the pop and that - means none did, which matches the code.

The Runner Build (tvOS + visionOS + watchOS) failure is likely unrelated, because the changed Swift code and the changed fixtures compile only for iOS. This is not confirmed from logs, since no failure excerpt was available. The Body rules check was cancelled, probably because a newer run replaced it.

Not verified here: the live timings and the iPhone Duo runs are author-reported. The runner unit tests were not run for this review; CI and the author report 790 runs with 0 failures.

Before merge, please re-run Body rules and confirm that the Runner Build failure also happens on main or is a flake. Nothing in the diff stands in the way.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Dec 1, 2026
@thymikee
thymikee merged commit 8b0b5a4 into callstack:main Dec 1, 2026
20 of 22 checks passed
@imranbarbhuiya
imranbarbhuiya deleted the perf/ios-back-query-waves branch December 2, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants