Repository navigation
perf: reduce Talk tooltip CPU while keeping anchor tracking - #184200
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 maintainer review before merge. What this changesThis PR avoids repeated style reads and formatting for unchanged overlay anchors while preserving geometry tracking. Example: Keep the Stop voice input tooltip open while Talk listens in desktop Chromium at 4× CPU throttle.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR offers a focused, measured CPU improvement with no actionable source findings; one failing E2E scenario still needs attribution. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe shared overlay anchor owner receives trigger elements and placement bindings, mirrors cross-root geometry into a spatial proxy, and lets native CSS position tooltips and menus. flowchart LR
A[Talk Stop button] --> B[Tooltip lifecycle]
B --> C[Shared anchor owner]
C --> D[Geometry sampling]
D --> E[Spatial proxy]
E --> F[Native CSS positioning]
Technical reviewBest possible solution: Keep geometry sampling in the existing anchor owner while avoiding repeated reads and formatting of unchanged owner-written styles. Do we have a high-confidence way to reproduce the issue? Current main visibly repeats coordinate formatting and inline-style reads on every cross-root frame; the supplied production-renderer campaign measures that path, but no target code was executed during this review. Is this the best way to solve the issue? The smallest complete change retains the positioning owner, remembers its last numeric writes, and skips unchanged binding metadata; all introduced hunks serve the optimization or its existing proof paths. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c678c6ea842b. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +20, Tests +21, Other +116. Total +157 across 4 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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, 12:50 AM ET / 04:50 UTC. |
|
Merged via squash auto-merge.
|
What Problem This Solves
Keeping the Stop voice input tooltip open during a Talk session repeatedly reads and formats unchanged cross-root anchor styles on every animation frame.
User Impact
Talk uses less main-thread CPU with its Stop tooltip open. Positioning, keyboard focus, capture, playback, and the existing animation cadence are preserved. This is a measured UI CPU improvement; it does not establish lower whole-renderer CPU, battery drain, or acoustic/provider latency.
Why This Change Was Made
The existing anchor owner now remembers the numeric geometry it last wrote and updates only changed coordinates. Binding metadata is applied when the binding changes, while each frame still samples geometry and detects a move between DOM roots. There is no second positioning owner or new scheduling abstraction.
Related: #184003 and #184132. This completes the measured tooltip follow-up to the Talk caption and hidden-tab work.
Evidence
20 interleaved base/head pairs plus 20 interleaved base/base control pairs; desktop viewport, 4× CPU throttle, synthetic Talk audio, native Tab focus on Stop, two-second requested windows. Each accepted observation requires document focus, trigger focus, and its tooltip to remain open. CDP task/script CPU is normalized by the recorded CDP timestamp interval; process CPU uses its separate Node sampling interval. Delayed CDP responses on this loaded host inflated some Node wall intervals by up to 2.507 seconds, so those wall intervals are not used for CDP rates. No tracing or extra frame probe runs in the CPU windows.
The 160 accepted observations all passed focus/tooltip invariants. Whole-renderer CPU medians changed +0.18% listening and +0.11% idle. The loaded host produced noisy controls: base/base task medians moved +7.47% listening and +3.37% idle; scripting moved +1.39% and +2.61%. The scoped CPU result supports this change, not a renderer-wide or battery claim.
One original control observation lost document focus, while trigger focus and the tooltip remained unchanged. The entire round, including its passing base/head observations, was excluded and retained as failed evidence. Three replacement rounds used the same committed runner, fixtures, and frozen bundles without relaxing any invariant; the final dataset uses original rounds 0–16 plus those three complete rounds.
ci:full; current-head run40276096193, attempt 1, passedTiming used frozen production bundles whose source maps identify the base and changed anchor owner. After merging main, a fresh matched base/head build verified the final source and size budget. The integrated headless smoke checks fixture integration rather than repeating the timing campaign.
All current strict budgets pass. Production owner: 294 → 314 lines (+20); browser tests: 285 → 306 (+21); benchmark and fixture: 1,458 → 1,574 (+116). Four-file diff: 180 insertions, 23 deletions.
Synthetic before and after are pixel-identical, including the keyboard focus outline and Stop tooltip.
Before:

After:

Prior-head CI investigation
Initial exact-head CI run
40269566386failed two settings-layout cases and one publication interaction. The publication case wasControl UI personal GitHub publication > gates personal publication for a remote workspace: its menu remained closed. The retained timeout artifact recorded pointerdown on the connected trigger, no recorded trigger click, and no overlay admission event. The probe did not record pointerup and cannot establish its absence.The menu uses
sameRoot: true, so the changed cross-root proxy/RAF path is never entered for it. The exact focused test passed locally on the reviewed head and with the only changed production owner restored to its merge-base version (one pass each, headless). These replays do not establish a fix or prove the original failure inherited. The single rerun of UI shard 4 passed in attempt 2; the original pre-admission interaction failure remains in the evidence and is not claimed fixed or inherited.Completed CI attempt 2 retains exactly two failing cases in
settings-layout.e2e.test.ts:aligns every mobile settings page with the topbar contentandkeeps settings rows, introductions, section headings, and Learn more links on one layout system. Both also fail on the latest completed scheduled main run40270232777(db8db987b6786e09625523b614ebc2c290581933). The relevant test, helpers, routes, approvals page and settings shell have identical Git objects on that main run, the CI baseline and the tested merge. Every other non-skipped job passed; the downstream CI gate is red. The prior native inherited-failure admission stopped before dispatch because GitHub mergeability could not settle. Those results remain historical evidence for that exact head.After repeated pre-dispatch mergeability races, current
origin/mainwas merged without conflicts to force recomputation. Current head:33173e11d75a3e99327794a685017b096df7b9f0; base:e6b0f044d586ab955b6e2343a2ed78693cab0313. All four changed PR files are byte-identical to reviewed head86806d42a74c1ad8b90f1983f621c08fc3161cfc; the PR diff remains four files. UI typecheck passed on the integrated head. Fresh matched base/head builds and strict asset checks passed, with the current numbers in the table above. Their source maps match the exact base/head owner. The refreshed four-cell headless focused-Stop integration smoke passed, with stable focus and tooltip, successful native playback, no page errors, and inspected synthetic pixel-identical screenshots. Current-head CI run40276096193, attempt 1, passed; earlier CI and timing results are retained as exact-head evidence, not relabeled as new-head CI. The old CPU results measure the unchanged owner; the refreshed smoke proves integration only.