Skip to content

perf(cmux-tui): bench interact, named budgets, record-only perf lane (IX0) - #11688

Closed
lawrencecchen wants to merge 5 commits into
mainfrom
feat-tui-bench-interact
Closed

lawrencecchen wants to merge 5 commits into
mainfrom
feat-tui-bench-interact

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

What this is

IX0 of the zero-wait interaction plan (hq plans/cmux-tui-zero-wait-interaction.md): measure and name before changing behavior. Three commits, no runtime behavior change.

  1. Named budgets. cmux_tui_core::budgets holds every bounded wait the daemon, terminal hosts, and clients enforce, one value per budget, with the interaction stage it belongs to (accept, durable, settle, frame, client, planned) and the code site. The existing constant sites import these values instead of repeating the numbers. cmux diag budgets [--json] prints the table locally, no session needed. No value changed.
  2. cmux bench interact. A client that drives a session over the raw control protocol and records the latencies a frontend or an agent feels per user intent. It sends only existing commands; it adds no protocol command or resource operation.
  3. Record-only perf lane. A full-mode bench interact job runs the benchmark on Linux and macOS, prints the table, and uploads the JSON as cmux-tui-bench-interact-<os>. It is deliberately not in hosted-verification's needs, so it is never a required check. Plus docs/journal-operations.md.

What the bench measures

Per create (round-robin new-workspace / new-tab / split), all from one clock: request to response; request to the first tree_events:"deltas" delta that references the new surface on a separate subscriber (deltas may precede the response, so both time from the write); attach-surface to first render-state; view-only close and process-terminating close to response. Typing: one-byte send on a separate connection and on the create connection, so head-of-line blocking is visible. --clients N runs N concurrent create loops.

Baseline (Linux testbox, 32 vCPU, throwaway session; ms)

The convoy the plan predicts is already visible: at 8 concurrent create loops, create response p50 rises 8x and p99 to ~2.1 s, because every create serializes behind the daemon-wide creation fences, while typing to an existing terminal stays flat.

metric 1 client p50 1 client p99 8 clients p50 8 clients p99
create.response_ms 27.97 67.79 236.53 2128.44
create.visible_ms 27.13 67.86 229.00 2128.61
create.first_frame_ms 0.28 0.37 0.44 24.93
close.surface_response_ms 2.62 3.54 214.55 1536.98
close.terminal_response_ms 3.17 4.40 203.47 2536.94
typing.separate_conn_ms 0.02 0.25 0.02 0.06
typing.same_conn_ms 0.02 0.04 0.02 0.04

macOS arm64 baseline (from the full-run binary) is added below once the full hosted run finishes.

Verification

  • Focused hosted (--filter budgets) and full hosted: URLs below.
  • clippy clean for cmux-tui-core and cmux-tui on the testbox.
  • Unit tests: budgets table/value/stage checks, diag budgets JSON round-trip, bench percentile and delta-matching.

Design: hq plans/cmux-tui-zero-wait-interaction.md (IX0).


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


Summary by cubic

Adds IX0 of the zero-wait interaction plan: names every bounded wait as a budget and adds an interaction-latency benchmark with a record-only CI lane. No runtime behavior changes.

New Features

  • cmux_tui_core::budgets is the single source for every bounded wait; cmux diag budgets [--json] prints it with stage and code site.
  • cmux bench interact drives a session as a client, sending only existing commands, and records create, visibility, first-frame, close, and typing latencies.
  • A record-only CI job runs it on Linux and macOS, uploads the JSON as cmux-tui-bench-interact-<os>, and is never required; docs/journal-operations.md documents both.
  • Baseline on the testbox shows create response p50 rising 8x at 8 concurrent clients while typing stays flat.

Verification

  • Focused and full hosted verification passed; clippy clean; unit tests cover budgets, diag JSON, bench percentiles, and visibility matching.
  • A new test requires the public resource boundary scan to be clean.

Written for commit 738f47a. Summary will update on new commits.

Review in cubic

@vercel

vercel Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
cmux166 Canceled Canceled Sep 3, 2026 12:45pm UTC
cmux41 Canceled Canceled Sep 3, 2026 12:45pm UTC

@coderabbitai

coderabbitai Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: e517fcbf-5106-41e4-8757-dfe12be14207

📥 Commits

Reviewing files that changed from the base of the PR and between f1c912b and 738f47a.

📒 Files selected for processing (19)
  • .github/workflows/cmux-tui.yml
  • cmux-tui/crates/cmux-tui-core/src/budgets.rs
  • cmux-tui/crates/cmux-tui-core/src/journal_ingress.rs
  • cmux-tui/crates/cmux-tui-core/src/lib.rs
  • cmux-tui/crates/cmux-tui-core/src/mux.rs
  • cmux-tui/crates/cmux-tui-core/src/server.rs
  • cmux-tui/crates/cmux-tui-core/src/terminal_host_runtime.rs
  • cmux-tui/crates/cmux-tui/src/app.rs
  • cmux-tui/crates/cmux-tui/src/cli.rs
  • cmux-tui/crates/cmux-tui/src/cli/command.rs
  • cmux-tui/crates/cmux-tui/src/cli/diag.rs
  • cmux-tui/crates/cmux-tui/src/cli/internal/bench.rs
  • cmux-tui/crates/cmux-tui/src/cli/internal/mod.rs
  • cmux-tui/crates/cmux-tui/src/local_owner.rs
  • cmux-tui/crates/cmux-tui/src/session/remote.rs
  • cmux-tui/docs/README.md
  • cmux-tui/docs/journal-operations.md
  • cmux-tui/scripts/test_check_resource_api_boundary.py
  • cmux-tui/spec/cli.md

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.

@github-actions

github-actions Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

lawrence703 and others added 5 commits September 2, 2026 07:48
…ag budgets

One module, cmux_tui_core::budgets, holds every bounded wait the daemon,
terminal hosts, and clients enforce. The existing constant sites import
these values instead of repeating the numbers, so there is exactly one
value per budget. 'cmux diag budgets' prints the table locally with the
stage each budget belongs to and the code site that enforces it. No
value changes. IX0 of the zero-wait interaction plan.
…chmark

cmux bench interact drives a session as an ordinary client over the raw
control protocol and records the latencies an interactive frontend or an
agent feels per user intent: create request to response, request to the
tree delta that makes the resource visible on a separate deltas subscriber,
attach to first render frame, close to response, and one-byte typing on
both a separate connection and the create connection (so head-of-line
blocking is visible). --clients N runs N concurrent create loops. With no
socket or session it starts and stops a throwaway session. It sends only
existing commands and adds no protocol command or resource operation.
IX0 of the zero-wait interaction plan.
…ns doc

A full-mode 'bench interact' job builds the server, runs the benchmark
against a throwaway session on Linux and macOS runners, prints the table
in the job log, and uploads the JSON as cmux-tui-bench-interact-<os>. It is
deliberately not in hosted-verification's needs, so it is never a required
check; it records the IX0 baseline, not a threshold. Adds
docs/journal-operations.md describing the budgets verb and the bench
metrics. IX0 of the zero-wait interaction plan.
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

This benchmark series is superseded by #11697, which contains the visibility and barrier follow-up. The current head also fails the live conformance compile and is stale against main. Closing the duplicate; #11697 remains held for a current-main safety and observability repair.

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Closed as superseded by #11697.

This branch was successfully deployed

2 active deployments
Preview – cmux41 — 738f47a9 Deployed Sep 3, 2026 by vercel[bot]
Preview – cmux166 — 738f47a9 Deployed Sep 3, 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.

2 participants