fix(ios-runner): count the nested runner build once in the startup timing total

Merged
TH
8d ago
+228-2

Summary

ios_runner_session_startup_timings.durationMs summed every startup timing. That included build_xctestrun, which is already measured inside ensure_xctestrun, so a session start that builds the runner itself reported its build twice.

The fix declares nested timings next to where the build is recorded. The total now skips them. data.timings still carries build_xctestrun, which docs/evidence/ios-physical-runner-handoff-2026-09-19.md reads.

2 files: runner-session.ts, plus its mirrored test.

The fix came out of a time-to-first-interaction benchmark of iOS Settings. It is the measurement-hygiene item that comes first in that plan.

Validation

  • Tested commit 3769fed641.
  • pnpm check:affected --run passed: 379 files, 2809 tests.
  • New unit tests:
    • Cache miss: the total excludes the nested build. Reverting the reducer makes this test fail on its durationMs assertion.
    • Cache hit: the total is the plain sum.
  • Live, iPhone 17 Pro sim, iOS 26.2. open and prepare ios-runner with an empty DerivedData both report build_xctestrun: 0. A separate cache prewarm builds first and the session waits on the build lock, so these paths never double-counted. On them, durationMs is unchanged between main and this branch.
  • Remaining risk: I found no current CLI path where the session start builds the runner itself, so the corrected branch is covered by unit tests only.