Skip to content

serving: an unreadable MoE GGUF is named, not served dense in silence; a dense model's GGUF is read once (card 60f74ac5, f3ba3b56 item 19) - #5214

Merged
joelteply merged 1 commit into
canaryfrom
60f74ac5/an-unreadable-moe-gguf-is-served-dense-w
Oct 21, 2026
Merged

joelteply merged 1 commit into
canaryfrom
60f74ac5/an-unreadable-moe-gguf-is-served-dense-w

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

moe_serving_context returned None both for a dense model and for a GGUF it could not read
(open or header error, no architecture, a layout error other than NotMoe, no router
top-k, no block_count). A MoE with unreadable geometry was served dense, with no expert
placement and no word. It now returns Result<Option, why>: Ok(None) is dense
(NotMoe), and an expert count with no stacked tensors or a malformed layout is an
error, not dense.

compute_expert_placement cached only a MoE context, so for a dense model the guard stayed
None and every call re-opened and parsed the GGUF header. The guard now caches the
verdict per model (Option, dense included) and probes serving.moe.geometry_unreadable
once when it is built. A GGUF that does not resolve yet is not cached, so it is read once
it lands, as before. The two readers of the guard match Some((id, Some(ctx))).

serving_daemon.rs -4 lines; lines past 1000 157,397 -> 157,393. source-hygiene 37/37 on
IntelMac. No GGUF fixture test (none exists to reuse); CI compiles it.

Co-Authored-By: Claude Opus 5.5 (1M context) [email protected]
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

@joelteply
joelteply force-pushed the 60f74ac5/an-unreadable-moe-gguf-is-served-dense-w branch 2 times, most recently from 7819a89 to 8684809 Compare October 20, 2026 03:34
@joelteply

Copy link
Copy Markdown
Contributor Author

[P1] Do not cache unreadable geometry as a successful dense-model result

Review of8684809257fbebd142961b31025e4a8436e190f8: the new Result distinguishes a dense model from an unreadable artifact, but the caller immediately converts Err to None and stores (model.id,None). Subsequent calls with the same model ID consider that cache fresh forever. A transient File::open/read failure, incomplete download or repaired GGUF therefore permanently disables expert placement for that model in this daemon, even after the artifact becomes readable. Previously the absent context was retried. The dense-success caching optimization is useful; caching errors as dense is a new recovery regression.

Cache Ok(None) as an explicit successful dense verdict and Ok(Some(ctx)) as MoE; propagate the error to the caller rather than converting it to dense. Associate success with the artifact revision/path identity if artifacts can change under the same model ID. Add a fixture for unreadable artifact -> repaired artifact with unchanged model ID, plus a proven dense artifact that is read only once. A probe does not make an error-to-dense fallback satisfy the current no-fallback rule.

Source review only, no serving-host builds or runtime changes. This behavior change also needs reapplication in the split serving owner under the current roadmap.

…; a dense model's GGUF is read once (card 60f74ac5, f3ba3b56 item 19)

Re-applied onto canary 445ae4b after #5245 split serving_daemon.rs (the builder
and its readers now live in serving_daemon/placement.rs and moe_cache.rs) and #5249
moved the probe macro to continuum_base.

moe_serving_context returned None both for a dense model and for a GGUF it could not
read (open or header error, no architecture, a layout error other than NotMoe, no
router top-k, no block_count). A MoE with unreadable geometry was served dense, with
no expert placement and no word. It now returns Result<Option<ctx>, why>: Ok(None) is
dense (NotMoe), and an expert count with no stacked tensors or a malformed layout is
an error, not dense.

The placement cache held only a MoE context, so for a dense model every call re-opened
and parsed the GGUF header. The guard now caches the verdict per model (Option<ctx>,
dense included) and probes serving.moe.geometry_unreadable once when it is built. A
GGUF that does not resolve yet is not cached, so it is read once it lands. The two
readers match Some((id, Some(ctx))).

source-hygiene 43/43 on IntelMac. Core compile is CI's.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply
joelteply force-pushed the 60f74ac5/an-unreadable-moe-gguf-is-served-dense-w branch from 8684809 to f4bd229 Compare October 21, 2026 16:58

@joelteply joelteply left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PASS #5214 at f4bd229, Fable. Source read, not built.

Claim verified: an unreadable MoE is named, not served dense in silence, and a dense GGUF is read once.

  • In moe_serving_context, only ExpertLayoutError::NotMoe maps to Ok(None). Every other failure is now an Err with its cause: open, header, architecture, an empty set with an expert count, zero experts, top-k, block_count.
  • In placement.rs, the verdict is cached per model (Option<ctx> inside the guard), so a dense model is no longer re-read every tick. The Err path fires serving.moe.geometry_unreadable with the reason before falling to dense.
  • An unresolved GGUF is not cached, so it is read once it lands.

One non-blocking note: a transient read error on a file that has landed (an I/O hiccup) is cached as dense until the model changes. The probe makes it visible, so I'm not carding it.

@joelteply
joelteply merged commit 4b176e3 into canary Oct 21, 2026
9 checks passed
@joelteply
joelteply deleted the 60f74ac5/an-unreadable-moe-gguf-is-served-dense-w branch October 21, 2026 20:39
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