Repository navigation
Conversation
|
Remaining owning host gates on the box (ws, This comment was written by the bloomery AI assistant on behalf of the maintainer. |
There was a problem hiding this comment.
Verdict: MUST_FIX: two shared rules are copied, and the reader stores two unnecessary fields.
Must fix
1. Give per-layer count parsing one owner
crates/model/src/arch/nemotron_h/hparams.rs:369 copies crates/model/src/arch/mimo2/hparams.rs:477. Array, length, conversion and error logic are identical; only MiMo's positive-count predicate differs. R14 applies.
Sharing the parser now removes one function and prevents later validation fixes from reaching only one family.
Delete both local readers. Import crate::arch::per_layer_count in both files, replacing Nemotron's now-unused meta_arr import. Update new-model.md to name the shared parser and the separate positive-count check. Put this owner in arch/mod.rs:
pub(crate) fn per_layer_count(
split: &Split,
suffix: &str,
n_layer: usize,
) -> Result<Vec<usize>, PlacementError> {
let items = meta_arr(split, suffix)?;
if items.len() != n_layer {
return Err(metadata(split, suffix,
format!("has {} values for {n_layer} layers", items.len())));
}
items.iter().enumerate().map(|(l, v)| {
v.as_unsigned()
.and_then(|x| usize::try_from(x).ok())
.ok_or_else(|| metadata(split, suffix,
format!("has no count at layer {l}")))
}).collect()
}Keep MiMo's positive-count rule in its existing head-count loop, replacing that loop with:
for (l, &kv) in kv_heads.iter().enumerate() {
if kv == 0 || !n_head.is_multiple_of(kv) {
return Err(metadata(split, "attention.head_count_kv",
format!("is {kv} at layer {l} for {n_head} query heads")));
}
}2. Share the convolution and recurrent-store rule
crates/runtime/src/state.rs:115 repeats crates/runtime/src/state.rs:72. Both keep conv - 1 input rows and one recurrent state. R14 applies.
One arm removes the copy before checkpoint or prompt rules change. Replace the delta-rule arm with this arm and delete the separate Mamba-2 arm:
Mixer::DeltaRule(models::DeltaRule { conv, .. })
| Mixer::Mamba2(models::Mamba2 { d_conv: conv, .. }) => {
v.push((Store::Conv, StoreRule::Window {
slots: conv.saturating_sub(1),
}));
v.push((Store::State, StoreRule::Recurrent));
}3. Remove inert header bookkeeping
crates/model/src/arch/nemotron_h/hparams.rs:73: no caller reads stored rope_dims; validation uses the local value. defaults is always empty and only passes through to Read. These fields are unnecessary elements.
Removing them now avoids carrying unused state into the public header type. Apply:
--- a/crates/model/src/arch/nemotron_h/hparams.rs
+++ b/crates/model/src/arch/nemotron_h/hparams.rs
@@ -70,5 +70,2 @@
pub value_len: usize,
- /// `rope.dimension_count`, read and not applied: an attention layer
- /// rotates nothing.
- pub rope_dims: usize,
/// The Mamba-2 widths. One set for every Mamba-2 layer.
@@ -81,4 +78,2 @@
pub kinds: Vec<Kind>,
- /// The keys this read took a default for. This reader takes none.
- pub defaults: Vec<String>,
}
@@ -139,3 +134,2 @@
value_len,
- rope_dims,
ssm,
@@ -144,3 +138,2 @@
kinds,
- defaults: Vec::new(),
};
--- a/crates/model/src/arch/nemotron_h/spec.rs
+++ b/crates/model/src/arch/nemotron_h/spec.rs
@@ -31,3 +31,3 @@
tensors,
- defaults: hp.defaults,
+ defaults: Vec::new(),
})Non-blocking
⚠ Gate evidence: crates/model/src/arch/nemotron_h/hparams.rs:292. Publish FAIL-first output for the new clauses and passing output after restoring them. Dropping the state-width refusal makes the state-96 test fail. Complete the pending gate-app, gate-union and gate-fixture results.
Checked
Duplicates: both count parsers and both store arms were read. The proposed fixes remove code and one parser function. Both dryer pairs are short reader assemblers with architecture-specific calls; neither adds a finding.
Complexity: diagnostics report new Hparams::read (26), spec_of (20), and needs (32→38). These validate headers or add enum/activation branches; complexity alone adds no finding.
Silent failure: both count parsers return named errors for wrong types or lengths. The shared-parser fix preserves MiMo's refusal of zero counts.
Tests: static inspection of nemotron_h/spec.rs:430 confirms the state-96 fixture expects the named refusal. Removing hparams.rs:292 lets that fixture read and fails its expect_err.
Gates: the PR body reports passes but supplies no FAIL-first output.
Escape catalog: C1–C4 do not match. No ledger lessons are in force.
Notes
No gates were executed here. The body has no complete card gate evidence or nvidia-smi line.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_glm5next_e2e.rs, crates/gpu-gates/src/bin/gate_qwen35moe_e2e.rs, crates/gpu-gates/src/bin/shared/glm5next_tier.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)
…ers lifted to one owner nemotron_h (NVIDIA Nemotron 3 Nano 4B) reads into a spec: Mamba-2, attention and MLP layers from the header's per-layer arrays, cross-checked against the tensors; the ssm keys; state 128 only; no rope on the attention layers; no draft. nemotron_h_moe and a missing ssm key are refused by name, and no program runs it yet. Common rows: Mixer::Mamba2 and Mixer::None, Act::ReluSqr and the rope's None (no positions) are models variants any family can use; each existing body refuses the ones it does not run by name. token_embd/output_norm/ output/blk and the positive/optional_usize key readers each have one owner in arch, and the six families re-export or call them instead of their own copies. new-model.md's reader step names those helpers. Co-Authored-By: Grok 4.7 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
… one name, Mixer::what The qwen3moe plans did not cover Mamba-2 or a layer with no mixer, so bloomery-gpu did not compile. Both plans and glm5next's trunk check now refuse those mixers by Mixer::what's name in one arm. hf-arch-check's mirror lists nemotron_h, and rustfmt runs over the nemotron files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… and the new nemotron reader Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ore arm, no inert header fields per_layer_count lives in arch/mod.rs and both nemotron_h and mimo2 call it; MiMo's KV-head loop refuses a zero count itself. The delta-rule and Mamba-2 mixers share runtime's conv-window and recurrent-state arm. nemotron_h's Hparams drops rope_dims and defaults, which nothing read. gate-paths gains a nemotron_h/** row, so a change to the reader narrows to its own gates, and new-model.md names the shared parser and that row template. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Verdict: MUST_FIX: malformed attention metadata can panic in the new reader, and the shared block formatter has a duplicate.
Must fix
1. Check attention projection products before the tensor walk
crates/model/src/arch/nemotron_h/hparams.rs:264 On a 64-bit host, an otherwise valid header with U64 attention.head_count = 2^63, KV heads 2, and key/value widths 8 passes the metadata checks. Keep all required tensors present with small, valid dimensions: Hparams::read reaches dims_agree → want → h * k, which panics when overflow checks are enabled. GGUF checks the tensors' own sizes, and spec_u32 runs only after this walk. With overflow checks disabled, the products wrap before a tensor mismatch is reported.
Cost: closing this error path in the reader now avoids carrying it into the next model stages.
Inside Hparams::read's KV-head validation loop, insert after the divisibility check:
if kind == Kind::Attention {
mul(split, "attention.key_length", n_head, key_len)?;
mul(split, "attention.value_length", n_head, value_len)?;
}Add U64-header cases that require a named metadata error for each overflowing product. Keep tensor dimensions small so GGUF byte-size checks do not reject the file first.
2. Remove the remaining block-formatter copy (R14)
crates/model/src/arch/names.rs:7 and crates/model/src/arch/qwen35moe/mtp.rs:840 both own the same blk.{index}.{stem} spelling. The MTP copy has no architecture-specific behavior.
Cost: removing it now completes this extraction before another reader copies it.
Delete the local fn blk in qwen35moe/mtp.rs and add this import:
use crate::arch::names::blk;This removes one function and reuses the existing owner without changing its callers.
Non-blocking
⚠ Supply FAIL-first evidence: crates/model/src/arch/nemotron_h/spec.rs:256. The PR body reports passing gates without a failing run for the new reader clauses. Attach the planted defect, gate command, failing output, and restored passing output.
Checked
Duplicates: both formatter definitions and the MTP callers confirmed; the shared definition is added by this diff.
Error path: followed U64 metadata parsing, layer-kind checks, required tensor checks, dimension products, and the later u32 conversion.
Tests: inspected the new mixer test; replacing its Mamba2 mixer with None would fail its assertions. No mutation or gate was run.
Scope: full review; neither revert nor no-merge mirror. No ledger lessons are in force. Escape patterns C1–C4 do not match these findings.
Notes
No build or gate was run during this review.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_glm5next_e2e.rs, crates/gpu-gates/src/bin/gate_qwen35moe_e2e.rs, crates/gpu-gates/src/bin/shared/glm5next_tier.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)
There was a problem hiding this comment.
Since the last review:
- Must-fix 1 fixed: crates/model/src/arch/nemotron_h/hparams.rs:127 checks both attention products before tensor dimension validation.
- Must-fix 2 fixed: crates/model/src/arch/qwen35moe/mtp.rs:33 imports the shared formatter; the local copy is removed.
- FAIL-first evidence request still open: crates/model/src/arch/nemotron_h/spec.rs:504.
Verdict: CLEAN: both earlier must-fix items are fixed, and the incremental diff has no new must-fix defect.
Non-blocking
⚠ Supply FAIL-first evidence: crates/model/src/arch/nemotron_h/spec.rs:504. The PR body still reports passing gates without failing output for planted defects. Attach the mutant, gate command, failing output, and restored passing output, including independent removal of each new product check. This records the regression protection before later model stages reuse the reader.
Checked
Duplicates: 4 new items checked; no actionable duplication. The short metadata setter has no equivalent shared owner. Dryer reports 0 pairs.
Complexity: Hparams::read gains one validation branch; the synthetic encoder gains one U64 match arm. The remaining crapper flags predate this incremental diff.
Silent failure: 0 new default/discard sites. Both product errors propagate as named metadata errors to the spec caller.
Tests: static mutation analysis of hparams.rs:128 and :129 shows that dropping either check makes its corresponding new test fail, through a panic or an error that fails the assertions. U64 encoding matches GGUF type 10.
Gates: no thresholds moved or cases removed; no PIN changes.
Adversarial checks: KV heads cannot exceed query heads after the positive/divisibility checks, so the new checks also bound KV products. Layers without attention never evaluate those products.
Performance: load-time metadata and test code only; no hot path changed this round.
Escape catalog: C1–C4 do not match. No ledger lessons are in force.
Notes
No build or gate was run during this review.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_glm5next_e2e.rs, crates/gpu-gates/src/bin/gate_qwen35moe_e2e.rs, crates/gpu-gates/src/bin/shared/glm5next_tier.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)
…v merges rows by glob and their gates as sets Two branches that each add a gate to one row, or rows beside each other, stopped every rebase on this file, though the right merge is mechanical. The driver runs `git merge-file --diff3`, then resolves each conflicted hunk row by row against its base: a gate either side added is in, a gate one side removed is out, the why and exceptions columns take the side that changed them. A comment both sides changed, a why both changed differently, or a row one side removed and the other changed stays a conflict (exit 1, markers left). .gitattributes names it; `--install` registers it in a clone's git config, and the registered command falls back to the text merge in a checkout from before the driver. Replayed on #179's real conflict (two hunks under the text merge): merged clean, each row's gates equal to the three-way set rule. A git rebase of that branch in a scratch repo with the driver: rc 0. Without the driver file: the text conflict as before. --self-test: 10 cases. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Part of #156 (Nemotron 3 Nano 4B), step N0: the header reader.
What
nemotron_hreads into a spec. Mamba-2, attention and MLP layers come from the header's per-layer arrays and are checked against the tensors. The ssm keys are read; state 128 only; the attention layers have no rope; there is no draft.nemotron_h_moeand a missing ssm key are refused by name. No program runs it yet; every existing body refuses the new variants by name.공통화한 것 (Commonized)
Mixer::whatnames a mixer for a refusal: both qwen3moe plans and glm5next's trunk check refuse the mixers they do not run in one arm through it (glm5next: three arms became one).Mixer::Mamba2,Mixer::None,Act::ReluSqrand the rope'sNone(no positions) aremodelsvariants any family can use. The next Mamba or NoPE model writes no new variant.blk,token_embd,output_norm,outputhave one owner inarch/names.rs; the six families re-export them instead of their own copies.positive/optional_usizekey readers have one owner inarch; qwen3moe, qwen35moe, glm5next and mimo2 call it.need.rs/state.rsrow, not a nemotron one.docs/contrib/new-model.md: the reader step names these helpers, so the next model does not write them.Gates
Host-only change:
just narrow origin/main(a13125a..66f6bdd9,--no-jit) scansbloomery-serve-ds41,gate_kquantandgate_swapidentical, so no kernel moved. The list does not narrow because the new files have no gate-paths row yet, so the owning host gates ran on the box (ws,BLOOMERY_Q_CARD=none):just gate-nemotron-meta: 13 lib tests +hw_real-file test passed (bb7a9d10)just gate-ops: 312 + 8 passed (bb7a9d10)gate-{deepseek4,ds41,glm5next,mimo2,qwen35moe,qwen3moe,qwen4exp}-meta,gate-runtime,gate-placement: rc 0 (66f6bdd9 tree)gate-app,gate-union,gate-fixture: running; results follow in a commenttools/mac-remote.sh): fmt, lint, combos green; check-recipes green locally after the gate-paths fill (e9657df)🤖 Generated with Claude Code