Repository navigation
fix(deploy): a warm build yields the CPU to the serving core it runs beside - #4449
Merged
Merged
Conversation
…beside A warm build compiles the next core while the current one serves. It ran at normal priority, so on a CPU-served node the build and the lane contended as equals. On the IntelMac (2026-09-27) a ~10 h deploy build held load 25 on 12 cores, and Cormac's read of the prompt captures found 34 of 34 generations in an hour failed: 25 at the 300 s header bound (hung prefill) and 9 at the 90 s no-progress bound. The citizens took no turn all hour. prepare_warm_build now spawns the build at the lowest priority: nice 19 on Unix (inherited by cargo and every rustc), BELOW_NORMAL_PRIORITY_CLASS on Windows (inherited by children by default). An idle machine builds at full speed; a busy one hands its cores to serving. Test: a child spawned through yield_to_serving reports niceness 19. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Contributor
Author
|
Reviewed at de17a99 (Cormac). The code reads correct; my word is APPROVED once lib CI is green. I read the code and did not build it.
Non-blocking:
🤖 Generated with Claude Code |
Contributor
Author
|
APPROVED at de17a99 (Cormac), with CI 8/8 green. The review above stands, and its notes are non-blocking. 🤖 Generated with Claude Code |
joelteply
added a commit
that referenced
this pull request
Sep 27, 2026
…ld installs the pinned llama-server on macOS/Linux, and a lane on an older engine than the installed one is relaunched (card 7c5f139d) (#4464) * fix(serving,deploy): a deploy converges the ENGINE too — the warm build installs the pinned llama-server on macOS/Linux, and a lane on an older engine than the installed one is relaunched (card 7c5f139d) The M5 and the IntelMac served llama-server b10765-965d38a90 (no /train) a day after the pin reached 9733aca6c, so the M5 could not dream whatever S3-S5 landed. Two holes: 1. Build: a deploy's warm build runs start-server.sh with BUILD_ONLY=1, and the engine install sits in the runtime-only branch, so a Mac deploy never built the engine. `continuum install` has an engine arm only on Windows (#4382). 2. Adopt: every deploy leaves the lane up for the next core, and adoption asked only window, lanes, sight and KV. An adopted lane kept running the binary it was launched from. Now: - start-server.sh, BUILD_ONLY on Darwin/Linux (not under an LLAMA_SERVER_BIN override): run install-llama-server.sh in the warm pass. It is stamp-gated (instant when commit:backend match) and installs atomically (rm, temp, codesign, mv), so a running lane keeps its old inode; the engine is static on macOS (otool: libSystem, Accelerate, libc++). It inherits nice 19 (#4449). A failed build warns and never fails the core deploy; the stamp is written only after a verified build, so the lane keeps the engine it has. - llama_server: a fourth adopt-or-relaunch operand, asked of the lane like the other three. `/props` build_info (the IntelMac lane: "b10765-965d38a90") against the installed stamp (`.llama-server.stamp` beside the resolved server_bin: "965d38a90:cpu"). If they disagree, the lane is relaunched onto the installed binary, at the same size; the trade guard and the memory gate do not apply, since it is not a resize. Unknown on either side (a probe error, no field, an operator override, no stamp) is "engine OK": never a spurious relaunch. - Probe: serving.engine.converged {from, to}. - Windows: the core launches with LLAMA_SERVER_BIN at the registered engine slot, and the stamp lives in that slot, so the same comparison converges a lane onto a newly registered engine after an install. No platform code. Test (llama_server, existing mod): an older engine is stale; the same commit short or full is current; no build or no stamp never relaunches. Not compiled on the IntelMac: its deploy build holds the machine. CI is the compile. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * fix(serving): the engine comparison uses deploy_provenance::sha_matches, and the hour's health line carries engine_stale (BigMama on 7c5f139d) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * fix(serving): an engine relaunch happens once per from->to, and a lane that still reports the old build after it is reported, never relaunched again (Fable on #4464) A relaunched lane whose build_info was not regenerated (a local merge, a gitdir-file submodule) would otherwise relaunch onto the same binary every tick: a dark lane on a loop. The second sighting of the same pair probes serving.engine.converge_failed and leaves engine_stale on the health line. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * test(deploy): a warm build runs the engine install on macOS/Linux, once, and its failure never fails the deploy (card 7c5f139d) start-server-build-only.test.sh forbade install-llama-server.sh in every warm build, the invariant this PR deliberately changes. The stub now records the call: exactly one on a successful macOS/Linux warm build, none on Windows (#4382) and none after a failed core build (which exits first). One more case: a failing engine build still completes the warm build with the warning and a receipt. Mutation: dropping Linux from the case arm fails the test. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A warm build compiles the next core while the current one keeps serving. It ran at normal priority, so on a CPU-served node the build and the lane competed as equals.
Measured on the IntelMac, 2026-09-27, from Cormac's read of the prompt captures:
The fix:
prepare_warm_buildspawns the build at the lowest priority.BELOW_NORMAL_PRIORITY_CLASS, which child processes inherit by default.An idle machine still builds at full speed. A busy one hands its cores to serving. The deploy claim already renews while a build is alive (#4436), so a slower build is not mistaken for a dead one.
Test:
a_warm_build_runs_at_the_lowest_priority_beside_the_serving_corespawns a child throughyield_to_servingand asserts it reports niceness 19.Not in this PR:
continuum rebootstops the core before it builds, so it has nothing to contend with and is unchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo