Skip to content

gpu-minimaxm3: MiniMax-M3's MSA, body, forced e2e arm and prompt batch; one prompt-batch walker with Solar-Open2 - #599

Merged
midagedev merged 13 commits into
mainfrom
mm3r5
Oct 21, 2026
Merged

midagedev merged 13 commits into
mainfrom
mm3r5

Conversation

@midagedev

Copy link
Copy Markdown
Owner

MiniMax-M3 on the card: block-sparse attention, the body and decode step, the teacher-forced e2e arm, and the prompt batch. The prompt-batch walker is now one common owner, shared with Solar-Open2.

What changes

  • gpu: flash_gqa's listed walk becomes a KeyWalk, and a per-key-head block-list walk sits beside the token list (gqa_flash_seg_mma_p16_blocks).
  • gpu-minimaxm3 (new crate):
    • The MSA attention (index scores, block pick, flash over the picks).
    • The card body with its dense and routed FFN and the decode step.
    • The forced row and the prompt batch's attention.
  • runtime::msa: the host twin of the MSA rule.
  • gpu-deepseek41:
    • Solar's routed block and open are lifted into the common owner shared_routed, and MiniMax-M3 uses them.
    • prompt_walk is the prompt-batch walker both families call. Solar's prefill.rs keeps only its mixers (879 → 645 lines).
  • gpu-gates:
    • The teacher-forced arm forced_layers_near_<slug> in the common lcpp e2e harness.
    • The prefill clauses in shared/prefill_clauses.rs.
    • New gates gate_minimaxm3_msa, gate_minimaxm3_e2e and gate_minimaxm3_prefill.

Evidence (RTX A6000, this head)

  • gate-ptx-spill PASS: generate_ds41 367/367 pinned, 0 violations.
  • gate-gpu-minimaxm3-rope, -msa, -e2e (417 s) and -prefill all PASS.
    • e2e: no forced flip on the oracle's own input; worst flip-free ratio 2.68 against a band of 10.
  • gate-gpu-solar2-e2e, -prefill and -serve (fixture tier) PASS.
  • gate-gpu-gates-lib and gate-gpu-lib PASS. just check rc 0, just mac-lint 11.
  • canon-check before the rebase: 1349/1349 entries identical, for R4b and for R5a.
  • Solar prefill is a move: the fixture gate prints the base's lines exactly.
  • FAIL-first mutants, each red and then reverted:
    • MSA: 5 mutants.
    • Forced arm: the ratio band, and the router bias ignored.
    • Prefill: K/V planes swapped, and a unit row that sees later rows' index keys.

Known limits

  • MiniMax-M3's prompt unit is 16 rows. The 64 MiB scratch term bounds it, because the decode flash keeps 2.6 MB of partials per row.
  • top_logprobs is deferred by name for MiniMax-M3. A routing flip is a discrete exchange of experts, so no σ can be derived.

This work was written with AI help: implementation rounds run by delegated models, and review and gate re-runs by Claude.

🤖 Generated with Claude Code

@midagedev midagedev added the needs-gpu Changes code a card must check, and carries no gate run on a card label Oct 21, 2026
@github-actions github-actions Bot added gpu The card engine: crates/gpu*, crates/app host Host crates: qdot, threads, engram, engram-lab, runtime, sampler, levers, decision, vision, refset model The CPU engine and model files: crates/model, models, hf, gguf, tokenizer, jinja placement Placement planning: crates/placement tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo labels Oct 21, 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: scratch accounting undercounts an allocation, and the prefill gate accepts non-finite results.

Must fix

1. Count the batch's h buffer

crates/gpu-deepseek41/src/shared_routed.rs:347
new allocates h at line 321, but bytes omits it. Through Routed::batch_bytes, MiniMax's scratch check and Solar's prompt-reserve check undercount by 4 * cap * max(ff, dense_ff) bytes [derived]. A budget inside that gap passes. Fix the shared accounting before both bodies rely on it. Replace the sum term:

+ self.ids.num_bytes() + self.h.num_bytes()

2. Reject non-finite results when a comparison is deferred

crates/gpu-gates/src/bin/shared/prefill_clauses.rs:145
A NaN in a batch tap at layer 3 becomes infinite distance. MiniMax's ceiling there is infinity, so inf > inf is false and layers_near passes it. Line 111 also accepts NaN inputs when bound=None; identical NaN bits pass the group comparison. Keep finiteness independent of the deferred tolerance so the gate detects this regression. Replace line 145:

.position(|(l, &d)| !d.is_finite() || d > (case.tap_ceil)(case.tier, l));

Replace line 111:

let finite = s.iter().chain(b).all(|v| v.is_finite());
let pass = finite && (bound.is_none() || z <= k) && top.len() == TOP;

3. Refuse a vocabulary array with non-string entries

crates/gpu-gates/src/bin/gate_minimaxm3_e2e.rs:269
An integer-valued token array becomes empty pieces. --smoke prints those pieces and can succeed; model::arch::n_vocab checks the array length, not its element types.
Reject malformed metadata before diagnostics hide it. Replace line 269:

_ => panic!("tokenizer.ggml.tokens contains a non-string entry"),

4. Give bias resolution one owner (R14)

crates/gpu/src/routed_block.rs:283 duplicates crates/gpu/src/routed_block.rs:308.
Both resolve the same bias and error. Reuse the new owner before routing changes diverge:

fn route_in<'a>(
    &'a self,
    w: &'a Weights,
    l: usize,
    gpu: &Gpu,
) -> Result<RouteIn<'a>, GpuError> {
    let layer = self.layer(l)?;
    let bias = self.bias_of(w, l)?;
    Ok(RouteIn {
        w: w.f32_tensor(self.what, &layer.router)?,
        bias,
        scale: self.dims.scale,
        fault: gpu.layer_sink(l)?,
    })
}

5. Reuse the extracted vector check (R14)

crates/gpu/src/site.rs:255 duplicates crates/gpu/src/arch/hybrid.rs:761.
Both validate the resident vector's length. Reuse the shared owner now:

pub(crate) fn vector(&self, l: usize, stem: &str, len: usize) -> Result<String, GpuError> {
    site::vector(self.w, self.what, layer_name(l, stem), len)
}

6. Remove unused public elements (R13)

crates/gpu-deepseek41/src/prompt_walk.rs:193
No callers use BatchBufs::{group,t_max} (lines 195, 201), MsaScratch::rows (crates/gpu-minimaxm3/src/attn.rs:567), or MiniMax Body::{held,embed} (crates/gpu-minimaxm3/src/body.rs:605,680). MiniMax Dims::{expert_ff,shared_ff} (body.rs:87–88) are only initialized.
Delete the five methods and their docs, and only the two unused Dims fields and their initializers. Change the module's BatchBufs::group doc link to plain group. This avoids maintaining unused API.

Non-blocking

⚠ Supply the current-head performance proof: crates/gpu-deepseek41/src/experts.rs:216 replaces a constant activation selector with a runtime argument. Attach the current-head PTX comparison and the same-lease Solar dispatch A/B required by R20 and AGENTS.md. The body reports canon-check before the rebase and no A/B.

Optimization headroom

  • G, per-launch and per-sync fixed cost: crates/gpu-minimaxm3/src/prefill.rs:361 fills the dense route on every attention call. Check route.filled() != Some(m), as SharedWide::run does. This saves one launch whenever the previous fill used the same row count [derived].

Checked

Duplicates: items 4–5 reuse existing owners and remove code. Searches confirm the unused elements in item 6.
Complexity: diagnostics are aiming signals; no finding rests on a score.
Silent failure: the vocabulary fallback reaches smoke output; the omitted allocation reaches both budget checks.
Tests: static comparison checks confirm the non-finite acceptance in item 2. GPU gates were not rerun.
Gates: MiniMax configures infinite tap ceilings from layer 3 and defers the logits tolerance.
Escape catalog: none of the retained findings relies on C1–C4.

Notes

GPU evidence lacks the nvidia-smi line, paired hashes and gate commands with output.

Card check: needs-gpu. This pull request changes crates/gpu-deepseek41/Cargo.toml, crates/gpu-deepseek41/src/block.rs, crates/gpu-deepseek41/src/experts.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)

.flatten()
.map(|b| b.num_bytes())
.sum::<usize>()
+ self.ids.num_bytes()

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.

Include the allocated h buffer in both bodies' placement totals.

Suggested change
+ self.ids.num_bytes()
+ self.ids.num_bytes() + self.h.num_bytes()

let first = table
.iter()
.enumerate()
.position(|(l, &d)| d > (case.tap_ceil)(case.tier, l));

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.

An infinite ceiling must still reject NaN and infinite distances.

Suggested change
.position(|(l, &d)| d > (case.tap_ceil)(case.tier, l));
.position(|(l, &d)| !d.is_finite() || d > (case.tap_ceil)(case.tier, l));

let z = (lb[id] - ls[id]).abs() / sigma_lp(ls[id].exp(), sq).max(f64::MIN_POSITIVE);
if z.is_nan() || z > w.0 { (z, id) } else { w }
});
let pass = (bound.is_none() || z <= k) && top.len() == TOP;

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.

Deferring the tolerance must still reject non-finite logits.

Suggested change
let pass = (bound.is_none() || z <= k) && top.len() == TOP;
let finite = s.iter().chain(b).all(|v| v.is_finite());
let pass = finite && (bound.is_none() || z <= k) && top.len() == TOP;

.iter()
.map(|v| match v {
gguf::Value::String(s) => s.clone(),
_ => String::new(),

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.

Refuse invalid vocabulary metadata instead of printing an empty token piece.

Suggested change
_ => String::new(),
_ => panic!("tokenizer.ggml.tokens contains a non-string entry"),

@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:

  • Scratch accounting: open (shared_routed.rs:347).
  • Non-finite prefill: open (prefill_clauses.rs:111,145).
  • Vocabulary: open (gate_minimaxm3_e2e.rs:268).
  • Bias: open (routed_block.rs:308).
  • Vector check: open (arch/hybrid.rs:761).
  • Unused API: open (prompt_walk.rs:195).
    The timed A/B request is withdrawn; the current-head move proof remains open.

Verdict: MUST_FIX: six earlier defects remain, plus unused serving-flag hooks.

Must fix

1. Count the batch's h buffer

crates/gpu-deepseek41/src/shared_routed.rs:347
new allocates h at line 321, but bytes omits it. Through batch_bytes, MiniMax's scratch check and Solar's prompt-reserve check undercount by 4 * cap * max(ff, dense_ff) bytes [derived]. A budget inside that gap passes. Fix the shared sum before both bodies rely on it. Replace line 347:

+ self.ids.num_bytes() + self.h.num_bytes()

2. Reject non-finite results independently of deferred tolerances

crates/gpu-gates/src/bin/shared/prefill_clauses.rs:145
A NaN batch tap becomes infinite distance. MiniMax's ceiling from layer 3 is infinity, so inf > inf is false and the layer passes. Line 111 also accepts NaN logits with bound=None. Reject non-finite values before further gates rely on these checks. Replace line 145:

.position(|(l, &d)| !d.is_finite() || d > (case.tap_ceil)(case.tier, l));

Replace line 111:

let finite = s.iter().chain(b).all(|v| v.is_finite());
let pass = finite && (bound.is_none() || z <= k) && top.len() == TOP;

3. Refuse non-string vocabulary entries

crates/gpu-gates/src/bin/gate_minimaxm3_e2e.rs:268
A numeric token array becomes empty pieces; n_vocab checks its length, and --smoke can print empty text and succeed. Reject malformed metadata before the diagnostic hides it. Replace line 268:

_ => panic!("tokenizer.ggml.tokens contains a non-string entry"),

4. Reuse bias resolution (R14)

crates/gpu/src/routed_block.rs:308 duplicates crates/gpu/src/routed_block.rs:283.
Both resolve the same bias and error. Remove the second match before the paths diverge:

let bias = self.bias_of(w, l)?;

5. Reuse vector validation (R14)

crates/gpu/src/arch/hybrid.rs:761 duplicates crates/gpu/src/site.rs:255.
Reuse the length-check owner before their refusals diverge:

pub(crate) fn vector(&self, l: usize, stem: &str, len: usize) -> Result<String, GpuError> {
    site::vector(self.w, self.what, layer_name(l, stem), len)
}

6. Delete the unused API (R13)

crates/gpu-deepseek41/src/prompt_walk.rs:195
Searches find no callers of BatchBufs::{group,t_max} (lines 195, 201), MsaScratch::rows, or MiniMax Body::{held,embed} (body.rs:605,680). Its Dims::{expert_ff,shared_ff} (body.rs:87–88) are only initialized. Delete these five methods and their docs, the two fields and initializers, and replace the module's BatchBufs::group doc link with plain group. This avoids maintaining unused API.

7. Keep flag rejection in the common owner (R14)

crates/gpu-gates/src/bin/shared/serve_seats/hybrid.rs:47
Both families set Flags=() and return Ok(false) from flags; open_session never reads a.flags. Remove these unused hooks before they spread.

Delete Family::Flags, Family::flags, and both families' corresponding declarations. Change open_session's argument to Open<()>. In impl Tiered for Hybrid<F>, use type Flags = (); and replace its parser:

fn flags(_flag: &str, _value: &str, _out: &mut ()) -> Result<bool, GateError> {
    Ok(false)
}

Non-blocking

⚠ Supply the current-head move proof: crates/gpu-deepseek41/src/experts.rs:216 changes activation dispatch. Attach the current-head PTX comparison and unchanged structural records required by AGENTS.md's move class. Only pre-rebase canon checks are reported.

Checked

Duplicates: bias/vector copies and unused API/flag hooks confirmed.
Complexity: serve_gate::served is 30 in diagnostics; no finding rests on the score.
Silent failure: empty token pieces reach smoke output.
Tests: static non-finite comparisons confirmed; GPU gates not run.
Gates: deferred logits and infinite tap ceilings accept non-finite results.
Escape catalog: no retained finding matches C1–C4.

Notes

GPU evidence lacks the nvidia-smi line, paired hashes and gate commands with output.

Card check: needs-gpu. This pull request changes crates/app/Cargo.toml, crates/app/src/arch/minimaxm3/mod.rs, crates/app/src/arch/mod.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)

.flatten()
.map(|b| b.num_bytes())
.sum::<usize>()
+ self.ids.num_bytes()

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.

Include the allocated h buffer in batch scratch accounting.

Suggested change
+ self.ids.num_bytes()
+ self.ids.num_bytes() + self.h.num_bytes()

let first = table
.iter()
.enumerate()
.position(|(l, &d)| d > (case.tap_ceil)(case.tier, l));

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.

Infinite ceilings must still reject non-finite layer distances.

Suggested change
.position(|(l, &d)| d > (case.tap_ceil)(case.tier, l));
.position(|(l, &d)| !d.is_finite() || d > (case.tap_ceil)(case.tier, l));

let z = (lb[id] - ls[id]).abs() / sigma_lp(ls[id].exp(), sq).max(f64::MIN_POSITIVE);
if z.is_nan() || z > w.0 { (z, id) } else { w }
});
let pass = (bound.is_none() || z <= k) && top.len() == TOP;

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.

Deferred tolerances must still reject non-finite logits.

Suggested change
let pass = (bound.is_none() || z <= k) && top.len() == TOP;
let finite = s.iter().chain(b).all(|v| v.is_finite());
let pass = finite && (bound.is_none() || z <= k) && top.len() == TOP;

.iter()
.map(|v| match v {
gguf::Value::String(s) => s.clone(),
_ => String::new(),

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.

Reject malformed vocabulary entries before smoke output hides them as empty pieces.

Suggested change
_ => String::new(),
_ => panic!("tokenizer.ggml.tokens contains a non-string entry"),

midagedev and others added 13 commits October 21, 2026 22:35
…list walk beside the token list (gqa_flash_seg_mma_p16_blocks)

The _p12_sel entry keeps its md5; the new entry walks ascending 128-position block ids per (row, key head) in place,
so a prompt row stages no gathered copy. A block past the cache raises PoolSelect, a zero count key_count.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…cores, the per-key-head block pick and the flash over the picks, with its gate

runtime::msa is the host twin (the block max of four unscaled dots, the local blocks forced, low id first on a tie, every
block kept below 17). gate_minimaxm3_msa holds ids to it at counts across the block edges up to 32768, the attention
bit-identical to dense where every block is kept and inside the f64 band elsewhere; five mutants red.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e step, its e2e gate; Solar's routed block, open and e2e harness lifted into common owners

MiniMax-M3 (R4a): the card body (GQA K/V beside the f16 index-key cache MSA reads, the F32 indexer projections), the
decode step (per-head q/k norm, partial NeoX rope 64 of 128, MSA past the three dense layers), the dense and routed FFN
on SwiGLU-OAI, host and card experts through the common shell, the shared expert, and the open. Decode only: a prompt
batch and slots > 1 are refused by name. gate_minimaxm3_e2e runs the common lcpp e2e clauses on ref_minimaxm3_a..e.

Lifts, so the next hybrid family attaches cheaply:
- gpu-solar2/ffn.rs -> gpu-deepseek41/shared_routed.rs (a generic Routed block with a dense lead arm); Solar's ffn.rs is
  an alias.
- block FFN and the q8 pair kernel take the activation as an argument (V4.1's clamp is a wrapper);
  ds41_shexp_gate_up{,_q8_0_mcol} change PTX with values held by their owning gates.
- one_card_run / agreed / hosted_hybrid (gpu model.rs), Site::of_file, site::vector, hosted_stacks (Solar and MiMo call
  them); place_hybrid's KvLayout carries the index keys; arena_leg reads its rule from the host form.
- gate-side: shared/lcpp_e2e.rs out of gate_solar2_e2e (570 -> 86 lines), solar2_seat 286 -> 178.

Two kernel entries for the four-slot routed counts (ds41_ffn_handoff_4, ds41_ffn_card_acc_4), pinned in ptx-shapes and
the unsafe ratchet. The e2e gate's layer_outputs and top_logprobs clauses are red on the borrowed Solar band: the
divergence opens at near-tie top-4 flips (the next round adds the teacher-forced arm and the family's own band).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01REHZMoiqEUnFCPxtpyc1Pg
…2e harness, and MiniMax-M3's own band (R4b)

- lcpp_e2e: forced_layers_near_<slug>. Each layer runs alone at each position on the oracle's own
  input. The flip-free sites' feed-forward output is held to a ratio band over the one-sided
  Q8_K/Q8_0 activation gap. The router must agree with the oracle wherever the oracle's 4th-5th
  margin is above the f32 sum-order band. The free chain is bounded only over the prefix the run's
  routing holds (sqrt(prefix) * eps_forced), and top_logprobs is deferred by name for MiniMax-M3.
- gpu-minimaxm3: Body::forced_row (forced.rs); the attention sub-layer is shared with the step
  through AttendParts.
- gpu, gpu-deepseek41: the route ids and selection bias read back; the host step port keeps each
  layer's ids of the last step.
- refset consumers and the gate-paths derive row for minimaxm3.

gate-gpu-minimaxm3-e2e green on the A6000 (414 s): forced flips on the oracle's own input 0;
flip-free ratio worst 2.68 (band 10); prefix 3, ceiling 0.0043. Solar-Open2 e2e/prefill fixture
and gpu-gates lib green, box check rc 0, mac-lint 11.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…th families call; MiniMax-M3's prompt batch (R5a)

- gpu-deepseek41 prompt_walk: the walker's owner. It splits a group into units, stages their rows on
  the host, walks the layers with the routed block over the unit's slots, then runs the head and
  checks the fault word. A family supplies only its attention (BatchAttention).
- gpu-solar2 prefill: Solar's half only, the KDA and NoPE-GQA mixers over a unit's rows
  (879 -> 645 lines). This is a move: the fixture gate prints the base's lines exactly.
- gpu-minimaxm3 prefill: MiniMax's half. Every row's index key is appended before any row scores,
  each row selects blocks over its own live count, then the selected flash runs. T_MAX 16 comes from
  the 64 MiB scratch term: the decode flash keeps 2.6 MB of partials per row.
- gates: shared/prefill_clauses.rs holds the four clauses. gate_solar2_prefill keeps its seat open
  and its doc. gate_minimaxm3_prefill (new) bounds the layers before the routing prefix and defers
  the logits comparison by name.

canon-check de1fc7806 --worktree: 1349 of 1349 identical. A6000: gate-gpu-minimaxm3-prefill and -e2e
PASSED, gate-gpu-solar2-prefill real and fixture PASSED, solar2-e2e fixture and gpu-gates lib green.
Box check rc 0, mac-lint 11. FAIL-first: a K/V swap and a unit row that sees later rows' index keys
each turn the prefill clauses red.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…solo and in the v41-load group as the e2e

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…at Solar-Open2 now shares (R5b)

- app arch: HybridCfg and the blanket Open/Prompt/Keep for one-sequence hybrid bodies; Solar's module
  131 -> 78 lines, MiniMax-M3's new (74).
- serve_seats/hybrid.rs: Family, Hybrid<F>, its Log, Seat and Tiered impls, lifted from solar2.rs
  (383 -> 172); serve_seats/minimaxm3.rs and `bloomery-serve --model minimaxm3` at plan a.
- shared/serve_gate.rs: the four serve clauses; gate_solar2_serve keeps its seat and doc (247 -> 92),
  gate_minimaxm3_serve (new) adds place_bp_is_refused.
- model: MiniMax-M3's reasoning tags <mm:think> </mm:think> and turn end [e~[ from its chat template.

gate-gpu-solar2-serve fixture: clause lines identical to the base's. gate-gpu-minimaxm3-serve: the
refusal clauses PASS; load_and_listen waits on the minimax-m2 pre-tokenizer (next commit).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… with llama-tokenize; MiniMax-M3's serve gate whole

Pre::MiniMaxM2 runs GPT4O's one expression as the reference's std::regex
fallback runs it on the collapsed text (a non-ASCII letter is both a
capital and a lowercase letter; the symbol run's tail takes slashes). The
whitespace tail, the contraction and the one-piece split are lifted out of
the qwen35 and deepseek matchers into one copy each.

The tokenizer-minimaxm3 set (llama.cpp-solar2's llama-tokenize) and the
gate's cases and corpus tests hold our ids to it in both parse modes.
FAIL-first: digits in fours, the tail without '/', no give-back to a
non-ASCII letter, and the name dropped from NAMES each turn a test red.

serve_gate's MAX_TOKENS goes 64 -> 512 (PIN 2026-10-21): MiniMax-M3's
greedy answer ends its turn at 143 tokens, so the turn-end clause read a
cut answer; red at 64, green at 512 on the same binary.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…results refused, non-string vocab refused, one bias and vector owner, unused API and Family::Flags removed, prefill activation forms from the loaded sites

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…xm3, as every serve recipe does

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@midagedev
midagedev merged commit baccd24 into main Oct 21, 2026
4 of 5 checks passed

@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:

  • Scratch h accounting: fixed.
  • Non-finite prefill checks: fixed.
  • Vocabulary validation: fixed.
  • Bias resolution: fixed.
  • Vector validation: fixed.
  • Unused API: fixed.
  • Serving-flag hooks: fixed.
  • Current-head move proof: still open (experts.rs:216).

Verdict: MUST_FIX: dropping the selector-sink reservation makes valid long-context plans fail during load.

Must fix

1. Restore the context-sized selector-sink reservation

crates/model/src/arch/place_hybrid.rs:519
The dropped commit reserved the shared sink allocated at crates/gpu-minimaxm3/src/body.rs:187. With MiniMax's 64 query heads, 16 prefill rows and ctx=131,072, prefill flash partials need 42,598,400 B and this sink needs 33,554,432 B: at least 76,152,832 B against 67,108,864 B scratch [derived]. The rope consumes its own stage reservation. A plan that fits the card then fails the load's scratch check.
Restore the shared sizing rule before long-context serving depends on these plans. Replace this method and restore the dropped sink assertions:

fn stage_position_bytes(&self, ctx_max: u64) -> u64 {
    let sink_row = self.holds.iter().fold(0_u64, |bytes, hold| match hold {
        Hold::Attention { index, .. } => bytes.max(*index),
        _ => bytes,
    });
    (self.rope_row + sink_row) * ctx_max
}

Non-blocking

⚠ Supply the current-head move proof: crates/gpu-deepseek41/src/experts.rs:216 changes activation dispatch. Attach the current-head PTX comparison and unchanged structural records required by AGENTS.md's move class. The body reports only pre-rebase canon checks.

⚠ Show the new clause's FAIL-first run: crates/gpu-gates/src/bin/gate_minimaxm3_prefill.rs:106 adds prefill_batch_forms. Attach output with the old (false, true) batch allocation restored, then output with the fix. The body's earlier prefill mutants do not exercise this clause.

Checked

Duplicates: 4 new items searched; none duplicated. All 15 displayed dryer pairs read; their code was already reviewed and is outside this interdiff.
Complexity: flagged Body::load gains load-time site collection, with no new branch; the other 14 flagged functions are unchanged here. Scores alone produced no finding.
Silent failure: 3 repaired sites followed; malformed vocabulary returns an error, and non-finite logits and taps fail their clauses.
Tests: static mutation analysis shows the hardcoded allocation at prefill.rs:181–182 reaches a named missing-form error in the Q3K case. Dropping the sink assertions removes coverage of stage sizing. GPU gates were not run.
Gates: no tolerance moved; the dropped selector-sink reservation and its assertions need restoration.
Escape catalog: no C1–C4 matches in the interdiff.

Notes

The evidence summary lacks the nvidia-smi line, paired commit hashes and gate commands with output.

Card check: needs-gpu. This pull request changes crates/app/Cargo.toml, crates/app/src/arch/minimaxm3/mod.rs, crates/app/src/arch/mod.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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gpu The card engine: crates/gpu*, crates/app host Host crates: qdot, threads, engram, engram-lab, runtime, sampler, levers, decision, vision, refset model The CPU engine and model files: crates/model, models, hf, gguf, tokenizer, jinja needs-gpu Changes code a card must check, and carries no gate run on a card placement Placement planning: crates/placement tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant