Repository navigation
perf(android): bound target readiness and confirm moved clears - #3815
Conversation
|
Size Report
Startup median (7 runs, lower is better):
|
|
At 8b29f46, the Android open path has one defect that should be fixed before merge. Not blocking, and fine to take or leave: the Android readiness policy is decided at four sites keyed on separate platform strings (the gate at moving-target-gate.ts:74 and :146, ref-target-resolution.ts:228, and the inventory claim at inventory.ts:288) while the gate docblock still says it is backend-neutral; Could one The live evidence (42 e2e cases and 10 test-app scenarios) is author-reported, on one API 36 emulator only. The helper advertises Both Smoke Tests jobs are still queued and nothing has failed yet. The diff overlaps the smoke routes, because the shared moving-target gate runs for every press and the Android helper and open path change for Android smoke. There are no conflicts. Before merge, make the piggyback helper commands admit only sessions whose process is alive, through |
|
Thanks for the update. At bfa27fb, one problem from the 8b29f46 review (#3815 (comment)) is still open, and it needs a fix before merge. I read the code and did not run tests or reproduce this live.
Not blocking, take or leave: The live trials in the PR body are author-reported on one API 36 emulator, and I did not reproduce them. All checks were queued and none had failed when I looked, and the diff touches the Android smoke and integration routes, so those jobs need to finish green. There are no conflicts. Before merge, the helper session fix and its test must land. |
bfa27fb to
d34d991
Compare
|
Addressed the dead-helper finding through the shared session owner, inherited from #3811. Final upper head:
Added real fake-socket/session coverage through Live rebuilt CLI/helper on Pixel 7/API 36:
The first controlled fixture lacked the DEFAULT launch category, so its normal host launch needed the existing component-resolution fallback (two shell attempts). I corrected that fixture category and repeated the full sequence; the exactly-one count above is from the final run. No production retry policy changed for this fixture issue. For the optional points: I retained native helper package eligibility rather than using the broader shared classifier. Live Affected gate passed: 16,167 tests passed, one skipped; receipt The rebase range was compared and independent review has no unresolved findings. All owned sessions/daemons closed. Older APIs/physical devices and actual-head CI obligations remain; experimental-engine parity stays open. There were no inline threads to resolve. The final comment audit also found the moved-clear coverage suggestion in the later review. Addressed: the existing warm helper test now calls The completeness predicate remains local because moved-empty corroboration deliberately rejects system-only captures in addition to the general freshness requirements. I retained the dedicated negative-test file and current stack rather than broaden this into a contracts/layout migration. All table results remain in the linked JSON; the duplicated prose table was removed. Final parent-relative gross size: 2,496 lines. Final test/evidence-only head Current-main conflict follow-up: the parent preserves upstream cancellable input on the host path; its full exact gate passed 16,388 tests, one skipped ( All 20 upper commits are patch-equivalent after rebase; independent review has no unresolved findings. Final upper validation: the full rebased gate at |
0a43d61 to
c2fddc1
Compare
|
Checked latest Fresh Android comparison: pre-daemon stack Observed p50 in milliseconds:
No median regression reached 100 ms in these workloads. Every warm package open used zero host Cold follow-up: 20 fresh-daemon/app-start cycles, alternating source order, force-stopped app, identical source-built native APK installed before timing. Open median 2,220→2,054 ms; close 277→261 ms; daemon stop 187→187 ms. Both sources used two helper starts during cold foreground open; the extra start observed in one primary cold trial is also present on the older implementation. Tails remain visible: one primary moving-clear trial took 791 ms, with additional reads in the existing input/verification path, and one cold open took 3.32 s. There was no fallback, resend or wrong edit. The fill verifier and native Java input source are unchanged. A dedicated alternating repeat added 16 moving-clear trials: before median 276.5 ms, range 257–327; current median 279 ms, range 262–290. All had one clear and zero decoy edits/clicks. This is a small local regression check, not a statistical tail-latency guarantee or a new full 42-case speedup result. Scroll-until needed one or two passes depending on observed content position. The initial harness attempt failed its scroll target after generic Back; it is retained and excluded. Corrected runs use explicit keyboard dismissal and verify target visibility. All owned sessions/daemons closed. Raw samples, traces, scripts and the excluded setup run are retained locally. No code/push was needed; these measurements do not replace actual-head CI obligations. |
|
The PR is ready at c2fddc1. The earlier findings from bfa27fb (#3815 (comment)) are fixed, and I have no new problems with the code. Not blocking: the change turns the "fillAndroid runs the whole attempt on one warm daemon-session helper" test into the empty-clear case (https://github.com/callstack/agent-device/blob/c2fddc1/packages/platform-android/src/__tests__/text-input-fill.test.ts#L636), so no test now checks that a non-empty fill finishes on one warm session (one spawn, three captures); you can keep the original "chips" test and add the moved-clear case as a separate test, or leave it as is. I found no conflicts. CI is still pending: the 9 jobs that did not pass were cancelled by newer runs, not failed, so there is no failure to fix. The diff touches the Smoke, Integration and Coverage routes through the shared moving-target gate and the Android open, fill and helper paths, so those jobs need a fresh green run on c2fddc1 before merge. I ran no tests; I judged the "ended" and moved-clear tests by reading the fake session fixture and the pre-fix admission path. I reviewed only the five new commits (ffb7ed1..c2fddc1), because the range-diff shows the other 16 are patch-equivalent. The live API 36 trials (warm open with no host launch, open after the helper exited with one, moved-clear timing) come from your report on one emulator and I did not reproduce them. The helper "app" launch and its "Status: ok" parsing are still unchecked on API 31-35 and on physical devices. |
|
Fresh full Android benchmark on the final combined stack, using the original experiment’s unchanged app and test sources.
Current saves 61.080 seconds (18.2% less elapsed time) versus the original baseline, and 8.011 seconds (2.8%) versus the pre-daemon stack. The daemon/main composition did not regress this full run. All three reports contain exactly the same 43 selected identities / 42 runnable identities, matched against the reference case registry. Every runnable test passed in one attempt. Every attempt reports complete cleanup and no secondary errors. Runner retries were disabled; the fixture’s authored second-tap recovery at This measures #3811 + #3815 + the readiness opt-in from e2e #1253, including intervening main changes. It is not a standalone speedup attribution to either SDK PR or daemon work. The adapter is pinned at Method: Pixel_7_CI / emulator-5554, Android 16/API 36; one worker; zero retries; Device panel stream attached throughout. Release APK SHA-256 Largest original→current case reductions:
Current vs pre-daemon is mixed by case: bottom tabs took 1.023 s longer and error recovery 0.975 s longer; the total still improved by 8.011 s. This is one run per arm with host-load variation, not a statistical guarantee of the 2.8% difference or tail latency. The experimental direct engine, physical devices and older Android APIs were not rerun. Exact matched runnable case IDs and attempt durations (seconds)
All owned sessions and daemons closed gracefully. Source SHAs and clean worktree state remained unchanged. Local artifacts retain full reports, source/dependency provenance, runner logs, setup snapshots and analysis scripts. Actual-head CI obligations remain separate. |
Summary
Bound Android press readiness and avoid redundant stale-tree recovery; reuse the warm helper for app launch. Confirm moved empty fields only from complete, fresh captures with unique pre/post identity. Dead helper sessions retire centrally; uncertain mutations fail without a resend.
Moving-clear fixture: 1.637 s plus failure→0.323 s success. Unsafe adapter timer bypasses were rejected; its settling timer remains. Experiment and limits. Experimental-engine parity remains open.
49 files, parent-relative: production +363/−51; tests +575/−21; docs +1485/−1; 2,496 gross lines. Stacked on #3811. Adapter #1253 stays draft pending SDK release/dependency bump. Reference: e2e#1234.
Validation
Final
c2fddc1ef9, parent1977e685b2, maina661e43d83: full rebased gate 16,439 passed/one skipped (run-watm1q); final incremental gate 1,946 passed (run-FXwZHp); both exact/unchanged. All 20 upper commits remain patch-equivalent after rebase; independent review has no findings.Isolated mutations detect missing moved-clear handoff, dead-session admission, and cancellation bypass. Live API 36: helper refusal→ADB fill; controlled screenshot failure→PNG; warm open zero host launches; exited-helper open exactly one. Test-app fill/clear/refill preserves its sibling; native alert acceptance uses one cancellable host tap. Sessions/daemons closed.
Fresh full benchmark: original
eef1a3f76d335.069 s; pre-daemon0a43d61ff6282.000 s; finalc2fddc1ef9273.989 s (18.2% reduction from original). All 42 passed, one authored skip, zero retries/recoveries. One local run per arm. Older APIs/physical devices and actual-head CI obligations remain.