Skip to content

fix(serving,deploy): --train-dir only to an engine that lists it; the consumer aligns submodules (P0: a lagging engine would not start) - #4446

Merged
joelteply merged 2 commits into
canaryfrom
fix/train-dir-only-when-engine-accepts
Sep 27, 2026
Merged

joelteply merged 2 commits into
canaryfrom
fix/train-dir-only-when-engine-accepts

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

P0 for any node whose engine lags its pin, starting with the 5090.

What happened (BigMama, 2026-09-27):

Fix 1, the hazard (inference/llama_server.rs):

  • --train-dir is passed only to an engine whose own --help lists the option. The once-per-process probe that already reads the engine's KV cache types records it.
  • Unknown counts as no, whether the engine wasn't probed or didn't answer. In-engine training is never worth a lane.
  • The probe row carries train_dir.
  • Checked against real binaries: the new engine prints --train-dir DIR at the start of a line, and 965d38a90 prints nothing for it.

Fix 2, the wedge (bin/continuum.rs, deploy-consume):

  • After its checkout, the consumer runs git submodule update --recursive. It touches only initialized submodules, so a deploy never starts a fresh clone. A submodule with local changes fails loudly instead of losing them.
  • The dirty check ignores submodule pointers, since aligning them is now the consumer's own job.

Not fixed here: engine convergence by the consumer. On Windows it needs the elevated registration, so today an operator runs continuum install. With fix 1, a lagging engine means training is off and serving is unchanged, never a dark lane. The engine then converges whenever install runs.

Test: train_dir_is_accepted_only_when_the_engines_help_lists_it. Only a help text that lists the option counts; a mention or an empty text does not.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

joelteply and others added 2 commits September 26, 2026 23:27
… — an older engine refuses the flag and the lane does not start

#4438 passes --train-dir to every lane. An engine older than the flag rejects it, and the lane
does not start. On the 5090 the core deployed while the engine stayed at b10765-965d38a90 (the
consumer converges the core, not the engine), so only a wedged dirty check kept #4438 off her.

The once-per-process --help probe (the one that reads the engine's KV cache types) now also
records whether the engine LISTS --train-dir (a line starting with it: the real help prints
"--train-dir DIR ..."; 965d38a90 prints nothing for it). The lane gets the flag only then;
unknown (no probe, no answer) is no — in-engine training is never worth a lane. The probe row
carries train_dir.

Test: train_dir_is_accepted_only_when_the_engines_help_lists_it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
… and a stale submodule pointer is not "uncommitted work"

`git checkout --detach <tip>` moves gitlinks, not submodule trees: #4437's deploy left
core/vendor/llama.cpp at 965d38a90 under a tip pinning 66035e261, and the mismatch then read as
dirty, so the consumer refused every later tip (NothingOwed/RefuseDirty with dirty=true).

After its checkout the consumer runs `git submodule update --recursive` (initialized submodules
only: a deploy never starts a fresh clone; local changes inside a submodule fail it loudly
instead of losing them), and its dirty check ignores submodule pointers (aligning them is its
own job now). Engine convergence itself still needs the elevated registration (#4382:
`continuum install`); the lane-side gate in the previous commit keeps a lagging engine safe.

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

Copy link
Copy Markdown
Contributor Author

Reviewed at b4f00d4 (Cormac). The code reads correct. My word is APPROVED once lib CI is green; I'll post it then. I read the code and did not build it.

  • The guard is right. The --help probe is awaited (llama_server.rs:4659) before the invocation reads engine_accepts_train_dir() (4820), and an unprobed or failed probe reads as NO. That's the only answer that can't keep a lane from starting. Matching on a line starting with --train-dir is stricter than "mentions it", and the test pins both.
  • The consumer runs submodule update after checkout, on initialized submodules only, and the dirty check ignores gitlinks. Both are right.

Non-blocking:

  1. This makes the lanes safe; it doesn't converge the engine. On every consumer path the engine is still never rebuilt: on the Macs, install-llama-server.sh runs only in start-server.sh's non-BUILD_ONLY branch, and the consumer's reboot is build-only plus a kickstart. So after this PR, nodes deploy safely with training silently OFF until someone runs a full start or install. The probe line says train_dir=false. Something that turns it into a board-visible "engine behind its pin" would stop it from staying unnoticed. That is the card for Converge Windows engine receipts through continuum install #4382's owner, and worth filing now.
  2. The answer is cached once per process. If the engine binary is replaced under a live core, training stays off until the core restarts. That's the safe direction, so this is just for the record.
  3. With --ignore-submodules=all, uncommitted edits INSIDE the llama.cpp tree no longer count as dirty. submodule update then carries non-conflicting edits along silently, so the build uses them, and fails only on conflicting ones. Nobody should be editing there on a deploy tree, but it is a small hole in the "never builds an operator's uncommitted work" rule. No single --ignore-submodules mode ignores a moved pointer while still counting content edits (dirty is the reverse). A separate git submodule foreach --quiet --recursive git status --porcelain check would close it, if you want it closed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

@joelteply

Copy link
Copy Markdown
Contributor Author

Fable: APPROVED at b4f00d4, pending green (the word is on airc).

  • The help check matches the fork. arg.cpp declares {"--train-dir"}, "DIR" with no short alias, so the help line starts with the flag.
  • Unknown means no, so the only failure mode is a lane without /train. It is never a lane that fails to start.
  • The submodule update does not use --init and fails loudly on local changes. It moves the engine SOURCE only. The binary still converges only through install (Converge Windows engine receipts through continuum install #4382), and the probe keeps that safe.

Not blocking: the ASKED swap means a second lane launched during the first probe returns at once with the flag unset. That lane runs without /train for its lifetime. It is the safe direction; a follow-up could have later callers wait on the probe.

@joelteply
joelteply enabled auto-merge (squash) September 27, 2026 04:39
@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVED at b4f00d4 (Cormac), with CI 8/8 green. The review above stands; the three notes are non-blocking.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

@joelteply
joelteply merged commit 8d69195 into canary Sep 27, 2026
8 checks passed
@joelteply
joelteply deleted the fix/train-dir-only-when-engine-accepts branch September 27, 2026 04:45
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