Skip to content

perf(cmux-tui): avoid temporary graphics area vector - #11055

Merged
lawrencecchen merged 1 commit into
mainfrom
feat-graphics-area-iteration
Aug 28, 2026
Merged

lawrencecchen merged 1 commit into
mainfrom
feat-graphics-area-iteration

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Remove the temporary per-emission PaneArea allocation in emit_graphics_with_scope. Iterate the Copy areas by index, preserving source order and dirty filtering while keeping mutable self access borrow-safe.

Validation: rustfmt --edition 2024 --check; git diff --check. Rust tests were not run on the Mac per cmux-tui policy.


Summary by cubic

Removes the temporary pane area vector in emit_graphics_with_scope to cut allocation overhead in cmux-tui. Iterates the Copy areas by index instead, preserving source order and dirty filtering with no behavior change.

  • Rust tests were not run on the Mac per cmux-tui policy.

Written for commit 9487a6c. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Refactor
    • Streamlined internal pane-area update processing without changing visible behavior.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 69a36ff5-3470-4e96-95b6-015f7f3a5745

📥 Commits

Reviewing files that changed from the base of the PR and between 4a8654b and 1f90b62.

📒 Files selected for processing (1)
  • cmux-tui/crates/cmux-tui/src/app.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The pane-area update loop now iterates over self.pane_areas by index. It skips clean surfaces during partial scans without allocating a temporary vector. Observable behavior remains unchanged.

Changes

Pane Area Update

Layer / File(s) Summary
Direct pane-area iteration
cmux-tui/crates/cmux-tui/src/app.rs
The loop uses indexed iteration and a continue guard instead of pre-filtering pane_areas into a temporary Vec.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 1f90b

This change removes a temporary allocation in the graphics emission path while preserving existing ordering and dirty-surface behavior; no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 25
✅ Passed checks (25 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main performance change: avoiding a temporary graphics-area vector in cmux-tui.
Description check ✅ Passed The description explains what changed, why it changed, and how it was validated. It also states that Rust tests were not run under the documented Mac policy. The change has no UI or behavior change, s…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The diff updates emit_graphics_with_scope to iterate pane_areas by index and applies dirty-surface filtering…
Cmux Swift Blocking Runtime ✅ Passed PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The exact diff only replaces temporary PaneArea vector construction with indexed iteration. No Swift, Objectiv…
Cmux Browser Automation Off-Main ✅ Passed PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs. The diff changes the graphics-area iteration in emit_graphics_with_scope and adds no browser.* socket command, WebKit/pag…
Cmux Expensive Synchronous Load ✅ Passed PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The verified commit diff contains no Swift changes, so the custom check for expensive synchronous loads in produ…
Cmux Cache Substitution Correctness ✅ Passed PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The exact diff updates emit_graphics_with_scope, but the custom check applies only to production Swift, TypeSc…
Cmux No Hacky Sleeps ✅ Passed PASS. The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, which is Rust. The rule applies to TypeScript, JavaScript, shell, and non-Swift build/runtime scripts. The diff only replaces…
Cmux Algorithmic Complexity ✅ Passed PASS. The only changed file is Rust (cmux-tui/crates/cmux-tui/src/app.rs), and the change removes a temporary Vec allocation. The new loop performs one linear pass over pane_areas and average O(…
Cmux Swift Concurrency ✅ Passed PASS. The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The diff introduces no cmux-owned Swift code and no Swift concurrency pattern. The custom check is therefore not…
Cmux Swift @Concurrent ✅ Passed PASS. The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The diff contains no Swift code, async isolation changes, or @concurrent annotations. The Swift-specific che…
Cmux Swift Package Boundaries ✅ Passed PASS. The pull request diff contains only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. It adds no production Swift changes, so the Swift package boundary rule is not applicable.
Cmux Swiftpm Lockfiles ✅ Passed PASS: The PR changes only cmux-tui/crates/cmux-tui/src/app.rs. The parent-to-HEAD diff contains no Package.swift, Package.resolved, .gitignore, workflow, Xcode project, workspace, or dependenc…
Cmux Swift Logging ✅ Passed PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs. The diff adds no Swift code or logging changes, so the Swift logging failure conditions do not apply.
Cmux User-Facing Error Privacy ✅ Passed PASS — The pull request changes only the internal iteration in emit_graphics_with_scope in cmux-tui/src/app.rs. The diff removes a temporary Vec<PaneArea> and adds index-based iteration with the…
Cmux Full Internationalization ✅ Passed PASS: The PR changes only cmux-tui/crates/cmux-tui/src/app.rs. The diff replaces temporary PaneArea collection logic with indexed iteration and a dirty-surface guard. It adds no user-facing text, …
Cmux Swiftui State Layout ✅ Passed PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs. The diff is Rust code in emit_graphics_with_scope; it adds indexed iteration and a dirty-surface guard. No Swift or SwiftUI…
Cmux Architecture Rethink ✅ Passed PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The diff replaces a temporary Vec<PaneArea> with indexed iteration and a dirty-surface guard. It introduces no…
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The diff does not add or modify Swift windows, controllers, identifiers, or close-shortcut routing. The Swift au…
Cmux Source Artifacts ✅ Passed PASS. The PR changes one path: cmux-tui/crates/cmux-tui/src/app.rs. The diff contains only hand-written Rust source changes. No local output, generated logs, screenshots, caches, temporary folders, …
Cmux No Test Or Debug Seam In Production Source ✅ Passed PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The parent-to-HEAD diff contains no Swift file and no production Sources/ path change. Therefore, the Swift pr…
Cmux No Ambient Global State ✅ Passed PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, which is Rust. The diff adds no production Swift declarations or global state. The custom check applies only to production Sw…
Full details: Description check

Explanation

The description explains what changed, why it changed, and how it was validated. It also states that Rust tests were not run under the documented Mac policy. The change has no UI or behavior change, so a demo video is not required. The review-trigger and checklist sections are omitted, but the description remains mostly complete.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 too large.)

Full details: Cmux Swift Actor Isolation

Explanation

PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The diff updates emit_graphics_with_scope to iterate pane_areas by index and applies dirty-surface filtering. It introduces no production Swift changes, so the Swift actor-isolation failure conditions do not apply.

Full details: Cmux Swift Blocking Runtime

Explanation

PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The exact diff only replaces temporary PaneArea vector construction with indexed iteration. No Swift, Objective-C, or runtime synchronization code changed, so the Swift blocking-runtime failure conditions do not apply.

Full details: Cmux Browser Automation Off-Main

Explanation

PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs. The diff changes the graphics-area iteration in emit_graphics_with_scope and adds no browser.* socket command, WebKit/page wait, worker routing, main-actor routing, or policy-test change. The policy applies to the macOS browser socket automation files, which are not changed.

Full details: Cmux Expensive Synchronous Load

Explanation

PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The verified commit diff contains no Swift changes, so the custom check for expensive synchronous loads in production Swift does not apply.

Full details: Cmux Cache Substitution Correctness

Explanation

PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The exact diff updates emit_graphics_with_scope, but the custom check applies only to production Swift, TypeScript, and JavaScript changes. Therefore, its failure condition is not applicable.

Full details: Cmux No Hacky Sleeps

Explanation

PASS. The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, which is Rust. The rule applies to TypeScript, JavaScript, shell, and non-Swift build/runtime scripts. The diff only replaces temporary PaneArea vector collection with indexed iteration and adds a dirty-surface guard. It introduces no sleep, timer, polling, delay, or wall-clock wait.

Full details: Cmux Algorithmic Complexity

Explanation

PASS. The only changed file is Rust (cmux-tui/crates/cmux-tui/src/app.rs), and the change removes a temporary Vec allocation. The new loop performs one linear pass over pane_areas and average O(1) HashSet::contains checks against dirty_surfaces; it does not add a nested full-collection scan, batch rescan, sorting, or filtering hot-path violation. The parent version already filtered each pane area with the same dirty-set lookup, so complexity was not worsened.

Full details: Cmux Swift Concurrency

Explanation

PASS. The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The diff introduces no cmux-owned Swift code and no Swift concurrency pattern. The custom check is therefore not applicable.

Full details: Cmux Swift `@Concurrent`

Explanation

PASS. The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The diff contains no Swift code, async isolation changes, or @concurrent annotations. The Swift-specific check is therefore not applicable.

Full details: Cmux Swiftpm Lockfiles

Explanation

PASS: The PR changes only cmux-tui/crates/cmux-tui/src/app.rs. The parent-to-HEAD diff contains no Package.swift, Package.resolved, .gitignore, workflow, Xcode project, workspace, or dependency changes. Therefore, no SwiftPM lockfile rule is triggered.

Full details: Cmux User-Facing Error Privacy

Explanation

PASS — The pull request changes only the internal iteration in emit_graphics_with_scope in cmux-tui/src/app.rs. The diff removes a temporary Vec&lt;PaneArea&gt; and adds index-based iteration with the same dirty-surface guard. It adds or changes no user-facing errors, alerts, command output, API error bodies, recovery text, diagnostics, or sensitive data.

Full details: Cmux Full Internationalization

Explanation

PASS: The PR changes only cmux-tui/crates/cmux-tui/src/app.rs. The diff replaces temporary PaneArea collection logic with indexed iteration and a dirty-surface guard. It adds no user-facing text, localization keys, catalogs, locale files, or web messages. The changed method contains no string or localization API usage, so the full-internationalization failure conditions do not apply.

Full details: Cmux Swiftui State Layout

Explanation

PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs. The diff is Rust code in emit_graphics_with_scope; it adds indexed iteration and a dirty-surface guard. No Swift or SwiftUI files, state declarations, GeometryReader, lazy/list row code, or render-time state mutation changed.

Full details: Cmux Architecture Rethink

Explanation

PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The diff replaces a temporary Vec&lt;PaneArea&gt; with indexed iteration and a dirty-surface guard. It introduces no Swift architecture change and no sleeps, delayed dispatch, polling, locks, observers, side channels, duplicate entrypoint wiring, or split UI lifecycle ownership. The Swift-specific failure condition is therefore inapplicable.

Full details: Cmux Swift Auxiliary Window Close Shortcuts

Explanation

PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The diff does not add or modify Swift windows, controllers, identifiers, or close-shortcut routing. The Swift auxiliary-window check is therefore inapplicable.

Full details: Cmux Source Artifacts

Explanation

PASS. The PR changes one path: cmux-tui/crates/cmux-tui/src/app.rs. The diff contains only hand-written Rust source changes. No local output, generated logs, screenshots, caches, temporary folders, build artifacts, or other artifact paths were added.

Full details: Cmux No Test Or Debug Seam In Production Source

Explanation

PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The parent-to-HEAD diff contains no Swift file and no production Sources/ path change. Therefore, the Swift production test/debug seam check is not applicable.

Full details: Cmux No Ambient Global State

Explanation

PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, which is Rust. The diff adds no production Swift declarations or global state. The custom check applies only to production Swift changes, so no failure condition is present.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-graphics-area-iteration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lawrencecchen
lawrencecchen force-pushed the feat-graphics-area-iteration branch 9 times, most recently from 14aadd7 to d64c712 Compare August 28, 2026 08:27
@vercel

vercel Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux166 Ready Ready Preview Aug 28, 2026 12:48pm
cmux41 Canceled Canceled Aug 28, 2026 12:48pm

@cursor

cursor Bot commented Aug 28, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@lawrencecchen
lawrencecchen force-pushed the feat-graphics-area-iteration branch from d64c712 to 85ce43a Compare August 28, 2026 09:08
@cursor

cursor Bot commented Aug 28, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@cursor

cursor Bot commented Aug 28, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@lawrencecchen
lawrencecchen force-pushed the feat-graphics-area-iteration branch from b55c527 to 9487a6c Compare August 28, 2026 11:19
@lawrencecchen
lawrencecchen merged commit 6dc9dea into main Aug 28, 2026
56 of 57 checks passed
rustybret pushed a commit to rustybret/bmux that referenced this pull request Aug 28, 2026
6dc9dea perf(cmux-tui): avoid temporary graphics area vector (manaflow-ai#11055)

This branch was successfully deployed

2 active deployments
Preview – cmux166 — 9487a6cc Deployed Aug 28, 2026 by vercel[bot]
Preview – cmux41 — 9487a6cc Deployed Aug 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant