Repository navigation
fix(convert): refuse a lone split GGUF part (Splash int8 align S36a) - #353
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
837e50b to
e85d349
Compare
1e94448 to
8f9d276
Compare
e85d349 to
61602e8
Compare
8f9d276 to
04c5e89
Compare
61602e8 to
3c1029d
Compare
Splash's GgufFile refuses a GGUF whose split.count (absent = 1) is not the number of files read, or whose split.tensors.count (absent = tensors read) is not the tensors read; only integer keys count, as Splash's `unsigneds`. reject_split now follows that rule, names the other parts and gives the llama-gguf-split --merge command. It runs first in plan_gguf_import (mlx convert, --mmproj, --draft, native prepare, from_asset_dir), first in check_main_header (before the architecture check), and in preflight_muse_dflash_gguf. A merged file (split.count 0) is still read. Co-Authored-By: Claude Opus 5.5 <[email protected]>
04c5e89 to
810628d
Compare
…align S27) (#354) ## What Stage S27 of the Splash int8 KV alignment. It stacks on #353 (S36a). The reference is Splash `9124ff2c` (1.6.0). TS only. The Messages surface now follows the Splash 1.6 rules for thinking, stops, proxies and stop reasons. | Change | mlx-node | Splash | |---|---|---| | Thinking share: when `max_tokens` is set, the thinking budget scales by `budget*max_new // min(requested, budget+max_new)` | `ChatSession.constrainToContextCapacity` | `Frontend.chat_job` | | `thinking.type: "enabled"` → `budget_tokens` (400 below 1024); `mlx serve --thinking-token-budget N` sets the default | `anthropic-request.ts`, `serve.ts` → host → server → router | `_thinking_budget`, `_generation_options` | | One `withLoopbackNoProxy(env)` for the Claude child and grok: NO_PROXY gets `127.0.0.1,localhost,::1`, keeps entries, leaves `*` alone | new `loopback-env.ts` | `_reach_loopback_directly` | | A turn whose output the window clamped ends with `model_context_window_exceeded` | `anthropic-response.ts`, `messages.ts` | `stop_reason`, `output_clamped_to_context` | | Stop buffer: one KMP state per stop, first stop to complete wins (linear time) | `stop-sequence-buffer.ts` | `StopSearch`, `_prefix_function` | | Stop validation: an array, ≤ 4 stops, ≤ 16,384 chars, each with a non-space char; else 400 naming `stop_sequences` | `anthropic-request.ts` | `_stop_sequences` | | count_tokens uses the clamp's count; a nameless `<tool_call>` comes back as text | `messages-count-tokens.ts`, `chat-session.ts` | `frontend.py` | ## Labelled choices and gaps - A budget that is not below `maxNewTokens` stays as sent, not dropped: in mlx-node a missing budget means the effort default (256 for some families). The engine never forces `</think>` there, so the effect equals Splash's "no cap". - The non-streaming path now runs the preflight, to carry the clamp flag (one extra template render). - Open: `thinking.type: "disabled"` does not set effort to none; a nameless call's text is added after the answer text; count_tokens also rejects bad `stop_sequences`; no engine signal for "ended at what memory holds"; no env var for the default budget; JS `trim()` vs Python `strip()` differ on a few characters. ## Tests `vp test` over `__test__/server`, `__test__/cli`, the chat-session tests, `packages/lm/__test__`, `packages/cli/__test__`: 2,203 passed. 12 named mutations (M1-M11, M5b), each red then green. `yarn typecheck`, `vp lint --type-aware --type-check` and `vp fmt` are clean on the touched files. No regex in new code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
What
Stage S36a of the Splash int8 KV alignment. It stacks on #347 (S18b2). The reference is Splash
9124ff2c(1.6.0).mlx convertread one part of a split GGUF (NAME-0000K-of-0000N.gguf) and gave no error: the output held only that part's tensors. Now every GGUF entry that reads a single file refuses a lone split part, as SplashGgufFile::GgufFiledoes.The rule (Splash
GgufFile::GgufFile)split.count(absent = 1) must be 1. A larger count is refused. The message names the parts (found withresolve_gguf_shards) and gives thellama-gguf-split --mergecommand.split.tensors.count(absent = the tensors read) must equal the tensors in the file.The split-aware loaders (Flash Next
index_gguf, DeepSeek V4.1shard_paths) do not reach these checks, so they still load split files.Labelled gaps
split.count == 0(whatllama-gguf-split --mergewrites) is accepted. Splash refuses it.--mmprojis refused only after the main conversion. No output is damaged, because convert stages its output.Tests
5 new tests (T1-T5), 8 named mutations, each red then green. Scoped
cargo test -p mlx-core --lib -- utils::gguf engine::checkpoint_source convert::: 492 passed.cargo fmt --checkandcargo clippy --all-targets -D warningsare clean. Docs:docs/convert-quantize.md(trap 13 removed, guard row added),docs/cli.md.🤖 Generated with Claude Code