Repository navigation
fix(deploy): a deploy compiles the library once — every bin on ONE cargo line, one feature set (card 9174fc83) - #4276
Conversation
…rgo line, one feature set (card 9174fc83) Measured on the IntelMac deploy of 2026-09-20: start-server.sh ran FOUR separate `cargo build` invocations, one per bin (continuum-mcp, continuum, forge-custodian, continuum-core-server), and "Compiling continuum-core" appeared four times per deploy — 18m16s + 5m41s + 5m14s + 7m46s = 37 minutes. 25 minutes on the M5. Under the stop-first reboot path (the CLI's memory bar) the serving core is dark for all of it. Cause: each invocation resolves features, reruns the build scripts and fingerprints the library for itself. The CLI carried its own feature variable (CONTINUUM_CLI_FEATURES) on the Linux/Windows arm — `--no-default-features`, unconditionally — so its fingerprint differed from the other three bins' and the whole library recompiled for it; per-bin invocations then paid the build-script re-run and the per-invocation resolution on every bin. THE LAW: a deploy compiles the library once. - build_core_bins() is the single place the crate's bins are built: ONE `cargo build --manifest-path "$CORE_MANIFEST" --bin … --bin … --bin … --bin …` so the lib compiles once and the four links run in parallel. The deploy build, the #296 swept-cache restore, the #194 forced rebuild and the GPU-free CLI arm all call it; the six literal invocations become one. - One feature set by default. The CLI shares the core's set everywhere the set links no GPU runtime. The only sanctioned separation is the measured one — a set carrying cuda/rocm/vulkan makes a socket-client CLI unlaunchable on Windows (load-time cublas import, exit 127 with zero bytes, #6) — and there the CLI is one extra line, `--bin continuum` alone, with its own set. A CPU-only or DirectML-only Linux/Windows box no longer pays a second lib compile for a CLI that merely dropped `livekit-webrtc`. - Every existing behaviour around the builds is kept: the core's failure is FATAL and a sidecar's is a warning (on a combined failure the core is built alone, warm, and ITS exit code decides), the self-build guard, the loud GPU-free→featured CLI fallback, the CLI install, the #296 restores (now for continuum-mcp too), the #194 freshness guard, the build-only receipt. The prebuilt-core `cargo()` shim — which would have skipped the whole combined invocation, sidecars included (the hole Cormac's review of #4107 closed) — is replaced by leaving continuum-core-server out of the bin list. - The memory bar (warm_build_allowed in the CLI) is untouched: with one invocation there is no cheap-bins-before-the-big-link ordering to exploit; the lib compile IS the memory cost and every bin needs it. Stop-first now holds the core for one build instead of four. Self-running check (tools/scripts/tests/start-server-build-only.test.sh, already in both CI jobs): the script text carries exactly ONE literal `cargo build --manifest-path "$CORE_MANIFEST"` (canary had 6); a fixture run traces one cargo line naming all four bins with one feature set; a cuda set separates only the CLI, on exactly one extra line; the fixture cargo now understands a multi-`--bin` command line like real cargo. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
APPROVE — reviewed at exact head 7072383 (pipefail + labeler green; the two cargo jobs running at read time). This is the fix for the measurement I posted (four On this box the receipt will be one "Compiling continuum-core" per deploy log; I will post the number after the next restart. |
The measurement
IntelMac deploy, 2026-09-20:
tools/scripts/start-server.shran four separatecargo buildinvocations, one per bin (continuum-mcp,continuum,forge-custodian,continuum-core-server), andCompiling continuum-coreappeared four times per deploy — 18m16s + 5m41s + 5m14s + 7m46s = 37 minutes. 25 minutes on the M5. Under the stop-first reboot path (the CLI's memory bar,warm_build_allowed) the serving core is dark for all of it.The cause
Each invocation resolves features, reruns the build scripts and fingerprints the library for itself. The CLI carried its own feature variable,
CONTINUUM_CLI_FEATURES, which on the Linux/Windows arm was--no-default-featuresunconditionally — a different fingerprint from the other three bins, so the whole library recompiled for it. (#4249 had already aligned the two Mac arms; the per-bin invocations themselves, and the Linux/Windows divergence, remained.)The fix — a deploy compiles the library once
build_core_bins()is the single place the crate's bins are built:cargo build --manifest-path "$CORE_MANIFEST" --bin continuum-core-server --bin continuum-mcp --bin forge-custodian --bin continuum $PROFILE_FLAG $CONTINUUM_FEATURES. The lib compiles once; the four links run in parallel. The deploy build, the Fix 35GB memory leak + persona meter reliability #296 swept-cache restore, the Implement GAN-style Adversarial Training Loop #194 forced rebuild and the GPU-free CLI arm all call the function — the script's six literalcargo buildlines became one.cuda/rocm/vulkanlinks a runtime the loader must find beforemain(), and on Windows that made the socket-client CLI unlaunchable (load-timecublas64_13.dllimport, exit 127 with zero bytes, Build(deps): Bump actions/setup-node from 3 to 4 #6 — the comment in the script carries the whole measurement). On such a box only, the CLI is one extra line,--bin continuumalone, with--no-default-features: one extra lib compile, documented, and the only case in which a deploy compiles the library twice. A CPU-only or DirectML-only Linux/Windows box no longer pays it for a CLI whose only difference was droppinglivekit-webrtc.continuum-mcptoo); the Implement GAN-style Adversarial Training Loop #194 freshness guard; the build-only receipt; the Windows toolchain import. The prebuilt-corecargo()shim — which would have skipped the whole combined invocation, sidecars included (the hole Cormac's review of fix(deploy): a verified prebuilt core launches THROUGH start-server.sh in prebuilt mode — the bare direct launch (#4090) started the M5 with no desktop and no power assertion #4107 closed) — is replaced by leavingcontinuum-core-serverout of the bin list.The check (self-running, already in both CI jobs)
tools/scripts/tests/start-server-build-only.test.sh(runs incargo test -p continuum-core --libon ubuntu and incargo check windows-msvcon windows):cargo build --manifest-path "$CORE_MANIFEST"line — canary's has 6, so the check bites on the defect;cudaset separates only the CLI, on exactly one extra line; the existing build-only scenarios now also assert the first line is the combined one and the core is built at most twice (failure diagnosis);cargounderstands a multi---bincommand line like real cargo.Follow-up worth a card: moving the
continuumCLI into its own crate (a socket client needs none of continuum-core's GPU deps) would retire the last separation and give CUDA boxes one lib compile too.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo