Skip to content

canary: cmuxTests full-recompile probe (do not merge) - #14320

Closed
teamleaderleo wants to merge 7 commits into
mainfrom
canary/cmuxtests-rebuild-cause
Closed

teamleaderleo wants to merge 7 commits into
mainfrom
canary/cmuxtests-rebuild-cause

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Measurement canary. Do not merge; closing once the admission reports.

Every PR compile admission recompiles all ~1,100 cmuxTests files (800 to 1,000 CPU s, about 200 s wall on 12vcpu), even when cmux compiled 1 to 7 CPU s (jobs 107856043911, 107863037290, 107853852596). That includes the owned minis with their own persistent DerivedData, so it is not seed transport. #14235 measured a cmux-unit null rebuild at 29 s. Admission builds the cmux scheme first, and that build and cmux-unit each relink cmux and about 13 package frameworks.

After admission, this probe runs:

  • cmux-unit twice (null)
  • cmux alone, then lists what it rewrote under Build/
  • cmux-unit again with XCBuild build debugging on, then lists what it rewrote

It also diffs the cmux and cmuxTests link and driver arguments between the two schemes and uploads the traces as canary-cmuxtests-rebuild-*. It includes a comment-only test change, so it is a test-only PR admission.

🤖 Generated with Claude Code


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

Measurement canary (do not merge) that probes why the compile admission rebuilds all ~1,100 cmuxTests files (800–1,000 CPU s) when cmux itself compiles in 1–7 CPU s and a cmux-unit null rebuild takes ~29 s.

  • Runs cmux-unit with -driver-show-incremental after the canary test edit and again as a null rebuild, captures swiftdeps and ChainedBridgingHeader write times, then repeats both with SWIFT_PRECOMPILE_BRIDGING_HEADER=NO to test whether the precompiled bridging header causes the full rebuild.
  • The build script now honors CMUX_CI_BUILD_SCHEMES to filter schemes and passes CMUX_CI_EXTRA_SWIFT_FLAGS / CMUX_CI_EXTRA_BUILD_SETTING through to xcodebuild.
  • Pins the seeded 12 vCPU pool so Xcode mtimes cannot differ.
  • Logs upload as canary-cmuxtests-rebuild-* artifacts; the comment-only test change keeps this a test-only admission.

Written for commit 3be3d2a. Summary will update on new commits.

Review in cubic

…heme build (do not merge)

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

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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

Copy link
Copy Markdown
Contributor

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

… not merge)

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

Copy link
Copy Markdown
Collaborator Author

Data point for this probe: test-only canary #14269, run 36077356582, 6vcpu, j6 seed at distance 0. The cmux scheme did 0 SwiftDriver, 0 SwiftEmitModule and 0 SwiftCompile tasks. cmux-unit then did SwiftCompile 43 tasks (1,205 CPU s) and emitted cmuxTests. So the full cmuxTests recompile happens with no cmux module change at all. Log: job 107898790966.

teamleaderleo and others added 5 commits September 24, 2026 21:16
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (do not merge)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…not merge)

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

Copy link
Copy Markdown
Collaborator Author

Cause of the cached full cmuxTests rebuild, measured on #14249 (run 36081880621, 12vcpu-macos-26, Xcode 26.6): with -driver-show-incremental, all 1,073 inputs are Invalidated externally by Newer: cmuxTests-…-ChainedBridgingHeader.h. The driver chains the app's bridging header, which cmuxTests reaches through @testable import, into a generated header and rewrites it on every build. #14349 turns the compilation cache off for cmuxTests only, and a one-test-file edit then takes cmuxTests 31 s instead of 139 s. If SWIFT_PRECOMPILE_BRIDGING_HEADER=NO gets the same result with the cache on, that would be the better fix; please post the numbers on #14349.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Closing: the full cmuxTests recompile this canary measured (swift-driver rewriting cmuxTests' ChainedBridgingHeader.h on every run, 1,116 files per one-line test edit) is what #14349 fixed by building cmuxTests without the compilation cache. This branch predated #14349. -no-auto-bridging-header-chaining and SWIFT_PRECOMPILE_BRIDGING_HEADER=NO did not stop the rewrite with the cache on.

@teamleaderleo
teamleaderleo deleted the canary/cmuxtests-rebuild-cause branch September 25, 2026 02:56
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