Repository navigation
qwen38: validate completed target rows and own draft input - #980
Conversation
There was a problem hiding this comment.
Verdict: MUST_FIX: the new GPU gate runs without the shared card and model-load locks.
Must fix
1. Run the input gate under the GPU runner
justfile:1785 calls gate.sh without --gpu. Its GPU=0 path runs Cargo's test directly, so BLOOMERY_GATE_V41_LOAD=1 takes no lock. Start it beside another gate holding the selected card: both loads run together and can exhaust card memory. box.sh:1247 permits this overlap because it expects gpu-gate.sh to wait. This is a kind A concurrency failure.
Fixing this caller now prevents every later batch from repeating the overlap. Extend the existing runner to accept binary test targets, then replace the recipe. Its capture-count check still requires exactly one executable.
--- a/tools/gate.sh
+++ b/tools/gate.sh
@@ -21,3 +21,3 @@
# cargo refuses --no-run with --doc). A build that runs out ends 124 and says it was the build phase; the run never starts.
-# --gpu before --oxide selects one native --lib test target. Its bounded Cargo call compiles
+# --gpu before --oxide selects one native --lib or --bin test target. Its bounded Cargo call compiles
# outside the card lock and invokes a capture-only target runner, never the test. Cargo owns the
@@ -134,3 +134,3 @@
BUILD_ARGS=()
- LIB=0
+ TEST_TARGET=0
ARGS=()
@@ -144,5 +144,5 @@
case "$a" in
- --lib) LIB=1 ;;
+ --lib | --bin | --bin=*) TEST_TARGET=1 ;;
--target | --target=* | --doc)
- echo "gate.sh --gpu: only native library tests are supported; '$a' is not allowed" >&2
+ echo "gate.sh --gpu: only native tests are supported; '$a' is not allowed" >&2
exit 64 ;;
@@ -152,3 +152,3 @@
done
- [ "$LIB" = 1 ] || { echo "gate.sh --gpu: select a library test with --lib" >&2; exit 64; }
+ [ "$TEST_TARGET" = 1 ] || { echo "gate.sh --gpu: select a test with --lib or --bin" >&2; exit 64; }
SELF=$(cd "${BASH_SOURCE[0]%/*}" && pwd -P)/gate.sh
@@ -244,3 +244,3 @@
if len(captures) != 1:
- print("gate.sh --gpu: select exactly one library test; got " + str(len(captures)), file=sys.stderr)
+ print("gate.sh --gpu: select exactly one test target; got " + str(len(captures)), file=sys.stderr)
sys.exit(64)gate-gpu-qwen4exp-mtp-input:
BLOOMERY_MODEL=qwen4exp ./tools/box.sh 'bash tools/ref/needs-env.sh gate-gpu-qwen4exp-mtp-input BLOOMERY_QWEN38_FOLDER && export BLOOMERY_GATE_V41_LOAD=1 && bash tools/gate.sh --gpu --oxide -p bloomery-gpu-gates --release --features gpu,checkpoint --bin gate_qwen4exp_mtp -- --ignored hw_mtp_input_validity --nocapture'Non-blocking
⚠ Complete the card evidence: crates/gpu-gates/src/bin/gate_qwen4exp_mtp.rs:2573 reads BLOOMERY_QWEN38_FOLDER, but the reported command sets BLOOMERY_REF_MODEL.
Provide the command for the current head with the required variable, its output, the nvidia-smi card/driver line and both tested commit hashes.
Checked
Runner: the non-GPU branch invokes Cargo directly; GPU mode replays exactly one captured executable through gpu-gate.sh. Its current selector requires --lib.
Test: hw_mtp_input_validity reads BLOOMERY_QWEN38_FOLDER and loads onto the first visible card.
Fix: all five proposed patch hunks match the source; the patched runner and replacement recipe pass bash syntax checks.
Rules: no active ledger lessons; no C1–C4 pattern matches these findings. Existing recipe checks do not enforce GPU mode here.
Notes
No GPU build or gate was run during this review.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_qwen4exp_mtp.rs, crates/gpu/src/arch/qwen3moe/body38.rs, crates/gpu/src/arch/qwen3moe/mtp38.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)
53bf8c4 to
cfc8cef
Compare
There was a problem hiding this comment.
Since the last review:
- Must-fix 1 remains open in fixture mode (
justfile:1785); real-tier locking is fixed. - The card-evidence request remains open; see Non-blocking.
Verdict: MUST_FIX: fixture mode still permits the checkpoint gate to bypass the shared model-load lock.
Must fix
1. Give the runner the checkpoint's actual model identity
justfile:1785 preserves the fixture's BLOOMERY_REF_MODEL. In fixture mode, when it equals BLOOMERY_FIXTURE_MODEL, gpu-gate.sh:2183 clears V41, although the test opens BLOOMERY_QWEN38_FOLDER. With that folder configured, a sufficient card budget and a free card, the checkpoint load can start while another tree holds the model-load lock. The new regression cases clear the fixture inputs, so they miss this path. This is a kind A lock bypass.
Binding the identity now prevents later fixture batches from repeating concurrent whole-model loads. Replace the recipe below and extend its held-load-lock regression case to include fixture mode with matching reference/fixture paths.
gate-gpu-qwen4exp-mtp-input:
BLOOMERY_MODEL=qwen4exp ./tools/box.sh 'bash tools/ref/needs-env.sh gate-gpu-qwen4exp-mtp-input BLOOMERY_QWEN38_FOLDER && export BLOOMERY_GATE_V41_LOAD=1 && BLOOMERY_REF_MODEL="$BLOOMERY_QWEN38_FOLDER" bash tools/gate.sh --gpu --oxide -p bloomery-gpu-gates --release --features gpu,checkpoint --bin gate_qwen4exp_mtp -- --ignored hw_mtp_input_validity --nocapture'Non-blocking
⚠ Complete the card evidence: gate_qwen4exp_mtp.rs:2573 reads BLOOMERY_QWEN38_FOLDER, but the reported command sets BLOOMERY_REF_MODEL.
Provide the current-head gate command with the required variable, its output, the nvidia-smi card/driver line and both tested commit hashes.
Checked
Duplicates: 0 new function/type/constant definitions in the interdiff; existing capture and lock owners are reused. Dryer reports no pairs.
Complexity: crapper's completed_rows, own_row, hw_mtp_input_validity, Mtp38::checked and slots_windows are unchanged by the interdiff.
Silent failure: all 5 added command-status capture sites feed judge_all; zero/multiple captures remain named refusals.
Tests: the new assertions cover binary selectors, held locks and capture-count refusals, but omit fixture identity. Replaying the production fixture condition produced V41=0; binding the checkpoint identity produced V41=1. Both shell files and the inline replacement pass bash -n.
Gates: no pins or thresholds moved.
Escape catalog: no C1–C4 pattern matched the interdiff; no active ledger lessons.
Notes
Dryer excluded crates/gpu-gates. No GPU build, hardware gate or complete runner self-test was run during this review.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_qwen4exp_mtp.rs, crates/gpu/src/arch/qwen3moe/body38.rs, crates/gpu/src/arch/qwen3moe/mtp38.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)
| # without BLOOMERY_QWEN38_FOLDER a batch defers it by name (needs-env). | ||
| [group('v41-load')] | ||
| gate-gpu-qwen4exp-mtp-input: | ||
| BLOOMERY_MODEL=qwen4exp ./tools/box.sh 'bash tools/ref/needs-env.sh gate-gpu-qwen4exp-mtp-input BLOOMERY_QWEN38_FOLDER && export BLOOMERY_GATE_V41_LOAD=1 && bash tools/gate.sh --gpu --oxide -p bloomery-gpu-gates --release --features gpu,checkpoint --bin gate_qwen4exp_mtp -- --ignored hw_mtp_input_validity --nocapture' |
There was a problem hiding this comment.
Fixture mode drops the model-load lock when BLOOMERY_REF_MODEL matches BLOOMERY_FIXTURE_MODEL, while this test loads BLOOMERY_QWEN38_FOLDER. Bind the runner's model identity to the checkpoint.
| BLOOMERY_MODEL=qwen4exp ./tools/box.sh 'bash tools/ref/needs-env.sh gate-gpu-qwen4exp-mtp-input BLOOMERY_QWEN38_FOLDER && export BLOOMERY_GATE_V41_LOAD=1 && bash tools/gate.sh --gpu --oxide -p bloomery-gpu-gates --release --features gpu,checkpoint --bin gate_qwen4exp_mtp -- --ignored hw_mtp_input_validity --nocapture' | |
| BLOOMERY_MODEL=qwen4exp ./tools/box.sh 'bash tools/ref/needs-env.sh gate-gpu-qwen4exp-mtp-input BLOOMERY_QWEN38_FOLDER && export BLOOMERY_GATE_V41_LOAD=1 && BLOOMERY_REF_MODEL="$BLOOMERY_QWEN38_FOLDER" bash tools/gate.sh --gpu --oxide -p bloomery-gpu-gates --release --features gpu,checkpoint --bin gate_qwen4exp_mtp -- --ignored hw_mtp_input_validity --nocapture' |
cfc8cef to
47d37a3
Compare
There was a problem hiding this comment.
Since the last review:
- Must-fix 1 is fixed: the recipe binds the runner to the checkpoint folder, and the held-load-lock regression covers real and fixture modes.
- The card-evidence request remains open; see Non-blocking.
Verdict: CLEAN: the interdiff closes the fixture-mode lock bypass and introduces no proven defect.
Non-blocking
⚠ Complete the card evidence: gate_qwen4exp_mtp.rs:2573 reads BLOOMERY_QWEN38_FOLDER, but the reported command sets BLOOMERY_REF_MODEL.
Provide the current-head gate command with the required variable, its output, the nvidia-smi card/driver line and both tested commit hashes.
Checked
Duplicates: 0 new function/type/constant definitions in the interdiff. The recipe reuses the existing lock owner. Dryer reports no pairs.
Complexity: crapper flags completed_rows, own_row, hw_mtp_input_validity, Mtp38::checked and slots_windows. Their control flow is unchanged by this interdiff; hw_mtp_input_validity adapts its planner argument to the base API.
Silent failure: 2 changed shell status/sentinel sites reach judge_all. An absent checkpoint folder stops the recipe with 67 before the runner.
Tests: removing the justfile:1785 identity binding makes fixture policy skip the load lock; the new held-lock case requires exit 75 and no child, so it rejects that mutant. Both shell files pass bash -n. The planner receives context 64 and ubatch 8, matching the base API and model load.
Gates: no pins, thresholds or cases removed or relaxed.
Escape catalog: no C1–C4 pattern matches the interdiff; no active ledger lessons.
Notes
Dryer excluded crates/gpu-gates. No GPU build, hardware gate or complete runner self-test was run during this review.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_qwen4exp_mtp.rs, crates/gpu/src/arch/qwen3moe/body38.rs, crates/gpu/src/arch/qwen3moe/mtp38.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)
|
The review is done and the contribution check passed, so I'm merging this. |
Qwen3.8 MTP가 마지막 층이 끝내지 않은 hidden 행이나 오래된 Own 입력을 읽지 않고 거부하도록 고쳤습니다.
What and why
The Qwen3.8 MTP draft reads two inputs from shared arenas: the target's final hidden rows and its own row. Neither input was checked for validity before the draft ran.
Wrote38inbody38.rskeeps the positions the last layer completed.launchupdates it for Gemm and for a Pass without head or finals, and the MTP copy and the checkpoint hidden-row access consult it.mtp38.rsrecords the position of the next own input. A slot swap, a cut, a reset, a store walk, a state adoption or a new walk invalidates it, and a successful Rows refresh renews it. A request for a row that is not complete, or for an own row at the wrong position or before a Rows refresh, is a named error. GPU kernels, launch counts and the work done for valid input are unchanged.Release notes: Fixed: Qwen3.8 MTP rejects hidden rows the target has not completed and own draft rows that are stale or at the wrong position.
Code shape
Heldbookkeeping, the plain and drafted greedy runners and the slot owner are reused.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line), or "none": none.What I ran
The new
hw_mtp_input_validitygate incrates/gpu-gates/src/bin/gate_qwen4exp_mtp.rsloads Qwen3.8-Flash-Next-FP4-Local once (ctx 64, ubatch 8, two planned slots) and checks every boundary above, plus that the first 8 drafted greedy ids equal the plain ids.Command (card runs of this PR's two commits):
Before the fix (the test commit alone), excerpt of the output,
test result: FAILED. 0 passed; 1 failed, rc 101:After the fix, with the fix commit applied:
No speed claim is made: valid input takes the same kernels and launches as before.
Hardware (if the change is for a machine)
b9ce18a6887e18c089fdea8509a33e63429a3300--features gpu,checkpoint, releaseAI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.