base red: CmuxNext release test build crashes the Xcode 26.6 optimizer on a generic @MainActor test box

Merged
LA
5d ago
+29-12

Base red: every release-configuration build of the CmuxNext tests fails, so no release suite or release bench of CmuxNext can run. Xcode 26.6's swift-frontend crashes (signal 11) in the SIL pass EarlyPerfInliner on the deallocating deinit of the generic @MainActor final class Box<T> in Tests/CmuxNextAppTests/CloudStartSessionAsksTests.swift ($s16CmuxNextAppTests021CloudStartSessionAsksD0V3BoxCfD). swift build --build-tests -c release compiles every test target, so the crash blocks every release step, whatever its filter. Seen on cmux18-perf in step fadbace5a2fd5ae64c63cdf2 (a swift-test-bench.sh config=release step at feat ba780613748 plus #32028): it failed after 1235 s of build.

The fix is test-only: four non-generic @MainActor boxes (CountBox, ClockBox, GatesBox, ResumeBox) replace the generic one. They keep the same value property and the same isolation, so the closures and Task { @MainActor in ... } that capture them still compile the same way. No assertion changes. The boxes came from #25414 and #25625 (Cloud start-session), and this file has not changed since.

Changelog

none

Observed / Not run

Observed:

  • The crash: the step log of fadbace5a2fd5ae64c63cdf2 has the stack dump. 4. While running pass #9404664 SILFunctionTransform "EarlyPerfInliner" on SILFunction "@$s16CmuxNextAppTests021CloudStartSessionAsksD0V3BoxCfD".
  • Red at the base: package-test-lane.sh suite Packages/macOS/CmuxNext CloudStartSessionAsksTests with CMUX_SWIFT_SUITE_CONFIGURATION=release at feat 007f1d04bc6, step b396284b2945da6261de6b27, aws-m4pro-1 (a normal Mac, not a perf mini), Xcode 26.6, Swift 6.3.3. It failed in swift build --build-tests -c release with the same crash: While running pass #9384016 SILFunctionTransform "EarlyPerfInliner" on SILFunction "@$s16CmuxNextAppTests021CloudStartSessionAsksD0V3BoxCfD". So this is not a cmux18 toolchain fault.
  • Head: compile-check 92532315195e7bf0b2398895 passed. Green at the head: the same suite step at 3f5ab4429f3, 42b26cd70ee2d7caecf15dff on aws-m4pro-4, Xcode 26.6, passed. swift build --build-tests -c release of every CmuxNext test target finished with no compiler crash, and 26 tests in 1 suite passed.
  • Review receipt: SHIP at 3f5ab4429f3 (comment 6574144944).
  • prepush-gate.py: no new violations.

Not run: a debug-configuration change can't exist here, because the debug build does not run the optimizer pass. The suite's debug runs on CI cover the tests' behavior.

Head now 954938c623e: the bot merged feat-cmux-next f22cb91fdb8 into the branch. This PR's own diff (git diff f22cb91fdb8 954938c623e) is byte-identical to the reviewed change at 3f5ab4429f3. The proofs above ran at 3f5ab4429f3.

Non-green checks at 954938c623e, classified. Both are base findings in files this PR doesn't touch:

  • app platform (runtime, SDK, samples, first-party forks): generated/cmux-app.d.ts is stale: run bun tools/gen-cmux-global.ts.
  • cmux-next checks: red check Main-thread concurrency. 1 violation, at Sources/CmuxNextCloud/Process/NativeCloudExecutable.swift:61 (SecStaticCodeCheckValidity).