Skip to content

feat(server): Splash 1.6 thinking, stop and proxy rules (Splash int8 align S27) - #354

Merged
Brooooooklyn merged 3 commits into
mainfrom
feat/kv-int8-s27-server-rules
Nov 12, 2026
Merged

Brooooooklyn merged 3 commits into
mainfrom
feat/kv-int8-s27-server-rules

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Contributor

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

@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: ab62bbaf-c50b-4c99-9e1c-c13d6b0be5dc

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:50:39.228144Z fb9a592 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db3255783d

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Brooooooklyn
Brooooooklyn force-pushed the feat/kv-int8-s27-server-rules branch from ed04caf to 3717455 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-s36a-gguf-split branch from 04c5e89 to 810628d Compare November 12, 2026 15:47
Base automatically changed from feat/kv-int8-s36a-gguf-split to main November 12, 2026 15:47
Brooooooklyn and others added 3 commits November 12, 2026 23:47
- Thinking budget keeps its share of the room the window leaves; Messages
  thinking.budget_tokens (>= 1024) and serve --thinking-token-budget.
- length under a context-clamped limit reports model_context_window_exceeded.
- Stop sequences: KMP per stop (Splash StopSearch), first to complete wins;
  validated like Splash (array of strings, non-whitespace, <= 4, <= 16384).
- count_tokens shares the clamp's prompt count (effort, image widening).
- A tool call that names no function comes back as text.
- launch claude and mlx agent add loopback hosts to NO_PROXY when a proxy is set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Brooooooklyn
Brooooooklyn force-pushed the feat/kv-int8-s27-server-rules branch from 3717455 to fb9a592 Compare November 12, 2026 15:47
@Brooooooklyn
Brooooooklyn merged commit 1fbb47f into main Nov 12, 2026
@Brooooooklyn
Brooooooklyn deleted the feat/kv-int8-s27-server-rules branch November 12, 2026 15:47
Brooooooklyn added a commit that referenced this pull request Nov 12, 2026
…(Splash int8 align S28) (#355)

## What

Stage S28 of the Splash int8 KV alignment. It stacks on #354 (S27). The
reference is Splash `9124ff2c` (1.6.0).

One stalled cycle could push the MoE DFlash2 lane into anchor-only
verify cycles. The verify budget now counts a cycle as Splash
`VerifyBudget::observe` does:

```
before: counted = clamp(ms, 0.5*fit, 2*fit)
after:  counted = min(ms, 2*max(fit, mean))     (no floor)
```

`mean` is `cost.time / cost.weight` for that width. A fast cycle counts
at its own time. A cycle cut to under half its time prints one
`tracing::warn!` line at most once a minute (Splash `cuts_` /
`nextNotice_`).

Only `qwen3_5_moe/verify_budget.rs` changes. Dense qwen3_5 has no time
cap.

## Tests

- `stalled_cycle_counts_twice_the_larger_of_fit_and_mean` (both fit <
mean and fit > mean)
- `fast_cycle_counts_at_its_own_time`
- `one_doubled_cycle_does_not_lock_verification_to_the_anchor`: from the
second cycle after a 2x stall, the width stays at its pre-stall value.
Under Splash's own rule the first cycle after the stall drops to 2 rows;
this was checked against Splash `VerifyBudget.cpp` built with clang++.
- The Splash-source golden test still gives the same bits.

Mutations: the 0.5x floor back, a cap at the line alone, and the old
clamp: each turns its gate red. `cargo test -p mlx-core --lib
qwen3_5_moe::verify_budget` 11 passed; `qwen3_5_moe::dflash2` 31 and
`qwen3_5::dflash2` 171 passed. fmt and clippy are clean.

🤖 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