Skip to content

perf(chat): reduce speculative mounts during large transcript flings - #33543

Closed
teamleaderleo wants to merge 5 commits into
feat-cmux-nextfrom
lane/transcript-fling-mount-cost
Closed

teamleaderleo wants to merge 5 commits into
feat-cmux-nextfrom
lane/transcript-fling-mount-cost

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

A fast transcript fling currently mounts the capped directional band plus two predicted landing windows. This candidate omits that intervening band only when a single scroll step exceeds the four-viewport cap, while retaining one viewport on either side of the current view and both predicted windows. Moves of four viewports or less retain the existing contiguous lead.

HOLD: This PR's same-worker A/B validation, strict slowdown/reversal coverage, independent review, and webview verdict are outstanding. Do not land until those results establish that it helps without worsening blank frames.

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!?"

The implementation and focused regression tests are complete; verification is pending. This ordinary PR enables the fleet test route. It makes no performance-improvement or native 120 Hz claim. Stacked on #33358; the harness is identical in both A/B variants.

Risk: a six-viewport step followed by a two-viewport slowdown can enter the omitted band before the next mount commit. The new browser regression checks abrupt slowdown and reversal in both directions with zero blank frames, in the middle of the transcript. Reject this candidate if coverage worsens. No App.tsx, first-paint, initial rail entrance, Swift, timers, warm-window quantization, or idle-decay changes.

Prior art: #19981 introduced the predicted windows and kept the capped band for uneven drags; this preserves both predictions and the existing 2–4 viewport drag path. #31320 warm-window quantization, #31760 idle lead decay, and #32837 indexed geometry remain intact. Design spec: leo-workspace design/chat-transcript.md; presentation is unchanged.

Metric Before After Delta Harness or run link
Fast fling React p95, two rounds 74 / 68 ms Pending Pending Shared 3000-row harness
Fast fling blank frames / blank time Same-worker baseline pending Pending Pending Separate coverage pass in scroll-lead-ab.py

Validation completed: changed-file formatting, light web lint with type-aware checks deferred to fleet, prepush-gate (no new violations), git diff --check, and Python syntax. Browser tests, range tests, A/B timing and coverage have not run for this head.

Fleet command, after installing webviews dependencies and WebKit:

python3 scripts/cmux-next/scroll-lead-ab.py --baseline a567667a8f6f55c580f494a38eeec9554108c88e --out /tmp/scroll-lead-ab

The runner records exact commits, host, per-command exit status, and logs; restores model.ts after each comparison; and keeps timing separate from coverage sampling. It changes only scrollLeadRanges between variants and uses the same regression tests and benchmark for both.

🤖 Generated with Codex

Agent session: agent session


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


Summary by cubic

Fast transcript flings currently mount the capped directional band plus two predicted landing windows. This candidate skips that intervening band only when a single scroll step exceeds the four-viewport cap, keeping one viewport on either side of the current view plus both predicted windows; moves of four viewports or less keep the existing contiguous lead. The change is held for same-worker A/B validation, slowdown/reversal coverage, and review, and makes no performance-improvement claim.

Verification

  • scripts/cmux-next/scroll-lead-ab.py runs the existing benchmark and browser regressions against baseline and candidate model.ts, isolating only scrollLeadRanges and restoring the original source on exit.
  • New browser regression flings with an abrupt slowdown-and-reversal pattern from mid-transcript and requires zero blank frames in both directions.
  • New range tests check the large-skip path mounts fewer rows while covering the current view and both predictions, and that ordinary scroll and uneven-drag steps keep the contiguous lead.

Written for commit fa55874. Summary will update on new commits.

View guided diff Turn on auto-fix

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-fc0fa4c5ed2467ab49a6
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-fc0fa4c5ed2467ab49a6
Base automatically changed from lane/transcript-scroll-120hz-b to feat-cmux-next November 3, 2026 09:52
@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

Same-worker A/B run 41613313474 completed at fa55874. The failure is the new reversal test, identically on baseline and candidate; it is not a slower candidate or an infrastructure failure.

Metric Before (two rounds) After (two rounds) Delta Run
Fling interval p95 44 / 44 ms 42 / 42 ms -2 / -2 ms linked above
Fling React p95 31 / 32 ms 31 / 31 ms 0 / -1 ms linked above
Long-scroll interval p95 22 / 22 ms 22 / 21 ms 0 / -1 ms linked above
Painted blank frames per fling 1 / 1 1 / 1 0 linked above
Blank-area time 16 / 16 ms 16 / 16 ms 0 linked above

Both reversal logs show the same eight uncovered samples. The intended middle-start test actually starts near the bottom: first position 243831 in a range ending at 248031. Assigning scrollTop without reader intent appears to let follow/measurement logic restore the bottom before sampling. Repeated bottom samples also include intentional 24 px tail room. This test needs correct reader-intent setup and the shared coverage oracle; its zero-blank assertion should remain strict.

The range unit regression is red on baseline and green on candidate, and full web checks passed. However, this range reduction does not solve blanking and its ~4.5% interval improvement is too small to justify the unproven deceleration coverage tradeoff. I am withdrawing this candidate and keeping the existing predictive windows. Product work continues in #33579 (confirmation-only prompt renders) and a separate mounted-row height-read batching change. These numbers cannot be compared directly with older measurements on different workers.

@cmux-bot

cmux-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

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

Yours to fix: transcript-fling.test.ts (a file this PR changes). Seen on other PRs too (likely flaky): transcript-upward-anchor.test.ts.

CI failed on fa558744c6 (run 41613170802 attempt 1): 1 code, 1 unknown.

Job Verdict Why
web / react-apps-base-check (6) code a web test failed
web / react-apps-check unknown no known signature; failed step: Check webview test shards

Failures:

  • seen on other PRs transcript-upward-anchor.test.ts received card folds preserve painted row-box adjacency while streaming: failed (job)
  • yours transcript-fling.test.ts a fast fling can abruptly decelerate and reverse without blanking: failed (job)
Matched log lines
web / react-apps-base-check (6): (fail) received card folds preserve painted row-box adjacency while streaming [11125.52ms]

Not re-run automatically: web / react-apps-base-check (6), web / react-apps-check are not machine failures.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Withdrawing this candidate: same-worker A/B showed only 44 to 42 ms fling p95, unchanged 1 blank frame / 16 ms per fling, and a reversal fixture that does not establish safety. Evidence: #33543 (comment). Preserve the existing predictive range; product work continues in #33579, #33624 and #33629.

This branch was previously deployed

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