Skip to content

fix(convert): refuse a lone split GGUF part (Splash int8 align S36a) - #353

Merged
Brooooooklyn merged 1 commit into
mainfrom
feat/kv-int8-s36a-gguf-split
Nov 12, 2026
Merged

Brooooooklyn merged 1 commit into
mainfrom
feat/kv-int8-s36a-gguf-split

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Contributor

What

Stage S36a of the Splash int8 KV alignment. It stacks on #347 (S18b2). The reference is Splash 9124ff2c (1.6.0).

mlx convert read 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 Splash GgufFile::GgufFile does.

mlx convert / --mmproj / --draft ─┐
native prepare                    ├─> plan_gguf_import ─> reject_split   (new, first step)
from_asset_dir                    ─┘
family header check ──────────────────> reject_split, before the architecture check   (new)
draft preflight ──────────────────────> reject_split   (new)
native load GgufFileHandle::open ─────> reject_split   (unchanged)

The rule (Splash GgufFile::GgufFile)

  • split.count (absent = 1) must be 1. A larger count is refused. The message names the parts (found with resolve_gguf_shards) and gives the llama-gguf-split --merge command.
  • split.tensors.count (absent = the tensors read) must equal the tensors in the file.
  • Only integer values count (u8..u64, i8..i64, bool), as Splash reads them. A string, float or array value counts as absent.
  • The file name is read by a hand-written parser.

The split-aware loaders (Flash Next index_gguf, DeepSeek V4.1 shard_paths) do not reach these checks, so they still load split files.

Labelled gaps

  • split.count == 0 (what llama-gguf-split --merge writes) is accepted. Splash refuses it.
  • A lone-part --mmproj is 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 --check and cargo clippy --all-targets -D warnings are clean. Docs: docs/convert-quantize.md (trap 13 removed, guard row added), docs/cli.md.

🤖 Generated with Claude Code

@Brooooooklyn
Brooooooklyn added this pull request to stack #344 November 9, 2026 10:24
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d30145e9-5d0a-41fd-83c0-a31129dd67c3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T15:48:13.781283Z 810628d New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Brooooooklyn
Brooooooklyn force-pushed the feat/kv-int8-s18b2-vision-draft branch from 837e50b to e85d349 Compare November 9, 2026 10:53
@Brooooooklyn
Brooooooklyn force-pushed the feat/kv-int8-s36a-gguf-split branch from 1e94448 to 8f9d276 Compare November 9, 2026 10:53
@Brooooooklyn
Brooooooklyn force-pushed the feat/kv-int8-s18b2-vision-draft branch from e85d349 to 61602e8 Compare November 12, 2026 13:41
@Brooooooklyn
Brooooooklyn force-pushed the feat/kv-int8-s36a-gguf-split branch from 8f9d276 to 04c5e89 Compare November 12, 2026 13:41
@Brooooooklyn
Brooooooklyn removed this pull request from stack #344 November 12, 2026 15:43
@Brooooooklyn
Brooooooklyn force-pushed the feat/kv-int8-s18b2-vision-draft branch from 61602e8 to 3c1029d Compare November 12, 2026 15:46
Base automatically changed from feat/kv-int8-s18b2-vision-draft to main November 12, 2026 15:47
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]>
@Brooooooklyn
Brooooooklyn force-pushed the feat/kv-int8-s36a-gguf-split branch from 04c5e89 to 810628d Compare November 12, 2026 15:47
@Brooooooklyn
Brooooooklyn merged commit f518d6b into main Nov 12, 2026
@Brooooooklyn
Brooooooklyn deleted the feat/kv-int8-s36a-gguf-split branch November 12, 2026 15:47
Brooooooklyn added a commit that referenced this pull request Nov 12, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant