Repository navigation
perf(ui): stop polling stationary Talk tooltips - #184609
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs changes before merge. What this changesThis PR replaces continuous cross-root tooltip polling with geometry invalidation and strengthens the Talk benchmark. Example: Keep the Stop voice input tooltip focused while Talk listens in desktop Chromium at 4× CPU throttle.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains This PR delivers a measured CPU improvement worth keeping, but its new playback-probe suppression causes a confirmed CI failure. Priority: P2 Before merge
Findings
Agent review detailsHow this fits togetherThe shared overlay anchor owner translates trigger geometry across DOM roots into a spatial proxy consumed by native CSS anchor positioning. flowchart LR
A[Tooltip trigger] --> B[Geometry invalidations]
B --> C[Shared overlay anchor owner]
C --> D[Cross root spatial proxy]
D --> E[Native CSS positioning]
E --> F[Tooltip surface]
Technical reviewBest possible solution: Keep invalidation in the existing anchor owner and reconcile the justified playback-method capture with the suppression inventory without weakening its guard. Do we have a high-confidence way to reproduce the issue? Current-main source directly shows perpetual cross-root frame sampling, and the supplied production-browser comparisons demonstrate its stationary-tooltip cost; no target code was executed during this review. Is this the best way to solve the issue? Invalidating geometry within the existing shared owner removes the measured waste while retaining positioning responsibilities and explicit cleanup. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2988b14f22e6. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +204, Tests +85, Docs +505, Other +898. Total +1692 across 5 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 26, 2026, 8:34 AM ET / 12:34 UTC. |
|
Merged via squash auto-merge.
|
* perf(ui): stop polling stationary Talk overlay anchors * test(ui): wait for Talk benchmark precache completion * test(ui): distinguish Talk unlock and remote playback latency * docs: record final Talk tooltip CPU confirmation * fix(ui): satisfy Talk performance CI contracts
What Problem This Solves
Talk keeps scheduling geometry work every frame while the Stop tooltip is open, even when the control is stationary.
User Impact
Stationary tooltips use less CPU while retaining their placement, focus, scrolling, and cleanup behavior.
Why This Change Was Made
The cross-root anchor owner now observes position and size changes, ancestor mutations, scrolling, and geometry animations. It requests frames while a geometry animation is running instead of polling throughout the tooltip's lifetime.
The Talk benchmark also waits for completed service-worker precaching and context-wide network quiet, rejects asset traffic inside CPU windows, and distinguishes the gesture-unlock WAV from remote-stream playback in its optional startup probe. Ordinary cells clear incidental tooltips; the focused-Stop workload deliberately keeps one open. The meter canvas is a separate PR.
Accepted edge cases: unannounced pure-scale Web Animations or fully clipped movement can wait for the next invalidation; current callers do not use these patterns. Position observation can trail motion by one frame.
Evidence
Final v4 confirmation: ten serial interleaved A/B and A/A pairs per viewport, 4× CPU, 3-second listening/idle windows, production bundles, focused Stop tooltip, headless throughout. CPU uses Chromium's thread-tick metric interval. No sample is discarded; the A/A control is reported separately.
Task CPU in ms/s (median / p95); percentage changes are paired medians. All 40 matched A/B state pairs improved.
All 160 state windows and 80 browser/precache identities validated, with zero asset requests inside measured windows. Script CPU fell 91–92% by paired median.
The startup increase is accepted for the measured CPU reduction. Raw process CPU has wider endpoints and is not used as a battery-life estimate. The fixture uses native browser audio with synthetic provider data; no hardware, acoustic, or real-provider latency claim is made. The earlier v2 results and adverse unlock-clip tails remain identified separately in
report-round2.md; the canvas's remote-stream latency proof is outside this PR.CI exposed a narrower ES2023 typecheck closure through the new observer import. The observer owner now declares its existing ES2024 collection requirement explicitly; the browser test uses the HTML/SVG-safe class-list API. These fixes do not change emitted application behavior.
The added owner code replaces a perpetual polling loop with invalidation and explicit cleanup. The Solid refactor census adds no effects, render effects, untrack, direct TSX listeners, DOM queries, flush, or owner APIs.
The inspected synthetic desktop before/after screenshots are pixel-identical. They are attached below.
Measured workload
The v4 runner is committed at
82533b0aa364; the current runner retains the same steady-state cache/network and CPU boundaries and adds opt-in startup attribution. Build each production side once with Node 26.12.1 andNODE_DISABLE_COMPILE_CACHE=1 pnpm ui:build, then run:A separate one-pair
--counters --first-pair-screenshotsdiagnostic supplies the work counts and images; its timings are not used for the effect size. Seereport-round2.mdfor the predeclared acceptance rule and earlier investigations.Before (synthetic):
After (synthetic):
CI follow-up
The initial run
40321704238exposed formatting, a readonly HTML/SVG test assignment, the narrower ES2023 collection type closure, and the native-play probe’s missing suppression-inventory entry. These are repaired in the follow-up head. The two E2E failures below remain under investigation; neither is classified as inherited. Both exact names pass scheduled main run40308651607.Filled action foregrounds > keeps action color pairs across every theme, mode, and accent: 120-second timeout, versus 41.1 seconds on main.Control UI catalog bootstrap > real chat route recovers current account state after pending snapshot ordering: Account B text assertion after reload, versus a pass on main.The catalog picker uses the existing same-root anchor path, which does not start the new cross-root tracker. The action test does exercise cross-root tooltips. This narrows the investigation but is not inherited-failure evidence or a claim that a passing replay repairs a defect.