fix(apple): reuse runner HTTP connections
Summary
Reuse HTTP/1.1 runner connections with per-request authentication, framing checks, ordered pipelining, and bounded idle time. Drain every coalesced shutdown response before closing other connections. Clarify network pooling versus usbmux behavior. Six files changed.
Validation
Head: 5c87457fdc9a0f7cb00a3d038efbffc00f1d949d. Baseline: f7879cf2d.
- iOS/macOS builds passed. Native transport/framing tests: 24/24 locally and on Limrun. The new 32-waiter shutdown regression fails on
39f7f657bwithprematureEOFand passes with the fix. - Local simulator: 24 mixed commands with HTTP tree snapshots, stable pooled connections, close/reopen, and forced-restart recovery passed.
- Physical iPhone 14 Pro, iOS 27.0.1, Xcode 27.1: 24 mixed daemon commands over USB and close/reopen passed. Forced termination required unlocking the phone; subsequent runner startup and snapshot passed.
- Shared HTTP transport over the wired CoreDevice tunnel: 60 measured commands plus six warm-up requests used 2 TCP connections, versus 66 on baseline. Responses advertised
keep-aliveversusclose.
| Phone median ms, 20 samples each | Baseline | Updated |
|---|---|---|
| uptime | 8.2 | 3.7 |
| snapshot | 701 | 692 |
| tap | 2,126 | 2,028 |
Sequential measurements include timing variation. An initial baseline attempt hit an XCTest accessibility timeout and was excluded; the complete rerun passed.
Limrun forwarded navigation and close/reopen passed. Forced restart returns HTTP 409 on both versions, a separate integration issue.
Affected receipt run-2TeQ2R, exactCommit: true: native-dupes, xctest-selection, packaged-runner-swift passed. Repository CI remains pending; Vercel requires fork authorization.