Repository navigation
perf(home): a streamed talk token wakes no whole-message Home view - #33945
Conversation
…e (red) HOT PATH AUDIT area F (handoff/hot-path-audit/stream/AUDIT.md). Home's default shows whole messages, so a streamed talk token changes nothing on screen, yet each token runs every open view's projection pass on the main thread (HomeProjectionInputs carries the reply text). The test streams 1,500 tokens of the Chief's live run over a 2,000-message history with 1 and 4 views open and prints HOMETOKEN lines: the store's and the views' main-thread time per token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e-message view (red) observedWakes counts the projection's store observation wakes (test seam, as refreshPasses). The token cost test now also runs the real observation path after each token and expects no wake and no pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HOT PATH AUDIT area F, row H1 (handoff/hot-path-audit/stream/AUDIT.md). Home's default shows each reply whole, so a talk token changes nothing on screen. Yet every token assigned the store's whole live dictionary, woke every open Home view's observation, and each view's inputs (which carried the reply text) differed, so each ran an O(transcript) projection pass on the main thread. - HomeStore.publishLive updates only the token's conversation: live[c], streams[c] and the new runShapes[c] (HomeLiveBook.shown(in:) joins only that conversation's runs; before, every live run of every conversation was joined and compared per token). - HomeRunShape: what a whole-message view draws of the running replies (who writes, the activity line, the thought headline), never the text. Such views observe and compare it instead of streams and liveRun, so a talk token leaves them asleep; typing dots, the activity line and the headline still wake them. - Streaming mode (HomeReplyDisplay.streaming) reads the text as before. Chromium does the same: a renderer paints only what changed in what it shows (damage), and invisible state does not invalidate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
|
Proof steps (fleet):
|
|
Review (hpa-stream-reviewer-1): FIX at f3fc589 The design is correct, but one line adds wakes that the base did not have. It is a one-line fix plus a test. F1 (major, perf regression on the same hot path):
What I checked and found correct
Not run: I did not compile or run tests (no local builds). I relied on the fleet results that were given: red e7dcb7a9fe2d, green 31afca435e8d. |
…w (red) Review of #33945 (hpa-stream-reviewer-1, F1): publishLive compared the stored optional shape with a non-optional empty shape, so every thought token before the run had reply text or an activity line wrote nil over nil and woke every whole-message view. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #33945 (F1): compare the shape as it is stored (nil when nothing runs), so thought tokens before any reply text write nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review F1 fixed at 68ec51f.
|
|
Review (hpa-stream-reviewer-1): SHIP at 68ec51f Findings:
Not run: I did not compile or run tests (no local builds). Fleet evidence: red e7dcb7a9fe2d and 645cb4522982, green c7276cf318b8 (6 suites), compile bcfc25206872. |
…am-home-token # Conflicts: # scripts/cmux-next/perf-hot-benches.json
|
Merged feat-cmux-next (after #33947 landed, lead decision 6) at dbcc0a5. The only conflict was scripts/cmux-next/perf-hot-benches.json; it now keeps both entries (acpmux-wait-wake from #33947, home-stream-token from this PR).
|
|
Review (hpa-stream-reviewer-1): SHIP at dbcc0a5 Findings:
Not run: I did not compile or run tests (no local builds). Fleet evidence: compile 3dbff13c8801, green d58773ffcb3f (6 suites). Job 2e215880271b gave no verdict because of a DNS failure at checkout, and I do not count it. |
|
Checks at dbcc0a5: |
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Shipped in:
|
|
Swift logic follow-up (tip watcher swift-logic row, STATUS 13027 "SWIFT LOGIC CULPRITS"; lead order). This PR raised
plans/cmux-next/layer-ownership.md says Rust owns every state, list and rule and Swift is the platform shell. Please move the new logic of this PR in a follow-up: to Rust (the crate that owns the area; the owner lists in STATUS 12147-12165 name the target per area), or at least out of the app into its package. If a declaration above is platform code (AppKit, Core Animation, OS calls, strings, tokens, DEBUG tooling), reply here and the table gets a PLATFORM row with your reason instead. The swift-logic row is a report, not a gate: nothing blocks on this comment. |
Summary
HOT PATH AUDIT area F, row H1 (AUDIT.md). Home shows each Chief reply whole by default, so a streamed talk token changes nothing on screen. Yet each token:
HomeLiveBook.shown), then assigned the wholelivedictionary;The fix:
publishLiveupdates only the token's conversation (live[c],streams[c], newrunShapes[c]).HomeRunShape: what a whole-message view draws of the running replies (who writes, the activity line, the thought headline), never the text. Whole-message views observe and compare it, so a talk token does not wake them. Typing dots, the activity line and the headline still wake them.HomeReplyDisplay.streaming) reads the text as before.New perf-hot path id
home-stream-token(scripts/cmux-next/perf-hot-benches.json).Testing
Red test first:
HomeWholeMessageTokenCostTests(MessagesLab). It streams 1,500 tokens of the Chief's live run over a 2,000-message history with 1 and 4 views open. It expects 0 store-observation wakes and 0 projection passes, and printsHOMETOKENlines (ms per token on the main thread).Observed / Not run
package-test-lane.sh suite Packages/Shared/CmuxMessagesLab HomeWholeMessageTokenCostTests). The branch waits for a Mac lane line (STATUS 9221). The existing Home streaming suites (HomeStreamingPerfTests, HomeStreamStressTests, HomeMidStreamSendTests, DragWhileStreamingTests) are not run yet either.Changelog
No capture: no visible change; only main-thread work per token goes down.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Stops a streamed talk token from slowing typing and scrolling in Home. Home shows each Chief reply whole by default, so a token changes nothing on screen — yet before, every token rebuilt and compared the live state of every conversation, woke each open view's store observation, and ran an O(transcript) projection pass on the main thread.
Changes
publishLivenow updates only the token's conversation (live[c],streams[c], newrunShapes[c]).HomeRunShape(who writes, the activity line, the thought headline — never the text); whole-message views observe it, so a talk token leaves them asleep while typing dots, the activity line and the headline still wake them. Streaming mode reads the text as before.home-stream-tokenandHomeWholeMessageTokenCostTests(1,500 tokens, 2,000-message history, 1 and 4 views) expecting 0 wakes and 0 projection passes, plus a test for thought-before-reply tokens.Written for commit 3b67a48. Summary will update on new commits.