Skip to content

model: coverage lists minimax-m3's own rows: the group-16 flash, the partial NeoX rope, the block-max selector, the 128-expert top-4 router and the swigluoai blocks - #1054

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-q38-fix-minimax-coverage
Oct 31, 2026

Conversation

@juliankang4

Copy link
Copy Markdown
Collaborator

minimax-m3 모델이 실제로 쓰는 연산을 coverage 표가 인식하도록 고친 PR입니다.

What and why

program_of(MiniMaxM3) returns MiniMaxM3Body, but no row in AVAILABLE named that program. coverage::check (and so PlanInputs::unimplemented and PlanInputs::read) therefore listed every operation minimax-m3's kernels already run as missing, even for the released shape.

Fixes #803.

The change is in crates/model/src/arch/coverage.rs. Two existing rows gain MiniMaxM3Body because its kernels are the row's kernels: the group-16 flash (enqueue_pass_p16_blocks) and the ungated shared expert. Six rows are new, because no existing row runs those instances: the partial NeoX rope with QK norm, the block-max selector (4 heads of 128, blocks of 128, rope over 64, with top_k and local checked by runtime::msa::Msa::new), the 128-expert top-4 router under the biased-sigmoid body, the dense SwiGLU-OAI block, and the routed and shared SwiGLU-OAI experts. The router is its own row instead of an entry in SIGMOID_ROUTERS, so other models do not gain a 128/4 router they never import.

Release notes: Fixed: the coverage check no longer lists minimax-m3's supported operations as missing.

Code shape

  • No second copy. Logic two models (or two call sites) share has one common owner; I lifted it there instead of
    copying it (AGENTS.md "Common code first", docs/rust-quality.md R14). Where I found an existing copy, I
    named it below.
  • Model code holds only architecture facts. A model's own files carry only what its architecture forces
    (tensor shapes, the attention kind, the quant). A common owner gained no per-model branch, flag or trait method.
  • Dead code is gone. Nothing I made unused is left behind (functions, flags, gate clauses, docs).
  • No silent failure. Undefined input is a named error or panic, never a defined-looking output.
  • Comments state what is true now. No dates, issue numbers or how a bug was found (tools/check-comments.sh).
  • No relaxed gate. No band, tolerance or lint moved to make a check pass; a re-pin carries PIN(YYYY-MM-DD):
    and its reason.
  • cargo fmt and cargo clippy are clean on what I touched; the lint count did not go up.

Duplication found or removed (path:line), or "none": none. The selector row asks runtime::msa::Msa::new for the top_k and local rule instead of copying it.

What I ran

The change is host-side (the coverage table and its tests), so the run is the model crate's tests at head aeb57f626b0a29105d5e216d03f5544a61bcd293, base be3e6d336d7c6ac24e1ab8556b59035d4cf6e325:

cargo test -p bloomery-model -j8
test arch::coverage::tests::the_minimax_selector_row_is_the_kernels_geometry ... ok
test arch::minimaxm3::place::tests::the_inputs_describe_a_file_and_the_coverage_refuses_it ... ok
test arch::minimaxm3::spec::tests::what_no_program_runs_is_listed ... ok
test arch::minimaxm3::spec::tests::the_released_shape_is_covered ... ok
test result: ok. 600 passed; 0 failed; 7 ignored; 0 measured; 0 filtered out; finished in 3.68s

New tests:

  • the_released_shape_is_covered builds the spec at the released hparams and asserts that no need from models::needs is listed by coverage::check.
  • the_minimax_selector_row_is_the_kernels_geometry covers the released geometry (top 16, local 1) and the edge (top 32, local 32), and checks that heads 2, d 64, top_k 33, top_k 0, block 64, local 0, local 17 and rope 128 stay uncovered.
  • what_no_program_runs_is_listed now names the unsupported needs of the small header (GQA head 16 group 4, QK rope head 16, block-max 2x16 over blocks of 4, router 8 experts top 2, dense swigluoai ff 48).

AI help

AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.

…through the registry: the group-16 flash, the partial NeoX rope, the block-max selector, the 128-expert top-4 router and the swigluoai blocks
@github-actions github-actions Bot added documentation Improvements or additions to documentation model The CPU engine and model files: crates/model, models, hf, gguf, tokenizer, jinja tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo labels Oct 31, 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: CLEAN: No must-fix finding remains; current-head validation evidence is incomplete.

Non-blocking

⚠ Refresh validation evidence: spec.rs:392. The supplied test log names head aeb57f6, while this review covers 4b2e105 and includes registry and recipe changes.
Run cargo test -p bloomery-model -j8 and python3 tools/recipes.py --self-test at the current head. Include a FAIL-first result with the family coverage entry removed so the evidence covers the final change.

Checked

Duplicates: the shared-expert and group-16 predicates replace existing copies. Dryer reported 0 pairs.
Complexity: crapper flagged no function. The changes affect load-time coverage and tooling.
Silent failure: the selector's Result-to-boolean conversion leaves invalid counts uncovered; coverage names the need and placement refuses it.
Tests: static mutation review confirms assertions reject widening selector bounds, dropping rope/router guards, requiring dense widths divisible by 256, and removing the registry's family coverage entry. The unsupported-shape test checks the small header. The shared FAIL-first helper checks that removing one row adds the expected item.
Gates: no tolerance, threshold or lint level moved. The unsupported-shape assertions now name the remaining unsupported instances.
Escape catalog: no C1–C4 pattern matched. Python syntax parsing passed; the changed dispatch regex recognizes the family coverage constant.

Notes

Rust tests and Python self-tests were not executed during validation.

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

@juliankang4

Copy link
Copy Markdown
Collaborator Author

The review is done and the contribution check passed, so I'm merging this.

@juliankang4
juliankang4 merged commit 08fe863 into midagedev:main Oct 31, 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 model The CPU engine and model files: crates/model, models, hf, gguf, tokenizer, jinja tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

coverage: MiniMax-M3 has no AVAILABLE rows

1 participant