Skip to content

fix(deploy): a warm build beside a lane that fills memory takes fewer jobs instead of never running (the M5 could not deploy) - #4478

Merged
joelteply merged 2 commits into
canaryfrom
fix/a-warm-build-fits-the-memory-it-has
Sep 27, 2026
Merged

joelteply merged 2 commits into
canaryfrom
fix/a-warm-build-fits-the-memory-it-has

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The warm build refused below a fixed 12 GiB free. The M5 serving the 27B at 4 lanes
(llama-server 29.5 GB, core 4.4 GB) sat at 10.4 GiB, so every tracker pass from 19:33Z
on 2026-09-27 was refused ("no artifact to hand the supervisor") and the node stayed on
c9ee8b1 under a day of merges (#4457, #4467, #4468, #4471). A node whose lane fills
its memory never deployed.

Now 12 GiB free still runs at cargo's own job count; below it the build takes one job
per 3 GiB above a 4 GiB reserve for the citizens and the core (rustc's codegen threads
draw on the same jobserver, so fewer jobs is less memory), at least one; the refusal
moves to the floor of one job plus the reserve (7 GiB). When a CPU-served lane also caps
the build (#4471), the smaller budget wins. The engine build reads the same
CARGO_BUILD_JOBS.

Pre-registered: the M5's first warm build under this runs at 2 jobs at ~10 GiB free and
completes with memory.pressure never reaching critical and no citizen generation dropped
during the build window.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

… jobs instead of never running (the M5 could not deploy)

The warm build refused below a fixed 12 GiB free. The M5 serving the 27B at 4 lanes
(llama-server 29.5 GB, core 4.4 GB) sat at 10.4 GiB, so every tracker pass from 19:33Z
on 2026-09-27 was refused ("no artifact to hand the supervisor") and the node stayed on
c9ee8b1 under a day of merges (#4457, #4467, #4468, #4471). A node whose lane fills
its memory never deployed.

Now 12 GiB free still runs at cargo's own job count; below it the build takes one job
per 3 GiB above a 4 GiB reserve for the citizens and the core (rustc's codegen threads
draw on the same jobserver, so fewer jobs is less memory), at least one; the refusal
moves to the floor of one job plus the reserve (7 GiB). When a CPU-served lane also caps
the build (#4471), the smaller budget wins. The engine build reads the same
CARGO_BUILD_JOBS.

Pre-registered: the M5's first warm build under this runs at 2 jobs at ~10 GiB free and
completes with memory.pressure never reaching critical and no citizen generation dropped
during the build window.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

@fable #4478 read at d398522 (Cormac): right, and my word follows at a green lib. Not built.

One number to measure, not a blocker: the 3 GiB per job. The 7 GiB rustc figure was at cargo's default jobs. At 1-2 jobs the codegen share shrinks, but continuum_core's single rustc front end (type-check, MIR, borrowck of one very large crate) doesn't shrink with the job count. If that peak is above 3 GiB, a 1-job build at the 7 GiB floor doesn't fail: it squeezes the lane's resident weights and KV on macOS (compression, then swap), and the citizens pay the way they did on the IntelMac. Pre-register it on the M5's first budgeted build: peak rustc RSS (/usr/bin/time -l or the footprint sampler) and the lane's health hour beside it. If rustc peaks above 3 GiB, raise WARM_BUILD_JOB_BYTES to the measured peak.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

@joelteply

Copy link
Copy Markdown
Contributor Author

Pre-registered measurement (Cormac): rustc's front-end peak for continuum_core is one process whatever the job count, so the 3 GiB-per-job budget may undercount it. The one-time bridge build of the CLI on the M5 (at this PR's own budget, 2 jobs at ~10.4 GiB free, background band) samples every rustc's RSS and the system's available memory every 5 s. It is stopped if available memory falls under 2 GiB. The PR's constants are right if the peak rustc RSS stays under (free − 4 GiB reserve) and available memory never falls under 2 GiB; if continuum_core's front end alone exceeds 3 GiB, the budget becomes a fixed front-end term plus a per-job term, measured here.

joelteply added a commit that referenced this pull request Sep 27, 2026
…cker, so CI's lib-test job runs its test (Codex on #4478/#4477)

Tests in bin/continuum.rs are compiled by CI's windows `--tests` check but never
run: the only test job is `cargo test -p continuum-core --lib`. The pure
verdict (STALE_INDEX_LOCK, IndexLock, index_lock_verdict) moves beside the
tracker's other deploy verdicts, with its test in that file's existing tests
mod. The consumer keeps the effectful half (git rev-parse, the sysinfo git
check, the removal and its receipt).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@github-actions github-actions Bot added size: M and removed size: S labels Sep 27, 2026
joelteply added a commit that referenced this pull request Sep 27, 2026
…h a receipt, and names a live one without spending an attempt (card 677437fa) (#4477)

* fix(deploy): the consumer clears a deploy tree's stale index.lock with a receipt, and names a live one without spending an attempt (card 677437fa)

A git that died mid-write left .git/index.lock in the M5's deploy tree, and
every consumer tick's checkout failed on it: 41 refusals over ~3.4 h, then again
17:27-19:3xZ on 2026-09-27, each time cleared by hand. Each failure also counted
against the tip's CONSUME_MAX_ATTEMPTS, so a stale lock could strand a tip.

Before the deploy attempt, the consumer now judges the lock (found with
`git rev-parse --git-path index.lock`, so worktrees resolve too):
- none: deploy;
- older than STALE_INDEX_LOCK (10 min, far past any git write) with no git
  process whose cwd is inside the tree (sysinfo): remove it, with the receipt
  deploy.tree.stale_lock_cleared {path, age}, and deploy;
- younger, or a git process stands in the tree: name it (path and age) in the
  deploy log and try next tick, without spending one of the tip's attempts.

index_lock_verdict is pure and pinned by a test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* fix(deploy): a git with an unreadable cwd, or one naming the tree from elsewhere, holds the lock (Codex on #4477)

git_running_in ruled out any git whose cwd sat outside the tree, including
`git -C <repo>` (its cwd stays elsewhere while it owns the tree's index) and a
process whose cwd could not be read. Now only a git positively seen working
elsewhere is ruled out: an unreadable cwd, a cwd in the tree, or a command line
naming the tree (as given or canonical) all keep the lock Held.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* docs(deploy): the lock check's comment names --git-dir/--work-tree, not git -C (which chdirs into the tree) (Codex on #4477)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* refactor(deploy): the stale-lock verdict lives in runtime::deploy_tracker, so CI's lib-test job runs its test (Codex on #4478/#4477)

Tests in bin/continuum.rs are compiled by CI's windows `--tests` check but never
run: the only test job is `cargo test -p continuum-core --lib`. The pure
verdict (STALE_INDEX_LOCK, IndexLock, index_lock_verdict) moves beside the
tracker's other deploy verdicts, with its test in that file's existing tests
mod. The consumer keeps the effectful half (git rev-parse, the sysinfo git
check, the removal and its receipt).

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]>
@joelteply
joelteply merged commit c4e7927 into canary Sep 27, 2026
8 checks passed
@joelteply
joelteply deleted the fix/a-warm-build-fits-the-memory-it-has branch September 27, 2026 20:19
@joelteply

Copy link
Copy Markdown
Contributor Author

@fable #4478 at 08d4e2d: APPROVED (Cormac). 8/8 green, lib-test included, so the memory-budget test now runs in CI (it moved into llama_server beside warm_build_jobs). I read the code and did not build it.

  • The warm build refuses only below one job plus the reserve (7 GiB). Between that and 12 GiB it takes one job per 3 GiB above a 4 GiB reserve, and the smaller of this and fix(deploy): a warm build beside a CPU-served lane takes one job and, on macOS, the background band (card 682a5abf) #4471's CPU cap wins, through the one CARGO_BUILD_JOBS the engine build also reads. The M5 at 10.4 GiB gets 2 jobs.
  • The pre-registration stands, as Codex and I both asked: on the M5's first budgeted build, record peak rustc RSS and the lane's health hour. If continuum_core's single front end peaks above 3 GiB, raise the per-job constant to the measured value.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

joelteply added a commit that referenced this pull request Sep 27, 2026
…inuum_core's front end is a 6.4 GB first job) (#4479)

* fix(deploy): the warm build's memory budget is the measured one: continuum_core's front end is a fixed first job, not a flat 3 GiB

The pre-registered check on #4478: the M5's warm build of 4284ebe (20:14-20:25Z,
2026-09-27, sampled every 10 s) peaked at 6.4 GB for the largest single rustc
(continuum_core, one process whatever the job count) and 8.7 GB for every rustc together.
A flat 3 GiB per job undercounted the first job by more than half. The budget is now a
first job of 6.5 GiB plus 2.5 GiB for each further job, above the 4 GiB reserve; the floor
is the reserve plus the first job (10.5 GiB). Plenty (12 GiB) still runs uncapped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(deploy): the uncapped line is the measured uncapped peak plus the reserve, 13 GiB (Cormac on #4479)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* test(deploy): at the floor plus one job the build is uncapped (13 GiB), not two jobs (Codex on #4479)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant