perf: reduce iOS input readiness and PNG encoding latency

Merged
TH
10h ago
+613-51

Summary

Avoid iOS input-readiness timeouts after confirmed target focus, and reuse the fast PNG encoder in worker/inline jobs. Scope spans 12 files: readiness, PNG encoding, profiling evidence, and regression coverage. No public API change.

The upstream app measured native selector taps at 5.47→0.67 s and PNG worker encoding at 10.65→3.30 / 89.83→24.13 ms, with identical pixels. Ordinary fills were unchanged. These are route/stage measurements.

Follow-up to #3813. Rebased onto b5f47e7542 (#3806/#3797); matched comparisons found no repeatable loss of gains. Lazy inline encoder loading fixes eager-import failures. Cleanup removes 23 net lines of unreachable/redundant readiness code; all regression tests remain. Evidence and reproduction.

Validation

  • Head: 88890d80e02060c595879d30808f2a2f389a8774.
  • pnpm check:affected --run --head 88890d80e0: passed, exactCommit: true, 3,932 tests passed. Receipt: .tmp/validation/run-b2pcAd/receipt.json.
  • Current head: iOS/macOS unit-inclusive builds; 24 native tests passed, zero failures/skips; six live upstream-app operations passed, including independently verified fill/replacement/append. Independent review: no findings.
  • At f162f1cf10, full Coverage: 16,249 passed / 1 skipped plus 11 fuzz tests passed; changed lines 3/3 (100%); CRAP passed. TypeScript is unchanged since that run.
  • Earlier comparisons: all 54 timed device operations passed; serial PNG output matched every pixel.
  • No physical-device/full upstream-suite run. GitHub integration, coverage, and native/device checks remain authoritative. Locally skipped lanes are not passes. Earlier full-navigation Maestro failure remains unproven and excluded.