Skip to content

perf(transcript): skip unchanged prompt measurement state - #33579

Merged
teamleaderleo merged 6 commits into
feat-cmux-nextfrom
lane/prompt-measure-confirmation
Nov 3, 2026
Merged

teamleaderleo merged 6 commits into
feat-cmux-nextfrom
lane/prompt-measure-confirmation

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

When a prompt’s measured height confirms the initial clamp estimate, PromptText now keeps its existing state. Short and long prompts each avoid the extra confirmation-only React commit; real height changes still correct the clamp before paint. The ResizeObserver retains its existing cleanup. No visual design, overscan, or native logic changes.

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

Same-worker source A/B in run 41622412408: baseline PromptText from a567667 versus aaac6e7, with the same candidate tests and harness. Only PromptText.tsx is swapped. Two rounds are shown in order, not averaged. Timing and painted coverage run separately.

Metric Before After Delta Harness or run link
Short/long confirmation commits 2 / 2 1 / 1 −1 / −1 unit red/green
Fling interval p95 (ms), rounds 0/1 39 / 40 41 / 40 +2 / 0 3000-row WebKit bench
Fling longest frame (ms) 45 / 47 52 / 57 +7 / +10 same run
Fling React p95 (ms) 27 / 30 32 / 29 +5 / −1 same run
Fling dropped frames/s, nominal 120 Hz 82.447 / 84.218 84.109 / 82.614 +1.662 / −1.603 same run
Fling painted blank frames 1 / 1 1 / 1 0 / 0 separate painted-coverage pass, same run
Fling painted blank time (ms) 16 / 17 17 / 16 +1 / −1 same run
Long-scroll interval p95 (ms) 22 / 22 22 / 22 0 / 0 same run
Long-scroll painted blank frames 0 / 0 0 / 0 0 / 0 same run
Wheel interval p95 (ms) 21 / 21 21 / 21 0 / 0 same run
Wheel painted blank frames 0 / 0 0 / 0 0 / 0 same run

The deterministic result is one fewer confirmation commit. This run establishes no overall fling speedup; blanking remains unchanged. These headless timings do not establish native/nightly 120 Hz presentation. The remaining mount-cost and first-motion work is tracked separately in #33624 and #33629.

Validation: full web check passes, including format, lint (zero warnings), type check and generated protocol. All 17 prompt tests pass on the candidate; the baseline has exactly the two expected confirmation-commit failures and 15 passes. Source hashes match both specified variants and the tested snapshot tree matches the reviewed candidate. All eight routed webview verdict shards are green at aaac6e7.

Independent Opus 5.5 medium product SHIP, with the test-only lint delta independently reviewed and carried to this exact head. Primary inspection agrees. Risk: prompt clamp measurement; tests cover initial confirmation and later observer corrections.

Base-red attribution: test_ci_warm_sources.py::ThisTree.test_every_compile_job_names_its_warm_sources fails at this head in job 125864106174 and at base 5dee1ab in job 125855765106, with the identical error: stable-next.yml:swift-suites is exempt but its steps wire ['deriveddata-reuse']; list them under 'warm' instead. Guard status aggregates that same failure. Neither is introduced here; both full web check and routed per-test verdicts passed.

The review’s commit-profiler note needs no new behavior: the exact ['mount'] assertion already fails closed if profiling callbacks do not run. The requested baseline/head evidence is now recorded above.

🤖 Generated with Codex

Agent session: agent session

teamleaderleo and others added 5 commits November 3, 2026 07:47
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d60a77e16a11b66e2ecf
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d60a77e16a11b66e2ecf
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-b2f8bf910242d7b9370a
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-b2f8bf910242d7b9370a
@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 aaac6e7: 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=pr33579 -f ref=lane/prompt-measure-confirmation -f platform=macos -f backend_mode=local

Gallery before/after for aaac6e7: 16 states rendered, 2 images differ, 1016 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 41620293434 -R manaflow-ai/cmux -n gallery-advisory-33579-aaac6e7187dcbc1ac8fefade25bfd5007766fb59 (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.prompt-markdown/plain Apple System Colors Light unchanged 0% own PromptText.tsx
agent-pane.prompt-markdown/plain Apple System Colors unchanged 0% own PromptText.tsx
agent-pane.prompt-markdown/markdown Apple System Colors Light unchanged 0% own PromptText.tsx
agent-pane.prompt-markdown/markdown Apple System Colors unchanged 0% own PromptText.tsx
agent-pane.user-bubble/claude Apple System Colors Light unchanged 0% own PromptText.tsx
agent-pane.user-bubble/claude Apple System Colors unchanged 0% own PromptText.tsx
agent-pane.user-bubble/prompt-hover Apple System Colors Light unchanged 0% own PromptText.tsx
agent-pane.user-bubble/prompt-hover Apple System Colors unchanged 0% own PromptText.tsx
agent-pane.user-bubble/running-edit-branches Apple System Colors Light changed 0.0063% own PromptText.tsx
agent-pane.user-bubble/running-edit-branches Apple System Colors changed 0.0056% own PromptText.tsx
agent-pane.user-bubble/finished-original-branch Apple System Colors Light unchanged 0% own PromptText.tsx
agent-pane.user-bubble/finished-original-branch Apple System Colors unchanged 0% own PromptText.tsx
agent-pane.user-bubble/answer-hover Apple System Colors Light unchanged 0% own PromptText.tsx
agent-pane.user-bubble/answer-hover Apple System Colors unchanged 0% own PromptText.tsx
agent-pane.user-bubble/prompt-time-tooltip Apple System Colors Light unchanged 0% own PromptText.tsx
agent-pane.user-bubble/prompt-time-tooltip Apple System Colors unchanged 0% own PromptText.tsx
agent-pane.user-bubble/answer-time-tooltip Apple System Colors Light unchanged 0% own PromptText.tsx
agent-pane.user-bubble/answer-time-tooltip Apple System Colors unchanged 0% own PromptText.tsx
agent-pane.user-bubble/other Apple System Colors Light unchanged 0% own PromptText.tsx
agent-pane.user-bubble/other Apple System Colors unchanged 0% own PromptText.tsx
agent-pane.attachment-source/before Apple System Colors Light unchanged 0% imports PromptText.tsx (1 hops)
agent-pane.attachment-source/before Apple System Colors unchanged 0% imports PromptText.tsx (1 hops)
agent-pane.attachment-source/corner Apple System Colors Light unchanged 0% imports PromptText.tsx (1 hops)
agent-pane.attachment-source/corner Apple System Colors unchanged 0% imports PromptText.tsx (1 hops)
agent-pane.attachment-source/small Apple System Colors Light unchanged 0% imports PromptText.tsx (1 hops)
agent-pane.attachment-source/small Apple System Colors unchanged 0% imports PromptText.tsx (1 hops)
agent-pane.attachment-source/labelled Apple System Colors Light unchanged 0% imports PromptText.tsx (1 hops)
agent-pane.attachment-source/labelled Apple System Colors unchanged 0% imports PromptText.tsx (1 hops)
agent-pane.attachment-source/outside Apple System Colors Light unchanged 0% imports PromptText.tsx (1 hops)
agent-pane.attachment-source/outside Apple System Colors unchanged 0% imports PromptText.tsx (1 hops)
agent-pane.prompt-after-tool-rows/centered Apple System Colors Light unchanged 0% imports PromptText.tsx (1 hops)
agent-pane.prompt-after-tool-rows/centered Apple System Colors unchanged 0% imports PromptText.tsx (1 hops)

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

Shipped in:

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

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

Visual verdict: unchanged by this diff. There are no images, and the rendered fold is the same in every state. The only difference is that a measurement agreeing with the guess no longer triggers a re-render.

What I checked, by reading the code only:

  • Mount. The fold now compares the measurement with the value currently shown (last?.parts === parts ? last.long : guess), not with the stored record. When the measurement agrees with the guess, it keeps last (undefined on mount), so there is no second commit. long still comes out as guess, which is what is shown.
  • Prompt text changes. If a new prompt's measurement agrees with its guess, the old record stays. That is harmless: the record no longer matches the new parts, so long falls back to guess, which equals the measurement. A measurement that disagrees writes {parts, long: next} as before. A later width change back toward the guess compares against the stored long and updates correctly.
  • Width changes. The ResizeObserver closure is renewed each time the effect re-runs on parts, guess, long or open, so it always compares against the current render's guess and parts. Adding guess to the dependencies does no harm, because it only changes when parts changes.
  • Huge prompts. long = huge || … is unchanged, so a measurement of the head still can't unclamp it. This path behaves the same as on base.
  • Cleanup. The observer still disconnects on effect cleanup, and nothing new was added that needs a stop.
  • Do the tests catch the regression? Yes, on paper. In the short-prompt and long-prompt tests, base would write a new record on the first measurement and commit an update after mount, so commits === ["mount"] should fail on base and pass at head. The width and new-content tests walk both directions of the stale-record case, and I traced the clamped and whole-text height paths through each step; the expected results hold. The fixture restores the patched scrollHeight, the Range box, getComputedStyle and ResizeObserver in finally.

Not run: none of the tests have been run yet, and there is no before/after perf measurement. My statement that the tests fail on base and pass at head is from reading the code, not from a run.

Follow-ups:

  • [follow-up] The commit-count assertions rely on Profiler onRender firing, which happens only in development or profiling React builds. If the Bun test ever runs with NODE_ENV=production, commits will be [] and these tests will fail rather than check anything. Consider asserting that commits.length > 0 before comparing.
  • [follow-up] When the PR body gets the fleet results, record the base failure and head pass of the first two tests.

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

cursor Bot commented Nov 3, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@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_compile_job_names_its_warm_sources (main.ThisTree.test_every_compile_job
_names_its_warm_sources)/
test_every_compile_job_names_its_warm_sources (main.ThisTree.test_every_compile_job
_names_its_warm_sources)
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

Review (subagent Codex, GPT-6; exact runtime model identifier not exposed): SHIP at aaac6e7

Scope: the one-line test-only delta from d1b713c. The preceding assertion guarantees one registered observer, so invoking its first value once preserves the copied loop's behavior even when React replaces the observer during the callback. Effect cleanup removes the registered callback. The prior product review remains separate.

Visual verdict: unchanged by this diff. Follow-ups: none. Read-only inspection; no tests or builds run. The runtime exposes Codex/GPT-6 identity but no precise model variant; none is inferred from a default or configuration.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

The lint warning is repaired at aaac6e7; scoped vp lint and static prepush pass, with a one-line independent review. A/B attempt41620540093 then failed before lint/tests because my wrapper started in webviews and tried cd webviews again. No performance conclusion comes from that run.

The wrapper now resolves the repository root explicitly. One corrected same-head run is dispatched: 41622412408. Product source is unchanged; the existing Opus product review and test-only delta review remain separate from the pending runtime result.

@teamleaderleo teamleaderleo left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review (claude-opus-5-5): SHIP at aaac6e7

Review (claude-opus-5-5 medium): SHIP at aaac6e7

This carries my product SHIP (comment 6600776259) from d1b713c. Reviewed scope: d1b713c..aaac6e7, one commit, one line in webviews/test/user-prompt-collapse.test.tsx. It replaces for (const changed of [...observers]) changed(); with observers.values().next().value!();. The line just above asserts observers.size is 1, so this calls the same single observer without copying the set. Same behaviour; test-only; no product code changed.

Follow-ups: none.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

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

Visual verdict: unchanged by this diff. There are no images, and the delta changes no product or UI code.

What I reviewed. Only the one-line change in webviews/test/user-prompt-collapse.test.tsx, inside the resize helper of measuredPrompt. Looping over a copy of observers and calling each entry is replaced by calling just the first one, observers.values().next().value!(). I took your word that the product source is byte-identical to d1b713c and did not re-review it. I ran nothing; the fleet results in your message are yours, not mine.

Same behavior as before. The line just above it, expect(observers.size).toBe(1), makes sure there is exactly one observer. So calling the first entry runs the same callback, once, inside the same act. The callback is still called without a this, as before; it is the component's measure closure, which doesn't use this. The ! only removes the undefined from the type, and the size check means the value is always there. If the component ever registers zero or two observers, the test still fails at that size check, so the new form can't hide a lifecycle bug. Nothing else in the fixture changed, including setup, restore and the exact ["mount"] commit assertions.

The earlier review still holds. My SHIP at d1b713c found nothing blocking. My Profiler note is resolved, as you say: if the profiler callbacks never fire, commits stays empty and the exact ["mount"] assertion fails.

Follow-ups: none.

Owner verification: the complete d1b713c..aaac6e7 diff is exactly that single test line; product code is unchanged. This is the original Opus reviewer’s delta re-review and final-head confirmation.

@teamleaderleo
teamleaderleo merged commit 6a15959 into feat-cmux-next Nov 3, 2026
231 of 233 checks passed
@teamleaderleo
teamleaderleo deleted the lane/prompt-measure-confirmation branch November 3, 2026 11:36

This branch was previously deployed

1 inactive deployment
ci-routing-agent — aaac6e71 Deployed Nov 3, 2026 by teamleaderleo via cmux-tui tree preflight #105518
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