You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implements the acquisition/presentation timing-isolation slice of #1797.
Measures backend acquisition and runner-side presentation separately within each capture-plan attempt.
Restricts XCTest slow/timeout penalty decisions to qualifying acquisition time and failures, so slow presentation cannot arm the breaker.
Reports acquisition and presentation timing once at response level through the existing snapshot-quality diagnostics contract.
Preserves total command deadlines, fallback ordering, clip and quality-reason semantics, visible-depth behavior, backend differential lanes, and the file-private presentation construction boundary from PR fix(ios): make snapshot presentation construction private #1937.
The response-level timing fixture assigns its SnapshotCaptureTiming to SnapshotBackendCapture; a direct-presentation default test confirms timing remains omitted when no capture plan stamps it.
The final iOS reruns exposed an existing automation-channel race in the hidden-keyboard text canary: commit verification resolved XCUI state every 20 ms while the synthesized text event was still in flight. The owning wait now observes at a dedicated 200 ms cadence, preserving the 3 s deadline while allowing the target to consume the event.
Scope expanded from five to seven files for that CI-owned text-entry fix; there is no snapshot/text fallback or duplicated execution path.
Exact local size comparison is +3.4 kB npm unpacked: +3.0 kB Apple runner source/project and +426 B JS/dist. The focused RunnerTests+SnapshotTiming.swift module adds +3.1 kB, RunnerTests+SnapshotCapturePlan.swift removes 382 B, and the text-entry cadence fix adds 272 B across its two owning files.
The timing module is intentional: the capture-plan file is already over 1,000 lines, so keeping the typed phase carrier, injectable clock seam, penalty policy, and deterministic timing tests in a focused module avoids further coupling to plan orchestration. A smaller parameter-only seam would duplicate date arithmetic or lose the typed failure phase needed by the breaker.
This PR addresses only the timing-isolation slice and does not close all of #1797.
Validation
Exact base head: d2f2dae798153a489623ac0e65d50f6c83f2dec3 (origin/main).
pnpm check:affected --run passed: 5,304 related tests plus format, lint, typecheck, layering, Fallow, build, and XCTest selection.
iPhone 17 Pro simulator, iOS 26.2: the unchanged hidden-keyboard canary failed in the pre-fix five-iteration stress run; it passed 5/5 after the cadence fix, with every 17-character commit completing in 0.56–0.57 s.
The complete 67-test iOS PR XCTest selection passed on the rebased head, including snapshot timing/presentation and the hidden-keyboard canary.
Local package comparison: +234 B JS raw, +54 B JS gzip, +996 B npm tarball, +3.4 kB npm unpacked.
P1: testSnapshotQualityCarriesPhaseTimingAtResponseLevel creates a local timing value but constructs SnapshotBackendCapture without assigning timing, then expects stampedSnapshotPayload to contain that timing. The capture therefore carries nil and the new host XCTest should fail once this exact head reaches that lane. Set the capture timing in the fixture so the test actually pins response-level propagation, and include a negative/default case if direct presentation is meant to omit it. The current Size result is +3.1 kB unpacked, so the body also needs exact growth attribution and why a smaller interface was rejected.
Re-reviewed exact head 5b70fa34. The prior timing-fixture blocker is resolved: the positive fixture now assigns timing to SnapshotBackendCapture, the direct-presentation negative case pins omission, and Host XCTests pass. I traced the shipped route from capture-plan execution through separate phase measurement, acquisition-only breaker policy, response stamping, and verdict parsing; no further code findings. The +3.1 kB unpacked growth is itemized, and the focused timing module is justified against further growth in the 1,099-line plan file. All completed gates are green and the branch is mergeable. Code review is clean; merge readiness still awaits the exact-head iOS Smoke/live simulator lane, which is currently queued.
Fixed and rebased at b012209455. The repeated iOS failure was the hidden-keyboard text canary starving its own in-flight synthesized event with XCUI resolution every 20 ms; snapshot timing tests were not failing. Commit observation now has a dedicated 200 ms cadence while retaining the 3 s refusal deadline. The unchanged canary was red in a five-iteration pre-fix stress run, then passed 5/5 after the fix (full 17-character commits in 0.56–0.57 s). The complete 67-test iOS PR XCTest selection and pnpm check:affected --run (5,304 related tests plus all runnable gates) pass on the rebased head. PR body now records the seven-file scope expansion and exact +3.4 kB unpacked attribution. CI has been triggered on the new head; no further code blocker is known.
Exact-head follow-up: all required checks are now green, including the rerun Coverage lane and iOS Smoke. The runner-timing path and synthesized-text canary were validated on this head, the branch is clean/mergeable, and the +3.4 kB unpacked growth is itemized in the PR body. No remaining findings; merge-ready.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ready-for-humanValid work that needs human implementation, judgment, or maintainer merge
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the acquisition/presentation timing-isolation slice of #1797.
SnapshotCaptureTimingtoSnapshotBackendCapture; a direct-presentation default test confirms timing remains omitted when no capture plan stamps it.RunnerTests+SnapshotTiming.swiftmodule adds +3.1 kB,RunnerTests+SnapshotCapturePlan.swiftremoves 382 B, and the text-entry cadence fix adds 272 B across its two owning files.This PR addresses only the timing-isolation slice and does not close all of #1797.
Validation
d2f2dae798153a489623ac0e65d50f6c83f2dec3(origin/main).b0122094552a9661af97b56a58dc9df37e9f57ad.pnpm check:affected --runpassed: 5,304 related tests plus format, lint, typecheck, layering, Fallow, build, and XCTest selection.