Repository navigation
Conversation
…ehind HybridOps; hybrid.rs's mamba and GQA layers split into in/core/out Co-Authored-By: Claude Opus 5.5 <[email protected]>
…side arch/, and its tests build tensor names with blk Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Verdict: MUST_FIX: the gpu crate imports a module path that does not exist at this head, and NoLeg plus the test-file helpers are proven copies of code already in chain.
Must fix
1. crates/gpu does not compile: stale import path
crates/gpu/src/arch/hybrid.rs:41 imports chain::arch::hybrid::plan. The module moved to chain::hybrid (crates/chain/src/arch/mod.rs lists only nemotron_h and qwen3moe; no arch/hybrid exists). Every CUDA body that uses arch/hybrid.rs (nemotron_h, nemotron_h_moe) fails to build. program.rs:20-21 and body.rs already use the new path, so the move commit missed this line. The canon-check and box gates in the PR body ran on base a9753394e, not on this head: re-run just canon-check and gate-gpu-nemotron-e2e on the fixed head.
Fix:
use chain::hybrid::plan::{MambaPlan, NopeGqaPlan};2. NoLeg is a second copy of the qwen3moe port
crates/chain/src/hybrid/walk.rs:21-59 equals crates/chain/src/arch/qwen3moe/walk.rs:30-68 except two strings. The doc comment says "a second copy until one common owner takes both". The rule in this project is common code first; the dryer score is 1.00. Both copies must change together when the arena rule changes, and the open bound is a safety check.
Fix: one crates/chain/src/noleg.rs with pub(crate) struct NoLeg<E> { rows: usize, what: &'static str, _error: PhantomData<fn() -> E> }, new(what, rows), and the Port impl using self.what in the open and refused texts. Delete both local copies (about 40 lines) and update the two pinned error strings in the walk tests.
3. Test helpers decl and header are copied
crates/chain/src/hybrid/test_file.rs:10-25 is identical to crates/chain/src/arch/qwen3moe/read.rs:631-647.
Fix: move test_file.rs to crates/chain/src/test_file.rs, declare #[cfg(test)] pub(crate) mod test_file; in lib.rs, and delete the two functions from the qwen3moe test module (import crate::test_file::{decl, header}). Net: fewer lines.
Non-blocking
⚠ Evidence list: the body has no nvidia-smi line and no pair of commit hashes for the A/B, so gpu-evidence cannot be granted.
Checked
- Duplicates: 14 new items checked. Hits:
NoLeg(item 2), test helpers (item 3). Dryer pair 3 (mamba_at/attn_at,program.rs:61-73) matches two differentLayervariants: not one fact, no finding. - Complexity: crapper flagged nothing.
- Silent failure: 6 sites followed (
at,NoLeg::open,mamba_at/attn_at/mlp_atmismatch,layer_plansrefusal). Each returns a named error. - Tests: mutants planted in words (drop
embed, swaplast, wrong op order, acceptm = rows + 1): each turns a walk test red. The CUDAProgramhas no host test; the PR cites the e2e mutants. - Performance: decode step; launch order and count are unchanged by the split, no new alloc or sync per layer,
NoLeg::newis a stack value. No term to write. - Gates: no pins moved. Escape catalog: no match.
Card check: needs-gpu. This pull request changes crates/gpu/src/arch/hybrid.rs, crates/gpu/src/arch/nemotron_h/body.rs, crates/gpu/src/arch/nemotron_h/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)
| use crate::tensor::{Pitched, dtod_2d}; | ||
| use crate::weights::{DevWeight, Weights}; | ||
| use crate::{DeviceTensor, Gpu, GpuError, Q8Act, Window}; | ||
| use chain::arch::hybrid::plan::{MambaPlan, NopeGqaPlan}; |
There was a problem hiding this comment.
chain::arch::hybrid does not exist; the module is chain::hybrid, so the gpu crate does not build.
| use chain::arch::hybrid::plan::{MambaPlan, NopeGqaPlan}; | |
| use chain::hybrid::plan::{MambaPlan, NopeGqaPlan}; |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Verdict: MUST_FIX: the import fix landed, but NoLeg and the test helpers are still copies of code already in chain.
Since the last review:
- Must fix 1 (stale
chain::arch::hybrid::planimport): fixed. hybrid.rs:41 now useschain::hybrid::plan. - Must fix 2 (
NoLeg): still open. - Must fix 3 (
decl,header): still open. - ⚠ Evidence list: still open.
Must fix
1. NoLeg is a second copy of the qwen3moe port
crates/chain/src/hybrid/walk.rs:21-59 equals crates/chain/src/arch/qwen3moe/walk.rs:30-68 except two strings. The doc comment says "a second copy until one common owner takes both". The open bound is a safety check, so both copies must change together. Doing it now costs about 40 fewer lines; later, a third family copies it again.
Fix: one crates/chain/src/noleg.rs with pub(crate) struct NoLeg<E> { rows: usize, _error: PhantomData<fn() -> E> }, new(rows), and the same Port impl, with fixed text chain::NoLeg in the open and refused errors (Port::refused has no self, so a per-walk name field cannot reach it). Delete both local copies and update the pinned error strings in both walk tests.
2. Test helpers decl and header are copied
crates/chain/src/hybrid/test_file.rs:10-25 is identical to crates/chain/src/arch/qwen3moe/read.rs:631-647.
Fix: move test_file.rs to crates/chain/src/test_file.rs, declare #[cfg(test)] pub(crate) mod test_file; in lib.rs, delete the mod test_file line at hybrid/mod.rs:14 and the two functions from the qwen3moe test module, and import crate::test_file::{decl, header} there and in hybrid/read.rs:153 and nemotron_h/read.rs:83. Net: fewer lines.
Non-blocking
⚠ Evidence list: the body has no nvidia-smi line and no pair of commit hashes for the A/B, so gpu-evidence cannot be granted. The canon-check and box gates ran on base a9753394e, and the last review found this tree did not compile in crates/gpu. Re-run just canon-check and gate-gpu-nemotron-e2e on the final head and paste the output.
Checked
- Duplicates: new commit adds 1 line, an import path; no new item. Dryer pairs 1 and 2 (
NoLeg) confirmed by reading both sides: must fix 1. Pair 3 (mamba_at/attn_at) matches two differentLayervariants: no finding. - Complexity: crapper flagged nothing.
- Silent failure: the new commit adds none.
- Tests: no test changed in the new commit.
- Gates: no pins moved. Escape catalog: no match.
Card check: needs-gpu. This pull request changes crates/gpu/src/arch/hybrid.rs, crates/gpu/src/arch/nemotron_h/body.rs, crates/gpu/src/arch/nemotron_h/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)
…k and reader tests Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Fixed in 1b05f11:
Net: |
There was a problem hiding this comment.
Verdict: CLEAN: both earlier must-fix items are fixed, and the new commit adds no defect.
Since the last review:
- Must fix 1 (
NoLegcopy): fixed. One owner now, crates/chain/src/noleg.rs:11. Both walks import it and the local copies are gone. - Must fix 2 (
decl,headercopies): fixed. One owner now, crates/chain/src/test_file.rs:10. The qwen3moe copy is deleted and the hybrid and nemotron_h tests import it. - Evidence list: still open (see Non-blocking).
Non-blocking
⚠ Evidence list: the body has no nvidia-smi line and no pair of commit hashes. The canon-check and box gates ran on base a9753394e, not on this head. The last two commits only move host code, so the risk is low, but gpu-evidence cannot be granted. Re-run just canon-check and gate-gpu-nemotron-e2e on the final head and paste the output with the card line.
Checked
- Duplicates: the new commits add
NoLegandtest_fileas the single owners. Grep forstruct NoLeg,fn decl,fn headerincrates/chain: one hit each. The dryer pair inprogram.rs:61-66and68-73was read in the first round (two differentLayervariants): no finding. - Complexity: crapper flagged nothing.
- Silent failure: 0 new sites. The
refusederror now carrieschain::NoLegand not the walk's name; the walk tests pin both strings. - Tests: the two pinned strings in both walk tests moved with the code. Mutant: the
openbound1..=rowschanged to1..rowsturns the 17-column and 2-unit assertions red. - Gates: no pins moved.
WHATis still used in both walks (hybrid/walk.rs:55,qwen3moe/walk.rs:58), so no dead constant. Escape catalog: no match.
Notes
CTX/diagnostics.md: both tools ran.
Card check: needs-gpu. This pull request changes crates/gpu/src/arch/hybrid.rs, crates/gpu/src/arch/nemotron_h/body.rs, crates/gpu/src/arch/nemotron_h/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)
…ain::hybrid, chain::arch::nemotron_h); the gpu body implements HybridOps (nemotron_h::Program) and its step is the walk The hybrid trunk (Mamba-2 and NoPE attention) gets the shape qwen3moe has: HybridOps is the op list a backend implements, LayerPlan the per-layer plan read from the file's header, Walk the one order (embed, each layer's in/core/out, head) over runtime::sched. Nemotron-H's MLP layer is the family's Ffn. crates/gpu's mamba_layer and gqa_layer split into in/core/out parts; the wrappers keep their signatures, so nemotron_h_moe is unchanged. The body resolves its layers from the plans (Names::mamba_of, attn_of). NoLeg and the test header builder move to chain::noleg and chain::test_file, shared with qwen3moe. A move: the same launches in the same order. Redo of #848 on today's main (the imatrix, NVFP4 and out-gate sites of hybrid.rs carried over). 13 chain tests, each with its mutant under .mutants/nemolift-*.patch. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CjHkkjGpdUeLi6Z7fiwRXH
The Nemotron-H decode walk, its layer plans and its reader lived in
crates/gpu, so a second backend (Metal) could not run the same walk. This change lifts them tocrates/chain:crates/chain/src/hybrid/: the trunk a hybrid (Mamba-2 + attention) model shares:HybridOps(11 methods), the plans, the reader and the walk.crates/chain/src/arch/nemotron_h/: what only Nemotron-H forces (its layer kinds, its plan).crates/gpu/src/arch/hybrid.rs:mamba_layerandgqa_layersplit into in/core/out; the wrappers keep their signatures.nemotron_h/program.rsimplementsHybridOpsfor CUDA.tools/families.tsv: the new globs.Proof (move class):
just canon-check a9753394e --worktree: 4 bins, 1633 entries, 1633 identical, rows equal. The last two commits (the module moved fromchain/src/arch/hybridtochain/src/hybrid, and rustfmt) change only paths in host code; no kernel can move [derived].Gates: chain tests 36 passed (13 new). A fixture batch of the callers and lib tests: 10 items, red 0. Real tier
gate-gpu-nemotron-e2erc 0: 380 graph nodes and the ids equal the base's. FAIL-first: 39 of 39 chain mutants red; three CUDA mutants (skipffn_core, drop the V append, flip the residual rail one layer late) are red in the e2e gate.gate-gpu-nemotron-h-moe-card32is red on base too ("stage map: 53 layers vs 52"); #843 owns it.The box gates ran on base a975339; the next train batch re-runs them on main.
AI use: written and checked with Claude Code.
🤖 Generated with Claude Code