Repository navigation
metal: a prompt call on a file with no recurrent store runs to its end - #856
Conversation
checkpoint_marks is empty without a recurrent store, so the prompt walk had no point and ran no batch: Qwen3-30B-A3B's first prompt failed with "stepped no id". The call's end is now its one point. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Verdict: MUST_FIX: the fix still fails for a marked prompt call on a file with no recurrent store, which is the server's normal call.
Must fix
1. A marked call with no recurrent store fails in the batch path
crates/metal/src/arch/qwen3moe/target.rs:127 The new fallback sets points = [to] but still passes the caller's marks to call.run (line 149). The server always passes its chat-message marks (crates/serve/src/genloop.rs:1252, crates/metal/src/server.rs:109). Path: Qwen3-30B-A3B, --prefill batch, a prompt of more than PASS_ROWS ids with one mark inside → Call::run takes the pass branch (line 226) → Session::pass gets non-empty after_rows and no rows.snaps (session.rs:1141) → SnapBufs::open returns copies of a model with no delta layer (rows.rs:157). The server request fails. Your test used generate_metal, which passes no marks, so it did not reach this path.
Cost: the same bug moves from generate_metal to bloomery_serve_metal; fixing it in this PR is one line.
Fix: with no store a mark has nothing to copy, so drop the marks together with the empty points.
let mut points = self.checkpoint_marks(from, to);
let marks = if points.is_empty() {
points.push(to);
&[][..]
} else {
marks
};points is empty only with no store (Checkpoints::marks returns [to] for any to > from, and ids is not empty here). Put this after the inside check so bad marks are still refused by name.
Non-blocking
⚠ The gate is not in this PR: the body says "A gate clause over the qwen3moe fixture … follows in this PR", but files.txt lists one file. No test turns red if the if points.is_empty() branch is removed (mutant: drop the branch → stepped no id returns, nothing fails). Add the clause, with a marked call over the batch path, or remove the sentence.
Checked
- Duplicates: 3 new items checked (the fallback,
points.push, themarksshadow), none duplicated.Checkpoints::marks(crates/gpu/src/checkpoint.rs:288) already returns[to]for no ledger. Dryer: 0 pairs. - Complexity:
prompt_marked16 → 17, one branch added to an existing function. Folded into finding 1. - Silent failure: 2 sites followed (
checkpoint_marksempty return,last_pickNone). Thestepped no iderror stays as the guard. - Tests: none added; mutation result is in the ⚠ above.
- Gates: no pin moved.
- Escape catalog: not read in full; no listed pattern matched this diff (one Rust hunk, no shell).
Notes
- The PR body has Apple M1 Pro evidence, no
nvidia-smiline. The change touches only the Metal crate.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
…ts marks The server passes chat marks; with no store the batch arm asked for checkpoint copies a model with no delta layer cannot open. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Fixed in ed32927 as suggested: with no recurrent store the marks are dropped together with the empty points, after the |
There was a problem hiding this comment.
Verdict: CLEAN: the new commit drops the marks together with the empty points, so a marked call on a file with no recurrent store no longer reaches SnapBufs::open.
Since the last review:
- Must fix 1 (marks passed to
call.runwith no store): fixed at target.rs:128. Theinsidecheck at line 115 still runs first, so bad marks are refused by name. - ⚠ Gate not in this PR: still open.
files.txtlists one file.
Non-blocking
⚠ The gate clause is still missing: the PR body says it "follows in this PR", but the diff has one file. Mutant: remove the points.is_empty() branch → stepped no id returns and no test fails. Add a clause over the qwen3moe fixture that includes a marked call with more than PASS_ROWS ids, or remove the sentence from the body.
Checked
- Duplicates: 2 new items checked (
marksshadow,&[][..]), none duplicated. Dryer: 0 pairs. - Complexity:
prompt_marked16 → 17, one branch added to an existing function; the branch is the owner of the "no store" case, so no split is asked. - Silent failure: 2 sites followed.
checkpoint_marksreturns empty only whencheckpointsisNone(session.rs:1549).Session::checkpointat the end point with no store is a no-op copy by its own doc. Thestepped no iderror stays as the guard. - Failure scenario built: a marked server call, batch mode, no store → marks are empty,
afteris empty,Session::passleaves no snaps, nocheckpoint_copyruns. Blocked. - Tests: none added; mutation result is in the ⚠ above.
- Gates: no pin moved.
- Escape catalog: no listed pattern matched this diff (one Rust hunk, no shell).
Notes
- The PR body has Apple M1 Pro evidence, no
nvidia-smiline. The change touches only the Metal crate.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
The gate's clauses run over a row table: the qwen35moe fixture and the qwen3moe one (no shared expert, no recurrent store; a delta clause prints SKIP with its reason). q_marked holds a marked batch prompt call to the unmarked one bit for bit and to the stepped run within q_free's band; lab-metal-e2e runs both rows and a generate_metal smoke on each fixture. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Verdict: CLEAN: the new commits add the gate clause the earlier review asked for, and I found no failure path in them.
Since the last review:
- ⚠ Gate not in this PR: fixed.
q_markedis added at pass.rs:728 and runs on both rows through--row.
Non-blocking
⚠ No gate output in the PR body: the body says "a gate clause follows in this PR", but it shows no run of q_marked and no FAIL-first. Add the lab-metal-e2e output for both rows, and the red line of q_marked with the points.is_empty() branch in target.rs:128 removed.
⚠ Second pick differs from llama.cpp: the body reports 14311 (−0.496) against our 34986 (−1.443). The gate checks this file against ik's fx_ref_qwen3moe sets, not llama.cpp. Say in the body which clause (q_ref, a_free) bounds this difference, or that the difference is a known quant effect.
⚠ Self-pinned ids: justfile:130 pins 8 ids, and only the first has a reference (ik). A legitimate kernel change will move the other 7. When one moves, re-pin it with a dated PIN(YYYY-MM-DD): line.
Checked
- Duplicates: about 12 new items checked (
row.rs,teacher_forced,conv_rows,kv_row,prompt_bits_marked, and the others).teacher_forcedis an extraction offree_run's loop, so it adds no copy. Dryer: 0 pairs. - Complexity:
q_markedis new at 16 and linear, one clause.mac::main63 → 77 is flag handling in the entry point.the_refusals30 → 35,h_promptands_serve+1 to +2 are branches onrow.recurrent, so no split is asked. - Silent failure: 4 sites followed.
Session::instance_ofand the row against delta-layer count check fail by name (clause open: FAIL).row::current()panics by name if no row is selected.FfnRoute::Densereturns an error. None returns a default. - Tests: mutation on
q_marked, drop thepoints.is_empty()branch:Target::prompt_markedreturnsstepped no idand the clause is red. Mutation, keep the marks with no store:checkpoint_positions().contains(&MARKED_AT) != recurrentis red. Mutation, a recurrent file drops its mark: the same check is red. I could not run the gate (macOS only). - Gates: no pin moved. New clause and row skips each carry a reason.
- Performance: gate and tools only, no hot path.
- Escape catalog: no pattern matched (one
justfilehunk,|| dieafter each substitution).
Notes
- The PR body has Apple M1 Pro evidence and no
nvidia-smiline. The change touches only the Metal crate.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
What
A prompt call walks its checkpoint marks. A file with no recurrent store (Qwen3-30B-A3B) has none, so the walk ran no batch. The first prompt failed in both prefill modes:
qwen35moe target: a prompt of 30 ids at position 0 stepped no id. Now the call's end is its one point.Evidence (second M1 Pro, Qwen3-30B-A3B-Instruct-2507-Q4_K_M.gguf, [dev])
generate_metal --prompt …ends rc 1 with the error above (--prefill batchandsteps).--prefill batchand--prefill stepsgive the same 32 greedy ids. The 64-token text is coherent ("The bicycle has its origins in the draisine, invented by German Baron Karl von Drais in 1817, …").decode_rest_ms22.0.lab-metal-e2e) passes every clause on main on the same Mac.AI use: written and checked with Claude Code.
🤖 Generated with Claude Code