Skip to content

perf(transcript): batch prompt geometry reads during row commits - #33960

Closed
teamleaderleo wants to merge 2 commits into
feat-cmux-nextfrom
lane/transcript-prompt-measure
Closed

teamleaderleo wants to merge 2 commits into
feat-cmux-nextfrom
lane/transcript-prompt-measure

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Withdrawn after measurement

Withdrawing this candidate: correctness and the measurement-order regression passed, but this run does not demonstrate a consistent overall scrolling speedup sufficient to justify the additional queue/microtask machinery. The adverse fling sample is retained, not dismissed as proven noise. No performance or zero-blank acceptance claim.

Run41660063670 passed the full check, 30 unit/component tests, 3 browser tests (first-painted geometry and child-only correction included), and 3 streaming/fold tests. The same browser ordering test fails on the baseline as expected (first read index0 versus at least3 sibling writes). All source/harness/log hashes match; the driver restored the candidate.

Head: dcf74d7c2ace4dbf5a58db755d730af6ad9de88a; baseline: 7f6fe51cc3e65c5b18c93ca45def3fe4073530b4; worker: 7b2ddfbac651b79f
Run: https://github.com/manaflow-ai/cmux/actions/runs/41660063670
Accepted: True; restored: True; error: none

Pass Fling p95 interval (ms) Render-start to commit p95 (ms) Long p95 (ms) Wheel p95 (ms)
1-baseline-timing 124.0/148.0 97.0/106.0 49.0/53.0 31.0/29.0
2-candidate-timing 165.0/116.0 125.0/88.0 45.0/36.0 24.0/23.0
3-candidate-timing 106.0/112.0 72.0/81.0 50.0/45.0 24.0/24.0
4-baseline-timing 112.0/130.0 82.0/80.0 46.0/44.0 24.0/24.0
Coverage pass Scenario Frames Blank frames Blank ms Longest uncovered area (px)
baseline-coverage fling#0 34 1 17 190.5
baseline-coverage fling#1 49 1 16 190.5
baseline-coverage long#0 632 0 0 0
baseline-coverage long#1 647 0 0 0
baseline-coverage wheel#0 481 0 0 0
baseline-coverage wheel#1 481 0 0 0
candidate-coverage fling#0 45 1 16 190.5
candidate-coverage fling#1 41 1 16 190.5
candidate-coverage long#0 671 0 0 0
candidate-coverage long#1 633 0 0 0
candidate-coverage wheel#0 480 0 0 0
candidate-coverage wheel#1 480 0 0 0

Headless diagnostic only. Native/nightly 120 Hz acceptance remains unproven. Render-start to commit is elapsed time, not React CPU time. Separate coverage passes avoid charging DOM sampling to the timing runs.

Metric / paired pass Before After Delta Run
fling#0 p95 interval / AB 124 ms 165 ms +41 ms (+33.1%) same worker
fling#1 p95 interval / AB 148 ms 116 ms -32 ms (-21.6%) same worker
long#0 p95 interval / AB 49 ms 45 ms -4 ms (-8.2%) same worker
long#1 p95 interval / AB 53 ms 36 ms -17 ms (-32.1%) same worker
wheel#0 p95 interval / AB 31 ms 24 ms -7 ms (-22.6%) same worker
wheel#1 p95 interval / AB 29 ms 23 ms -6 ms (-20.7%) same worker
fling#0 p95 interval / BA 112 ms 106 ms -6 ms (-5.4%) same worker
fling#1 p95 interval / BA 130 ms 112 ms -18 ms (-13.8%) same worker
long#0 p95 interval / BA 46 ms 50 ms +4 ms (+8.7%) same worker
long#1 p95 interval / BA 44 ms 45 ms +1 ms (+2.3%) same worker
wheel#0 p95 interval / BA 24 ms 24 ms +0 ms (+0.0%) same worker
wheel#1 p95 interval / BA 24 ms 24 ms +0 ms (+0.0%) same worker

This candidate batched PromptText layout reads after sibling writes and before article-height reads, with a child-only microtask fallback. No product changes were merged.

Leo: “i feel like the app is slow on scrolling thru stuff... claude desktop is 120hz or something and ours is wack + it has sometimes not even rendered stuff!?”

Performance

The paired ABBA rows above retain all samples, including the adverse one. The 120 Hz nightly target remains unmet.

🤖 Generated with Codex

Agent session: agent session

teamleaderleo and others added 2 commits November 3, 2026 14:51
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d60a77e16a11b66e2ecf
…leanup

Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d60a77e16a11b66e2ecf
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review dcf74d7: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr33960 -f ref=lane/transcript-prompt-measure -f platform=macos -f backend_mode=local

Gallery before/after for dcf74d7: 16 states rendered, 0 images differ, 1984 more touched states not rendered. Images are in the run's artifact, not on this public PR; the independent review of this head reads them on its own, so the PR needs no hand-made screenshots of these states.

gh run download 41658418004 -R manaflow-ai/cmux -n gallery-advisory-33960-dcf74d7c2ace4dbf5a58db755d730af6ad9de88a (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.chat-width/standard Apple System Colors Light unchanged 0% own App.tsx
agent-pane.chat-width/standard Apple System Colors unchanged 0% own App.tsx
agent-pane.chat-width/wide Apple System Colors Light unchanged 0% own App.tsx
agent-pane.chat-width/wide Apple System Colors unchanged 0% own App.tsx
agent-pane.chat-width/wide-blocks Apple System Colors Light unchanged 0% own App.tsx
agent-pane.chat-width/wide-blocks Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-edge/short-edge Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-edge/short-edge Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-edge/wide-edge Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-edge/wide-edge Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-edge/no-edge Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-edge/no-edge Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-floats/scrolled-to-end Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-floats/scrolled-to-end Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-floats/composer-grown Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-floats/composer-grown Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-rest-gap/gap-40 Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-rest-gap/gap-40 Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-rest-gap/gap-56 Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-rest-gap/gap-56 Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-rest-gap/gap-72 Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-rest-gap/gap-72 Apple System Colors unchanged 0% own App.tsx
agent-pane.continuation-spacing/shipped Apple System Colors Light unchanged 0% own App.tsx
agent-pane.continuation-spacing/shipped Apple System Colors unchanged 0% own App.tsx
agent-pane.continuation-spacing/two-thirds Apple System Colors Light unchanged 0% own App.tsx
agent-pane.continuation-spacing/two-thirds Apple System Colors unchanged 0% own App.tsx
agent-pane.continuation-spacing/half-tucked Apple System Colors Light unchanged 0% own App.tsx
agent-pane.continuation-spacing/half-tucked Apple System Colors unchanged 0% own App.tsx
agent-pane.continuation-spacing/before Apple System Colors Light unchanged 0% own App.tsx
agent-pane.continuation-spacing/before Apple System Colors unchanged 0% own App.tsx
agent-pane.copy-controls/output Apple System Colors Light unchanged 0% own App.tsx
agent-pane.copy-controls/output Apple System Colors unchanged 0% own App.tsx

Pick other states with a Gallery: entry.id, entry.id/variant line in the PR body.

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Nov 3, 2026
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (claude opus-5.5 medium): SHIP at dcf74d7

Visual verdict: this touches prompt rendering logic (when the fold measurement runs), but the intended appearance is unchanged. There are no images, and the first-paint geometry tests still need fleet results.

This review covers only the seven-line delta; the rest is carried from the SHIP at bc8b4be. Nothing has run yet, so there are no test results or performance numbers, and I claim no speedup.

What I checked in the delta

  • commitMeasurements.ts:19 (early return). flush() still bumps the ticket and clears scheduled before it returns, so a parent drain still cancels a stale microtask fallback. When pending is empty, skipping the generation snapshot and the loops changes nothing: no reads, no applies, no change to generation. Re-entrant enqueues, clear() and the cancel logic are untouched. This fixes my per-commit allocation follow-up.
  • user-prompt-collapse.test.tsx:239-245 (unmount assertion). It now counts reads inside the act. The count is taken after the change and the unmount, and checked again after the microtask a stale fallback would use. This replaces the old assertion, which couldn't fail. I also took the word that all five measuredPrompt callers are awaited.

Follow-ups:

  • [follow-up] user-prompt-collapse.test.tsx:242: the new assertion would also pass if the cancel failed. read() returns before any layout read once its node is disconnected (PromptText.tsx, the isConnected guard). So the test proves no stale read happens after unmount, but not that the cancel is what stops it. To pin the cancel itself, enqueue a counting spy on the queue directly. The existing unit tests in commitMeasurements.test.ts already cover cancellation, so this is optional.

Validation and same-worker ABBA pending. The optional cancellation-specific assertion is already covered by the queue unit tests; the component assertion intentionally verifies observable no-stale-read behavior.

@blacksmith-sh

blacksmith-sh Bot commented Nov 3, 2026

Copy link
Copy Markdown

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
test_every_listed_hook_is_one_glaeda_released_with_the_check (main.SigningHooksInSt
epWithGlaedaTests.test_every_listed_hook_is_one_glaeda_released_with_the_check)/
test_every_listed_hook_is_one_glaeda_released_with_the_check (main.SigningHooksInSt
epWithGlaedaTests.test_every_listed_hook_is_one_glaeda_released_with_the_check)
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Run 41658618283 failed in the measurement wrapper before it executed any checks or benchmarks: the broker's candidate snapshot did not contain historical baseline blobs, so git show 7f6fe51c:.../App.tsx failed. Command duration 0.12 s; no product result.

The isolated comparison now reconstructs the baseline using the exact product-only reverse diff, verifies SHA-256 hashes of both source variants against their original Git objects, and restores the candidate before validation and after the comparison. Candidate tree and fixed harness hashes remain pinned. One corrected dispatch is in flight at the unchanged head dcf74d7c2ace4dbf5a58db755d730af6ad9de88a.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Withdrawing this candidate: correctness and the measurement-order regression passed, but this run does not demonstrate a consistent overall scrolling speedup sufficient to justify the additional queue/microtask machinery. The adverse fling sample is retained, not dismissed as proven noise. No performance or zero-blank acceptance claim.

Run41660063670 passed the full check, 30 unit/component tests, 3 browser tests (first-painted geometry and child-only correction included), and 3 streaming/fold tests. The same browser ordering test fails on the baseline as expected (first read index0 versus at least3 sibling writes). All source/harness/log hashes match; the driver restored the candidate.

Head: dcf74d7c2ace4dbf5a58db755d730af6ad9de88a; baseline: 7f6fe51cc3e65c5b18c93ca45def3fe4073530b4; worker: 7b2ddfbac651b79f
Run: https://github.com/manaflow-ai/cmux/actions/runs/41660063670
Accepted: True; restored: True; error: none

Pass Fling p95 interval (ms) Render-start to commit p95 (ms) Long p95 (ms) Wheel p95 (ms)
1-baseline-timing 124.0/148.0 97.0/106.0 49.0/53.0 31.0/29.0
2-candidate-timing 165.0/116.0 125.0/88.0 45.0/36.0 24.0/23.0
3-candidate-timing 106.0/112.0 72.0/81.0 50.0/45.0 24.0/24.0
4-baseline-timing 112.0/130.0 82.0/80.0 46.0/44.0 24.0/24.0
Coverage pass Scenario Frames Blank frames Blank ms Longest uncovered area (px)
baseline-coverage fling#0 34 1 17 190.5
baseline-coverage fling#1 49 1 16 190.5
baseline-coverage long#0 632 0 0 0
baseline-coverage long#1 647 0 0 0
baseline-coverage wheel#0 481 0 0 0
baseline-coverage wheel#1 481 0 0 0
candidate-coverage fling#0 45 1 16 190.5
candidate-coverage fling#1 41 1 16 190.5
candidate-coverage long#0 671 0 0 0
candidate-coverage long#1 633 0 0 0
candidate-coverage wheel#0 480 0 0 0
candidate-coverage wheel#1 480 0 0 0

Headless diagnostic only. Native/nightly 120 Hz acceptance remains unproven. Render-start to commit is elapsed time, not React CPU time. Separate coverage passes avoid charging DOM sampling to the timing runs.

Metric / paired pass Before After Delta Run
fling#0 p95 interval / AB 124 ms 165 ms +41 ms (+33.1%) same worker
fling#1 p95 interval / AB 148 ms 116 ms -32 ms (-21.6%) same worker
long#0 p95 interval / AB 49 ms 45 ms -4 ms (-8.2%) same worker
long#1 p95 interval / AB 53 ms 36 ms -17 ms (-32.1%) same worker
wheel#0 p95 interval / AB 31 ms 24 ms -7 ms (-22.6%) same worker
wheel#1 p95 interval / AB 29 ms 23 ms -6 ms (-20.7%) same worker
fling#0 p95 interval / BA 112 ms 106 ms -6 ms (-5.4%) same worker
fling#1 p95 interval / BA 130 ms 112 ms -18 ms (-13.8%) same worker
long#0 p95 interval / BA 46 ms 50 ms +4 ms (+8.7%) same worker
long#1 p95 interval / BA 44 ms 45 ms +1 ms (+2.3%) same worker
wheel#0 p95 interval / BA 24 ms 24 ms +0 ms (+0.0%) same worker
wheel#1 p95 interval / BA 24 ms 24 ms +0 ms (+0.0%) same worker

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Withdrawn after same-worker ABBA run41660063670: mixed timing (fling p95 A124/148 → B165/116 → B106/112 → A112/130 ms), with one16ms blank frame per fast fling remaining. Correctness passed; no consistent overall speedup established to justify the added queue complexity. Full evidence is in the preceding report. The 120Hz scroll work continues with the separately scoped formatter candidate; this PR was not merged.

This branch was previously deployed

1 inactive deployment
ci-routing-agent — dcf74d7c Deployed Nov 3, 2026 by teamleaderleo via cmux-tui tree preflight #106548
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant