Skip to content

cmux-tui: a new build stamp no longer recompiles cmux-remote or acpmux - #22030

Closed
lawrencecchen wants to merge 5 commits into
feat-cmux-nextfrom
feat-cmux-next-tui-stamp-runtime2
Closed

lawrencecchen wants to merge 5 commits into
feat-cmux-nextfrom
feat-cmux-next-tui-stamp-runtime2

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This is the follow-up to #21980. #21980 is merged into feat-cmux-next. This branch is rebased on feat-cmux-next, so the diff has only the change of this PR (3 commits).

When the Linux build pool builds a new stamp, cmux-remote and acpmux no longer recompile.

  • cmux-remote: ssh_bootstrap.rs read CMUX_TUI_DISTRIBUTION_VERSION and CMUX_TUI_NPM_BOOTSTRAP_VERSION with option_env!. The pool sets the first to 0.0.0-r2.sha-<stamp>. The two constants move to the binary (cmux-tui/src/distribution.rs) with the same values and the same fallback (CARGO_PKG_VERSION). SshBootstrapConfig::defaults now takes them as arguments, as it already takes build_identity. The cmux-remote tests pass the same values.
  • acpmux: Its build script reran on every new CMUX_GIT_SHORT_SHA and SOURCE_DATE_EPOCH (the pool sets both for each stamp) and on every commit. A rerun recompiles every target of the package (17 s).
    • The script moves to a new leaf crate, acpmux-build-id. The logic does not change. The git calls still run in the acpmux crate directory, and the dirty check and the rerun-if-changed paths are still acpmux's.
    • acpmux reads the id through hub::build(). With its default build-id feature (the standalone acpmux binary and the acpmux tests), the stamped value is the default.
    • cmux-tui uses default-features = false, depends on acpmux-build-id itself, and installs the same value in main(), next to install_build_stamp.
    • acpmux --version uses hub::version_line(), which gives the same text.
  • cmux-build-identity: No change.
    • In the pool, its build script takes less than 0.05 s for each stamp, because the pool sets CMUX_TUI_BUILD_TIME. When CMUX_TUI_BUILD_COMMIT is set, the script already skips the git source walk.
    • The 8.8 s in the cmux-tui: a new build stamp no longer recompiles cmux-tui-core #21980 measurement came from the proof setup and not from the pool. My fake stamp aaaa… is not in the Testbox repository, and that repository is a partial clone (blob:none). So git log -1 --format=%ct <stamp> in build_time() started a lazy fetch from GitHub. With a real local commit, or with CMUX_TUI_BUILD_TIME set, the script ran in 0.00 s.

Proof (Blacksmith Testbox, 32 vCPU)

Command: cargo build -v --timings -p cmux-tui --bin cmux-tui --locked. The settings are the pool Linux twin settings (CARGO_INCREMENTAL=0, CARGO_PROFILE_DEV_DEBUG=0). Every stamp variable follows the stamp, as in build-cmux-tui-source.sh: CMUX_TUI_BUILD_COMMIT, CMUX_TUI_GHOSTTY_COMMIT, CMUX_TUI_DISTRIBUTION_VERSION=0.0.0-r2.sha-<stamp>, CMUX_GIT_SHORT_SHA, SOURCE_DATE_EPOCH, CMUX_TUI_BUILD_TIME. The stamps are A=aaaa… and B=bbbb….

tree stamp change wall recompiled
before (#21980 head dc61324) A to B 35.1 s acpmux 17.2 s, cmux-remote 9.9 s, cmux-tui 20.4 s
before B to A 35.2 s acpmux 17.3 s, cmux-remote 10.3 s, cmux-tui 20.5 s
after (a501c02) A to B 21.0 s cmux-tui 20.1 s (acpmux-build-id and cmux-build-identity less than 0.05 s each)
after B to A 20.6 s cmux-tui 19.6 s

Together with #21980, a new stamp went from about 52 s to about 21 s on the twin. The feat-cmux-next base before #21980 took 51.5 s and 52.5 s.

Readers, before and after, with the same stamp. All values are identical:

--version:          cmux 0.1.0 (aaaa…; ghostty cccc…)
acpmux --version:   acpmux 0.1.0 (aaaaaaaaa 2026-10-14)
remote-probe --json: distribution_version=0.0.0-r2.sha-aaaa…, npm_bootstrap_version=None, build_identity=aaaa…, build_time=1792000000
identify / ping:    build_commit=aaaa…, ghostty_commit=cccc…, build_id=aaaa…

For B, every reader reports bbbb…, bbbbbbbbb 2026-10-15 and 1792100000.

Binary differences between A and B (equal sizes). The sections with differences are the same before and after this PR, so this PR adds no new kind of difference:

  • before: .rodata 7407, .text 3897, .rela.dyn 839, .symtab 116, .note.gnu.build-id 20 bytes
  • after: .rodata 7337, .text 3910, .rela.dyn 845, .symtab 114, .note.gnu.build-id 20 bytes

These numbers are larger than the 380 bytes in #21980. Here the pool stamps change string lengths (distribution version, short SHA, date), so code and relocations that refer to .rodata move.

Tests (Testbox)

  • cargo fmt --check for acpmux, acpmux-build-id, cmux-remote and cmux-tui: ok
  • cargo test -p cmux-remote --test ssh_cross_platform_bootstrap: 17 passed (bootstrap with the passed distribution version)
  • cargo test -p cmux-tui --test cli remote_update_need: 5 passed
  • cargo clippy --all-targets -D warnings for acpmux, acpmux-build-id, cmux-remote and cmux-tui: ok. Also -p acpmux --no-default-features: ok.

I ran the timing proof at a501c02. The 2 later commits are a rustfmt change and one path qualification.

No new tests. Cargo.lock gains the acpmux-build-id package (path crate, no new external dependency).

🤖 Generated with Claude Code


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


Summary by cubic

A new build stamp from the Linux pool now recompiles only cmux-tui; cmux-remote, acpmux, and cmux-tui-core no longer do. This cuts the per-stamp rebuild from about 52 s to about 21 s.

  • Stamped distribution versions move to the binary (distribution.rs) and pass into SshBootstrapConfig::defaults; the build and Ghostty commits install into cmux-tui-core at the top of main via install_build_stamp.
  • acpmux's build script moves to the leaf crate acpmux-build-id; cmux-tui depends on acpmux without its default build-id feature and installs the same value through hub::install_build, so a new stamp recompiles only the tiny leaf crate.
  • Every entry point that serves identify or ping must call install_build_stamp; a process that doesn't reports build_commit: null as before. --version, acpmux --version, and remote-probe --json output are unchanged.

Written for commit 8795cbe. Summary will update on new commits.

View guided diff Turn on auto-fix

@lawrencecchen
lawrencecchen temporarily deployed to cmux-tui-merge-tree October 19, 2026 07:06 — with GitHub Actions Inactive
@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 704e2812-2e8d-4353-9a1d-2146cb11f333

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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 Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

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

Review 8795cbe: 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=pr22030 -f ref=feat-cmux-next-tui-stamp-runtime2 -f platform=macos -f backend_mode=local

red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on ad45b0b to compare; do not merge until green; see lane-rules

@teamleaderleo

teamleaderleo commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Visual preview of 8795cbe: in the maintainers' private review feed.

@teamleaderleo

Copy link
Copy Markdown
Collaborator

Bead cx-rcunq created for this PR by the cmux coordinator.

lawrencecchen and others added 3 commits October 20, 2026 08:21
cmux-remote read CMUX_TUI_DISTRIBUTION_VERSION and
CMUX_TUI_NPM_BOOTSTRAP_VERSION with option_env!. They move to the binary
(distribution.rs, same values and fallback) and SshBootstrapConfig::defaults
takes them as arguments.

acpmux's build script reran on every new stamp (CMUX_GIT_SHORT_SHA,
SOURCE_DATE_EPOCH) and every commit, and a rerun recompiles every target of
the package. The script moves unchanged (git calls still run in the acpmux
crate) to the leaf crate acpmux-build-id. acpmux reads the build id through
hub::build(): the default build-id feature (standalone acpmux binary, acpmux
tests) gives the stamped value; cmux-tui turns the feature off and installs
the same value at start.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@lawrencecchen
lawrencecchen force-pushed the feat-cmux-next-tui-stamp-runtime2 branch from 001959c to 9fa2ee5 Compare October 20, 2026 15:23
@lawrencecchen
lawrencecchen temporarily deployed to cmux-tui-merge-tree October 20, 2026 15:23 — with GitHub Actions Inactive
@blacksmith-sh

blacksmith-sh Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Found 8 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmpn5qyf8yp/summary-missing.json (live):/summary-missing.json (live): View Logs
/tmp/tmpwhncgjkv/summary-fail.json (live):/summary-fail.json (live): View Logs
bundle-map.json does not require CEF's LICENSE.txt/
bundle-map.json does not require CEF's LICENSE.txt
View Logs
bundle-map.json does not require CEF's LICENSE.txt/
bundle-map.json does not require CEF's LICENSE.txt
View Logs
convention violations found (ERROR lines above)./
convention violations found (ERROR lines above).
View Logs
test_a_file_a_test_reads_selects_that_test (main.PullRequestTiers.test_a_file_a_tes
t_reads_selects_that_test)/
test_a_file_a_test_reads_selects_that_test (main.PullRequestTiers.test_a_file_a_tes
t_reads_selects_that_test)
View Logs
test_batch_dispatch_runs_every_dispatch_gated_job (main.PathRoutingStructure.test_b
atch_dispatch_runs_every_dispatch_gated_job) (job='request-cmux-next-dev-publish')/
test_batch_dispatch_runs_every_dispatch_gated_job (main.PathRoutingStructure.test_b
atch_dispatch_runs_every_dispatch_gated_job) (job='request-cmux-next-dev-publish')
View Logs
test_every_submodule_free_checkout_on_an_owned_runner_resets_submodules (main.Reuse
dWorkspaceSubmodules.test_every_submodule_free_checkout_on_an_owned_runner_resets_submo
dules)/
test_every_submodule_free_checkout_on_an_owned_runner_resets_submodules (main.Reuse
dWorkspaceSubmodules.test_every_submodule_free_checkout_on_an_owned_runner_resets_submo
dules)
View Logs

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

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Correctness review (subagent, head 9fa2ee5)

Blocker: none. Behavior is the same where the real binaries run: the distribution constants in cmux-tui/src/distribution.rs copy the old ssh_bootstrap.rs values and fallback (raw stamp, CARGO_PKG_VERSION); the only callers of SshBootstrapConfig::defaults are remote_runtime.rs and 4 test calls; every acpmux child process starts through cmux_tui::main, which calls install_build before the acpmux argv check; acpmux-build-id/build.rs still runs every git call in ../acpmux (same short hash, dirty scope, fingerprint, SOURCE_DATE_EPOCH, rerun paths). The red checks (Swift process-scan, menu-actions, phone-lane schema, same-tree artifact) come from the base branch, not this diff.

Should-fix

  1. acpmux/src/hub/mod.rs:305-308: cmux-tui integration tests that run an in-process Hub without install_build now see "unstamped" instead of the real id. Call acpmux::hub::install_build(acpmux_build_id::BUILD) there, or document the rule.
  2. hub/mod.rs grows to 1095 lines (god-file warning, not in baseline): move build, install_build, version_line to hub/build.rs.

Nits: build-id sources outside acpmux no longer add +dirty; mod distribution placement under the hook-helper comment; acpmux-build-id version not workspace = true; the test copies the option_env! logic.

Resolution: should-fix 1 and 2 go to the rebase owner before merge; resolution follows in a later comment.

…all the build id

hub::build, install_build and version_line move to hub/build.rs (re-exported,
callers unchanged), so hub/mod.rs does not grow. The cmux-tui tests that run
an in-process acpmux Hub install acpmux_build_id::BUILD first, as main() does,
so the hub reports the real build id, not `unstamped`. acpmux-build-id takes
the workspace version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lawrencecchen
lawrencecchen temporarily deployed to cmux-tui-merge-tree October 20, 2026 15:58 — with GitHub Actions Inactive
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Resolution (review at 9fa2ee5), new head a144005:

  • In-process acpmux hubs in cmux-tui tests (agent_cli_job_journey.rs, inventory_refresh_journey.rs, agent_message_launch_credential.rs) now call acpmux::hub::install_build(acpmux_build_id::BUILD) before Hub::new, as main() does. They report the real build id, not unstamped.
  • build, install_build and version_line moved to acpmux/src/hub/build.rs. hub/mod.rs re-exports them, so callers do not change. hub/mod.rs is 1069 lines (1095 before; feat-cmux-next has 1070).
  • acpmux-build-id uses version.workspace = true. The Cargo.lock entry is 1.0.0.
  • Doc fix in acpmux-build-id/src/lib.rs: the path is acpmux::hub::install_build.
  • Not done: moving #[cfg(unix)] mod distribution; next to remote_cli. rustfmt sorts it into the feature_flags group (this is why the rustfmt commit moved it there).

@teamleaderleo

Copy link
Copy Markdown
Collaborator

cmux-next guards / defaults-snapshot is red on 19 of 19 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator

cmux-next / cmux-next checks (god files, concurrency, crash safety, l10n) › Browser chrome icons is red on 16 of 16 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator

cmux-next / cmux-next checks (god files, concurrency, crash safety, l10n) › Capability texts never say update the app is red on 16 of 16 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator

cmux-next / cmux-next checks (god files, concurrency, crash safety, l10n) › Checks job structure is red on 16 of 16 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator

cmux-tui spec inventory / inventory is red on 8 of 8 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator

cmux-next / cmux-next checks (god files, concurrency, crash safety, l10n) › Main-thread concurrency is red on 11 of 11 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator

cmux-next / cmux-next checks (god files, concurrency, crash safety, l10n) › No process scanning (holders register themselves, plans/cmux-next/pty-holder.md 4) is red on 10 of 10 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator

cmux-next / cmux-next checks (god files, concurrency, crash safety, l10n) › Package conventions lint is red on 10 of 10 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator

cmux-next / cmux-next checks (god files, concurrency, crash safety, l10n) › Phone lane field allowlist is red on 10 of 10 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 20, 2026 18:25 — with GitHub Actions Inactive
teamleaderleo added a commit that referenced this pull request Oct 31, 2026
Review (Codex, BLOCK at c244036): agent_message_reply_in_place.rs (added on base
after #22030) builds an in-process acpmux Hub inside cmux-tui's tests, where acpmux has
no build-id feature, and never installed the id, so its hub reported "unstamped". It
now installs it as the other in-process hub tests do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-2f016c499153c1bead46
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Closed by the perf lead (agent, cmux-ad order 2026-10-31): stale, with no owner. This is an agent PR (lawrencecchen account). It was opened on 2026-10-19, its last commit is from 2026-10-20, no person pushed or commented in the last 3 days (automated review and sweep notes do not count), no live session names it in the lead status of the last 24 h, and it conflicts with feat-cmux-next (DIRTY).

The branch feat-cmux-next-tui-stamp-runtime2 stays. To reopen: click Reopen (or gh pr reopen 22030 -R manaflow-ai/cmux), merge origin/feat-cmux-next into the branch, get a review receipt on the new head, then add ready-to-land.

teamleaderleo added a commit that referenced this pull request Nov 1, 2026
…x (takes over #22030) (#28776)

* cmux-tui: a new build stamp no longer recompiles cmux-remote or acpmux

cmux-remote read CMUX_TUI_DISTRIBUTION_VERSION and
CMUX_TUI_NPM_BOOTSTRAP_VERSION with option_env!. They move to the binary
(distribution.rs, same values and fallback) and SshBootstrapConfig::defaults
takes them as arguments.

acpmux's build script reran on every new stamp (CMUX_GIT_SHORT_SHA,
SOURCE_DATE_EPOCH) and every commit, and a rerun recompiles every target of
the package. The script moves unchanged (git calls still run in the acpmux
crate) to the leaf crate acpmux-build-id. acpmux reads the build id through
hub::build(): the default build-id feature (standalone acpmux binary, acpmux
tests) gives the stamped value; cmux-tui turns the feature off and installs
the same value at start.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* cmux-tui: rustfmt

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-2f016c499153c1bead46

* acpmux-build-id: drop the unneeded path

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-2f016c499153c1bead46

* acpmux: build id functions in hub/build.rs; in-process test hubs install the build id

hub::build, install_build and version_line move to hub/build.rs (re-exported,
callers unchanged), so hub/mod.rs does not grow. The cmux-tui tests that run
an in-process acpmux Hub install acpmux_build_id::BUILD first, as main() does,
so the hub reports the real build id, not `unstamped`. acpmux-build-id takes
the workspace version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* acpmux: the Windows stack reservation stays in acpmux's own build script; build() everywhere base reads the build id

Takes over #22030 onto current feat-cmux-next:
- base added a Windows main-thread stack reservation to acpmux/build.rs
  (6c93f6e, `cargo:rustc-link-arg-bin=acpmux=...`). Moving that script to the
  acpmux-build-id leaf crate would apply it to a crate with no acpmux binary, so
  acpmux.exe would lose it. It stays in a small acpmux/build.rs that reads no stamp
  and reruns only when it changes.
- (in the resolution of the first cherry-pick) every reader of hub::BUILD that base added since (host enroll and update, cloud
  join, peer status, the remote guard's hint, initialize's _meta, peer.rs) reads
  hub::build().
- cmux-tui installs the build id on every platform: acpmux is now a dependency on
  Windows too (the tailnet wrapper).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-2f016c499153c1bead46

* cmux-tui test: the reply-in-place hub installs acpmux's build id

Review (Codex, BLOCK at c244036): agent_message_reply_in_place.rs (added on base
after #22030) builds an in-process acpmux Hub inside cmux-tui's tests, where acpmux has
no build-id feature, and never installed the id, so its hub reported "unstamped". It
now installs it as the other in-process hub tests do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-2f016c499153c1bead46

---------

Co-authored-by: Lawrence Chen <54008264+lawrencecchen@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: cmux-bot[bot] <348531757+cmux-bot[bot]@users.noreply.github.com>
Co-authored-by: Leo Li <t@e>

This branch was previously deployed

2 inactive deployments
artifacts — 8795cbe9 Deployed Oct 20, 2026 by teamleaderleo
cmux-tui-merge-tree — 8795cbe9 Deployed Oct 20, 2026 by teamleaderleo
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