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
{{ message }}
Repository navigation
Commit 64854af
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ios-runner): slow synthesized replacement so a value-owning field loses fewer characters (callstack#2904)
* fix(ios-runner): bound the synthesized replacement pace so a value-owning field keeps it
A replacement burst typed at XCTest's default 60 characters/second outruns an app
that owns its field's value and re-applies it after the edit that produced it, which
is how a controlled React Native `TextInput` behaves. That write erases whatever the
burst typed while it was in flight and the field then sits stable short of the
request: first characters and tail survive, a middle run is gone, which is the
`fill id="field-email" ada@example` -> `aexample` CI signature. The commit wait can
refuse such a value but cannot repair it, because a retype races the same write.
12 characters/second spaces characters ~83 ms apart. The new
`--agent-device-text-entry-async-value-write` fixture owns its field's value and the
iOS lane test pins the pace against it: raising the pace re-opens the race and turns
that test red. A write-back still in flight 150 ms after an edit corrupts a burst at
this pace too, so this narrows the window rather than closing it, and the measured
wall-clock cost of the pace is recorded next to the commit ceiling it sits upstream
of.
Closescallstack#2080
* fix(ios-runner): bound synthesized delivery and model the app's render, not a timer
Review asked for a delivery ceiling tied to text length, and the iOS lane showed the
lane test itself was the weaker half of this change: a fixture that schedules a write
lands differently depending on how loaded the host is, and it failed on CI holding
`ad@example` at the shipped pace.
`TextEntryTiming.synthesizedDeliveryCeiling` bounds how long a burst may spend
posting. The private synthesize call delivers as it returns, so text beyond the
ceiling would still have been arriving when the transport gave up on the command,
leaving the runner typing into a field nobody waits for and the next command finding it
busy. `fill` now answers `TEXT_INPUT_SYNTHESIS_BUDGET_EXCEEDED` before posting the
first character, and the element-less `type` fallback keeps its long text on the
verified application-wide route it already had.
The pace stays owned by `RunnerSynthesizedTextEntry` and is read from Swift, so the
delivery budget and the acknowledge-window policy derive from one declaration.
`testSynthesizedPaceLeavesRoomForAnAppToAcknowledgeEachEdit` pins the pace at two
windows per character or slower, and the budget test pins the refusal boundary; both
are pure and run on the host lane.
The fixture now decides at the edit whether a character overtook a render instead of
scheduling one against a timer. A loaded host stretches the gaps between characters,
which can only make that app keep up better, so the safe half no longer depends on how
busy the machine is. The lane run watches a 5ms window, an app no pace this runner
could ship outruns; the red half was verified at the 40ms policy window, where the
pre-fix pace leaves the field holding `a` against 20 write-backs.
* test(ios-runner): assert the runner's guarantee, not the app's race
The lane test failed on CI twice: first holding `ad@example`, then `ada@exampl` with a
single write-back. Both were honest `TEXT_INPUT_COMMIT_NOT_OBSERVED` refusals over a
field the app had rewritten, and both were the test assuming it knew whether the app had
won a round trip. XCTest does not deliver `typingSpeed:` characters evenly — CI saw two
characters of a paced burst 4 ms apart — so no acknowledge window a fixture watches is a
promise about the host.
The test now follows the fixture's own counter: an app that kept up has to show the exact
value and an ok, and an app that overtook the burst has to show the refusal. Verified on
both branches, the strict one at the 5 ms lane window and the refusal one at 150 ms. That
is the invariant the runner owns, and the one callstack#2080 was about: never an ok over a field
the app rewrote.
* fix(ios-runner): charge a spaced synthesized fill its per-character call and delay
A delayed plan posts each character in its own synthesize call and sleeps
between calls, but the delivery budget charged it max(delay, interval) per
character. At --delay-ms 80 it admitted 360 characters; measured on a
simulator, one call costs about 222 ms, so a 155-character fill already
took 48 s, past the 45 s command budget.
The budget now charges every call the pace for its characters plus a
measured 150 ms overhead, and the delay between calls. maxTextLength is
derived from the same projection, and the refusal hint names both the
undelayed budget and the one at --delay-ms 80.
* docs(fill): document TEXT_INPUT_SYNTHESIS_BUDGET_EXCEEDED next to the other text-entry codes
* fix(ios-runner): bound synthesized delivery by the main-thread watchdog and pin the pace the app sees
A 358-character fill through the daemon was abandoned by the runner's
30 s main-thread watchdog with the burst still typing. The delivery
ceiling was a free-standing 30 s sized against the 45 s transport budget,
while the whole command runs under mainThreadExecutionTimeout. The
ceiling is now derived from that watchdog minus a focus allowance and the
commit wait's ceiling (18 s), so the admitted text fits with the longest
commit wait: 214 characters undelayed, 57 at --delay-ms 80.
The app-owned-value lane test accepted either outcome and stayed green at
60 characters per second. It now asserts the spacing the fixture app
receives: a burst's characters average at least one acknowledge window
apart. That is red at 60 (11 edits in about 110 ms) and green at 12
(about 780 ms). A strict "the app keeps up" assertion is not possible:
at a 40 ms window, 12 characters per second still lost one character in
13 of 20 bursts, because XCTest spaces the characters unevenly. The
comments that claimed survival are narrowed to match.
The call overhead and the --delay-ms 80 recovery delay move into
TextEntryTiming beside the other text-entry timings, and both hints read
the recovery delay from there.
* fix(ios-runner): charge the delivery budget the whole type command
The element-less, keyboard-visible branch tested the budget against the
chunk it was about to post. An append peels its first character for
warmup and a `--delay-ms` plan posts one character per call, so no chunk
ever looked long and the paced synthesizer kept a text the command
cannot carry: 215 characters arrived as 1 + 214, both inside the budget.
The branch is now charged the command's own length and delay.
That branch had no test, so it gained one: 215 characters through an
unresolved target type application-wide, and the value arrives unverified
because the branch has no element to read back. The fixture field keeps a
real input view under `--agent-device-text-entry-soft-keyboard`, without
which no branch requiring a visible keyboard is reachable.
* fix(ios-runner): charge the warmup split the type plan really makes
The review found `projectedSeconds` charging one synthesize call for an
append-mode `type` while the route posts a warmup character and then the
rest, so the estimate undercounted one call and the wait between them.
The over-budget branch that asks is the one with no element, so its
warmup wait is one poll: `waitForWarmupValue` has no expected value to
wait for. That branch now charges 2 calls and the poll, which is one
character less than a replacement of the same length.
Also: the budget hint and the docs named one limit and said "the number"
for a delayed retry, which reads as the larger one; both now name the
limit for the delay in play and say the delay falls between characters.
The pace's header comment claimed the acknowledge window is derived from
it, which it is not. The synthesized-replacement helper builds its
command with JSONSerialization, and the over-budget lane test polls the
field under its own deadline instead of reading `value` once on a route
that verifies nothing.
0 commit comments