Repository navigation
perf: pause Talk caption rendering in hidden tabs - #184132
Conversation
Retain caption rows while the document is hidden and catch up from the live owner on reveal. Add a document-visibility regression and extend the Talk benchmark with externally paced captions, paired controls, and retained-row assertions. Full performance and CI proof follow in the PR.
|
🦞👀 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 pauses Talk caption DOM updates while the document is hidden and catches up in retained rows when it becomes visible. Example: A hidden Talk tab receives 40 caption chunks at 20 Hz.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it addresses remaining hidden-caption rendering on current main with a focused change, and no concrete introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI projects immutable Talk conversation entries into keyed caption rows; document visibility now controls presentation without changing event reception or audio processing. flowchart LR
A[Talk transcript events] --> B[Conversation owner]
B --> C[Caption projection]
D[Document visibility] --> C
C --> E[Retained keyed rows]
E --> F[Visible transcript]
Technical reviewBest possible solution: Keep the existing conversation owner and visibility primitives, then land the focused presentation change once its performance acceptance and required CI are settled. Do we have a high-confidence way to reproduce the issue? Current-main source subscribes caption DOM directly to entry updates regardless of document visibility, and the supplied smoke reports 40 hidden mutation deliveries on base; no target code was executed during this read-only review. Is this the best way to solve the issue? The production change is the smallest complete fix: park caption presentation through existing lifecycle primitives while preserving immutable owner updates, keyed row identity, and reveal catch-up. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5abf83a3b89b. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +4, Tests +18, Other +298. Total +320 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 25, 2026, 11:17 PM ET / October 26, 2026, 03:17 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* perf: park Talk caption DOM updates in hidden documents Retain caption rows while the document is hidden and catch up from the live owner on reveal. Add a document-visibility regression and extend the Talk benchmark with externally paced captions, paired controls, and retained-row assertions. Full performance and CI proof follow in the PR. * fix: satisfy hidden Talk benchmark lint checks * test: include reveal CPU in hidden Talk measurements
What Problem This Solves
Talk captions continue updating invisible DOM while the browser document is hidden.
User Impact
Background Talk sessions skip caption rendering until the document becomes visible, then show every received caption in the retained row. Capture, playback, owner state, and transport remain unchanged.
Why This Change Was Made
The existing document-visibility and parked-projection primitives belong to the caption component's Solid lifecycle. Applying them there avoids publishing each hidden fragment to DOM without introducing another caption owner or timer. The plain conversation owner continues accepting all fragments.
Follow-up to #184003. That PR removed whole-pane caption work and hidden meter polling; this change removes the remaining hidden caption DOM work.
Evidence
Acceptance was set before timing: twenty serial interleaved base/head pairs plus twenty base/base controls, desktop Chromium at 4× CPU, two-second windows with exactly forty Node-delivered chunks at 20 Hz. Compare visible streaming, hidden streaming, and hidden plus reveal task/script CPU. Preserve all chunks, native visibility, existing row identity, neutral tooltip state and reveal latency. CPU uses Chromium thread-clock metrics; report wall timings against the A/A control on this loaded host. Reveal CPU includes restore, DOM catch-up and two visible native animation frames, so deferred work is included.
160/160 observations passed; twenty base/head pairs and twenty identical-base control pairs. All 80 hidden observations recovered every chunk on reveal. The paired campaign ran for 22m46s; one-minute host load ranged 35.78–77.45 (median 55.88).
CPU-per-second values use each actual observation duration. Hidden-plus-reveal values are raw milliseconds across both intervals. Paired median changes are −14.31% hidden task, −32.56% hidden script, −4.78% combined task, and −5.86% combined script. The independent-base control combined-script median moved +1.96%; the CPU win survives reveal accounting.
Timing limitation: visible normalized-task p95 increased 8.38%, and reveal wall p95 increased about 29–31%; strict wall-latency equivalence is not established. Raw visible task-duration p95 moved +6.91% in the comparison versus +9.59% in the identical-base control; visible script, layout and style p95 improved. Identical-base controls show large wall stalls without corresponding CPU growth: one control pair took 1,253.59 vs 702.61 ms to reach the post-reveal frames, while task CPU was 127.96 vs 129.69 ms. In the changed comparison, reveal task median/p95 are 149.10/178.03 → 148.49/177.04 ms; reveal script p95 is +4.17%. The post-DOM two-frame gap improved from median/p95 28.27/50.29 → 23.10/33.96 ms. The campaign’s noisy-host rule therefore uses the twenty-pair CPU metrics and structural counts; the wall tails remain reported, not called a latency win.
Reproduce with committed
scripts/bench-control-ui-talk.ts:--bundle-dir <base> --compare-bundle-dir <head> --pairs 20 --aa --duration-ms 2000 --viewport desktop --cpu-throttle 4 --states transcribing,hidden-transcribing --external-transcripts --expect-hidden-parked. Counter/trace smoke is separate; uninstrumented CPU windows do not run a transcript MutationObserver or frame probe.The separate instrumented smoke passed all four cells: forty chunks displayed in both visible cells; hidden base displayed forty chunks through forty mutation deliveries; hidden head displayed zero through zero mutation deliveries and displayed all forty after reveal. The existing row was retained throughout; hidden analyser reads and interval RAF callbacks were zero. No tooltip opened. Before/after reveal screenshots are byte-identical and use synthetic data only.
One earlier candidate file run passed thirteen tests but failed
moves live activity to the current eligible group after replacement and run changes(expectedLatest operation…, got no activity). Original-base and restored-identical-candidate file runs both passed all fourteen. No change is claimed to fix that unreproduced failure; it is not classified as inherited. The exact-head full UI unit checks passed; the original local failure remains recorded.Base source is
a5bfe043a403c8af06eaf03a454070347182e96f; head component source is931424f1b0d3862018d4f309c613142f9b654e49. Queued build labels both retained the base commit, so the source-map componentsourcesContentwas verified byte-for-byte against the corresponding Git blob. Later changes only extend benchmark reveal metrics and do not change the frozen production bundles.LOC: production component 53→57 (+4); regression file 701→719 (+18); benchmark plus fixture 1,160→1,458 (+298), including native-hidden delivery, endpoint scans outside the CPU window, reveal accounting, and workload invariants. All refactor-checklist effect/render-effect/untrack/listener/query/flush/owner-API counts in the touched component remain zero.
Synthetic renderer proof does not establish physical-phone, acoustic, provider/network latency or battery-life gains. No audio processing code changes here.
The two pre-existing failures are
settings-layout.e2e.test.ts > Control UI settings layout mocked Gateway E2E > aligns every mobile settings page with the topbar contentand... > keeps settings rows, introductions, section headings, and Learn more links on one layout system. Both fail on the approvals settings route on this PR and scheduled main. CI tested merge606ea0ff45b4a50fa545dd9f71a3e98185669793(parentsc1e18a008aab7be7af2bd165df93f69795225a79,bb2bef28110c7e3d48edb6ecb2ea21676eb772db); its real delta is exactly this PR's four files, and the failing settings inputs match the tested main baseline. These failures remain failed and are documented for the native inherited-CI route.A follow-up audit using the recorded CDP timestamp interval gives hidden task CPU 27.972 → 24.341 ms/s (−12.98%; p95 −10.78%) and hidden script CPU 13.658 → 8.837 ms/s (−35.30%; p95 −34.91%). Hidden-plus-reveal CPU totals are unchanged; visible task p95 remains +8.44%. This corrects small Node response-delay effects in the historical rates above without changing acceptance or the stated limitations.