Skip to content

serve gate: the live slot's shared prefix, held on the MiniMax-M3, Muse Spark and Solar-Open2 seats - #810

Merged
midagedev merged 4 commits into
mainfrom
kvclause
Oct 25, 2026
Merged

midagedev merged 4 commits into
mainfrom
kvclause

Conversation

@midagedev

Copy link
Copy Markdown
Owner

The MiniMax-M3 and Muse Spark seats keep the prefix a request shares with the live slot, but no gate held it. This adds the clause live_slot_keeps_the_prefix to the shared serve-gate owner, run by the MiniMax-M3, Muse Spark and Solar-Open2 gates.

  • A continued request reuses the slot: cache_n reaches the first request's count, and cache_n + prompt_n equals the /tokenize length.
  • A seat whose cut keeps every held position (Cut::EveryPosition: MiniMax-M3, Muse Spark) also keeps a shorter shared prefix whole. Solar-Open2 is Cut::WhereItStands (crates/app/src/arch/solar2/mod.rs).
  • With the residency lever off, the cached answer equals a cache_prompt: false run. Otherwise this step is skipped by name.

Docs: MiniMax-M3 steps its --parallel slots in turn (two lines said one slot). The prompt-cache paragraph and Known limits say that both seats keep the live slot's prefix and no saved prompt state. One seat comment is rewritten to the app's rule.

Evidence (fixture tier, lead ledger): minimaxm3-serve, musespark-serve, solar2-serve, musespark-twocard green. FAIL-first: the seat keep mutant made only the new clause red. ptx-scan --no-jit is identical for the 4 covering bins. The 13 other gates reach this change only through the comment edit in serve_seats/minimaxm3.rs (no code line). minimaxm3-twocard is real-only: it runs in the release batch.

AI-assisted (Claude).

🤖 Generated with Claude Code

@github-actions github-actions Bot added documentation Improvements or additions to documentation gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card labels Oct 25, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: MUST_FIX: the new clause accepts an invalid reference run and missing answer text, and adds duplicate request logic and unused state.

Must fix

1. Require an uncached reference

crates/gpu-gates/src/bin/shared/serve_gate.rs:497 accepts equal text even when fresh.cache_n > 0; that count is only logged. The mutant slot.reuse(held, true) at crates/serve/src/genloop.rs:2004 lets the fourth request reuse the third request's prompt, so equal deterministic text passes without an uncached reference.
Checking the reference now prevents future rollback changes from being compared against another reused state. Replace the comparison:

let same = fresh.cache_n == 0 && fresh.content == third.content;

2. Reject missing completion text

crates/gpu-gates/src/bin/shared/serve_gate.rs:392 converts absent or non-string content into "". json_of checks status and JSON syntax, not this field. Cached and reference responses without content then compare equal at line 497, reporting a successful same-answer check on malformed responses.
Rejecting malformed content here prevents a serialization regression from satisfying the comparison. Replace the field:

content: v["content"].as_str().ok_or("/completion: missing or invalid content")?.to_owned(),

3. Reuse the completion request owner (R14)

crates/gpu-gates/src/bin/shared/serve_gate.rs:374 duplicates crates/gpu-gates/src/serve_client.rs:546: the same prompt, prediction limit, temperature, token-return flag and cache flag.
Reusing the existing owner removes the second request specification without adding a helper. Replace lines 374–378:

let (st, text) = bloomery_gpu_gates::serve_client::completion_raw(
    url, ids, PREFIX_TOKENS.try_into()?, cache,
)?;

4. Remove the unread prompt count

crates/gpu-gates/src/bin/shared/serve_gate.rs:357 stores prompt_n, but no caller reads that field. Only the local count is needed for whole. All three gates include this module with dead_code allowed, so lint does not reject it.
Remove the unused state while the type has one constructor. Replace the struct, and delete the prompt_n, initializer field at line 389; retain the local count:

struct Asked {
    cache_n: u64,
    whole: u64,
    content: String,
    tokens: Vec<u32>,
}

Checked

Duplicates: the request specification repeats completion_raw; its reuse removes code. Asked.prompt_n has no readers.
Complexity: diagnostics report the new prefix clause at 17 and served_with rising 30→35 through clause dispatch.
Silent failure: the missing-content default reaches the answer comparison; timing counts already reject missing values.
Tests: static checks confirm the unchecked reference count and equal empty-string fallback. No GPU gates run.
Gates: no existing pin, band or clause removed or relaxed.
Escape catalog: C1–C4 do not match. No engine hot path changed.

Notes

Dryer did not run, as reported in diagnostics. The PR reports green gates and FAIL-first but omits the card/driver line, model path, commands and output needed for GPU evidence.

Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_minimaxm3_serve.rs, crates/gpu-gates/src/bin/gate_musespark_serve.rs, crates/gpu-gates/src/bin/gate_solar2_serve.rs … and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

holds &= exact;
if lever == "off" {
let fresh = asked(url, dir, "prefix_shorter_fresh", &ids3, false)?;
let same = fresh.content == third.content;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Require zero reused positions so this request is an uncached reference.

Suggested change
let same = fresh.content == third.content;
let same = fresh.cache_n == 0 && fresh.content == third.content;

prompt_n,
cache_n,
whole: prompt_n + cache_n,
content: v["content"].as_str().unwrap_or("").to_owned(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing or non-string content must fail instead of comparing equal as empty text.

Suggested change
content: v["content"].as_str().unwrap_or("").to_owned(),
content: v["content"].as_str().ok_or("/completion: missing or invalid content")?.to_owned(),

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since the last review:

  1. Uncached reference: fixed. crates/gpu-gates/src/bin/shared/serve_gate.rs:497 requires zero cached positions as well as equal text.
  2. Missing completion text: fixed. crates/gpu-gates/src/bin/shared/serve_gate.rs:386 rejects absent and non-string content.
  3. Duplicate request specification: fixed. crates/gpu-gates/src/bin/shared/serve_gate.rs:373 calls the existing completion_raw owner with the same request fields.
  4. Unread prompt count: fixed. crates/gpu-gates/src/bin/shared/serve_gate.rs:356 removes the field and retains the local count needed for whole.

Verdict: CLEAN: all earlier must-fix items are resolved, and the new commits introduce no proven defect.

Checked

Duplicates: 0 new definitions in the incremental diff; the duplicate request body and unused field are removed.
Complexity: diagnostics list live_slot_keeps_the_prefix at 18 and served_with at 30→35 (clause dispatch). The incremental diff strengthens the prefix clause's validation.
Silent failure: 3 response fields followed (prompt_n, cache_n, content); missing or invalid fields return errors through the gate's failing exit.
Tests: static mutation review of crates/serve/src/genloop.rs:2004: forcing slot.reuse(held, true) retains positions in the reference and makes line 497 fail. Zero-cache responses with different text also fail. GPU gates were not run.
Gates: no pin, band, threshold or clause removed or relaxed.
Escape catalog: C1–C4 do not match. No engine hot path changed.

Notes

Diagnostics report that dryer did not run. The PR reports green gates and FAIL-first but omits the card/driver line, model path, both run commit hashes, and commands with output required for GPU evidence.

Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_minimaxm3_serve.rs, crates/gpu-gates/src/bin/gate_musespark_serve.rs, crates/gpu-gates/src/bin/gate_solar2_serve.rs … and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

midagedev and others added 4 commits October 26, 2026 02:27
… held on the MiniMax-M3, Muse Spark and Solar-Open2 seats

A continued request reuses the prefix the slot holds (cache_n >= the first request's count, counted = /tokenize length).
A seat whose cut keeps every held position (Cut::EveryPosition) also keeps a shorter shared prefix whole. With the
residency lever off, the cached answer equals the cache_prompt:false one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e (every held position is kept)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eep the live slot's prefix and no saved prompt state

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…an answer without text is refused

The cache-off request now counts only when its cache_n is 0, so a server
that reuses the slot for it too goes red (mutant slot.reuse(held, true):
the reference kept 80, live_slot_keeps_the_prefix FAIL). The request goes
through serve_client::completion_raw, a missing content field is a named
error, and the unread prompt_n field is gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: CLEAN: carried from 08a657ef, not re-reviewed.

The approval of 08a657ef stands for 451e2fd0. This pull request's 4 commits are the same patches in the same order: git patch-id --verbatim (the changed lines, the lines around them and whitespace) and the subject are equal for every commit. That review ran under the reviewer instructions, tools and slag ledger that review this head, and it approved.

The base moved, and changed none of the files this pull request changes.

A carry covers each patch's own lines and the lines around them. What the base changed elsewhere is covered by CI on this head and by the landing gates.

Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_minimaxm3_serve.rs, crates/gpu-gates/src/bin/gate_musespark_serve.rs, crates/gpu-gates/src/bin/gate_solar2_serve.rs … and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: CLEAN: carried from 451e2fd0, not re-reviewed.

The approval of 451e2fd0 stands for 0a541ba1. This pull request's 4 commits are the same patches in the same order: git patch-id --verbatim (the changed lines, the lines around them and whitespace) and the subject are equal for every commit. That review ran under the reviewer instructions, tools and slag ledger that review this head, and it approved.

The base moved, and changed none of the files this pull request changes.

A carry covers each patch's own lines and the lines around them. What the base changed elsewhere is covered by CI on this head and by the landing gates.

Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_minimaxm3_serve.rs, crates/gpu-gates/src/bin/gate_musespark_serve.rs, crates/gpu-gates/src/bin/gate_solar2_serve.rs … and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

@midagedev
midagedev merged commit 4307309 into main Oct 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant