Repository navigation
gpu: share Held positions and read validation - #774
Conversation
There was a problem hiding this comment.
Verdict: MUST_FIX: the validator move leaves a contract comment pointing to a deleted function.
Must fix
1. Point the read contract to its new owner
crates/gpu/src/arch/qwen3moe/mtp38.rs:1635 still names check_target_rows, which this PR deletes. The actual validator is now Held::check_read.
Repairing the reference with the move keeps the validation contract discoverable. Replace that comment line with:
/// the rows' ([`Held::check_read`]), media rows.
Non-blocking
⚠ Capacity refusal is not isolated by the test: crates/gpu/src/draft.rs:346. Deleting .filter(|&end| end <= rows) at line 279 leaves both tests passing. Other guards reject every invalid case. Add this assertion after let held and show FAIL-first against that mutant; it isolates the capacity guard:
assert!(held.check_read(WHAT, "Step", 0, (0, 1), 2).is_err());⚠ Attach the move proof against this PR's base: crates/gpu/src/arch/qwen3moe/mtp38.rs:1683. The reported scan starts at 8d912142, while the review base is fc0537b6. The move class requires identical scans and preserved host dispatch structural checks. Verify the reviewed delta before relying on the cached result; attach the output and graph-node/eager-replay checks:
just canon-check fc0537b6fb821beda085998718a7b44c9b8eb686Checked
Duplicates: 11 new/moved items checked; no duplicate owner remains. Dryer's one pair maps different program-owned arena enums; sharing it requires extra abstraction.
Complexity: crapper flagged no changed functions.
Silent failure: 3 sites followed. Failed conversion and read admission reach named Shape errors; cut saturation discards revoked rows.
Tests: static mutation review. Changing line 245's <= to < fails the first test; dropping line 294's held-range guard fails the second. Removing line 279's capacity filter survives.
Gates: no pins moved; the two arithmetic tests were relocated and extended.
Performance: decode/prefill read admission adds no successful-path allocation, launch, copy or synchronization.
Adversarial checks: stale rows after cuts or sequence swaps, row overflow, position overflow and snapshot bounds are rejected before copying.
Escape catalog: no patterns matched.
Notes
Tests and scans were not rerun during this source review. The PR explicitly reports no device execution; card-gate evidence is absent.
Card check: needs-gpu. This pull request changes crates/gpu-glm5next/src/body.rs, crates/gpu-glm5next/src/nextn.rs, crates/gpu-glm5next/src/pair.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)
| #[test] | ||
| fn target_reads_refuse_unheld_or_overflowing_ranges_before_copy() { | ||
| const WHAT: &str = "draft read"; | ||
| let held = Held::at(1, 1); |
There was a problem hiding this comment.
Isolate arena capacity so deleting its guard fails this test.
| let held = Held::at(1, 1); | |
| let held = Held::at(1, 1); | |
| assert!(held.check_read(WHAT, "Step", 0, (0, 1), 2).is_err()); |
aad5417 to
78a2594
Compare
|
Addressed the actual review in |
There was a problem hiding this comment.
Since the last review:
- Fixed: the read-contract link now names
Held::check_readat mtp38.rs:1635. - Fixed: the capacity assertion isolates the missing guard at draft.rs:348. The body reports FAIL-first against its removal.
- Partly fixed: the exact-base move scan is supplied. Host graph-node and eager/replay checks remain open at mtp38.rs:1683; the author states the hardware limit.
Verdict: CLEAN: the previous must-fix is resolved, and the interdiff adds no proven defect.
Non-blocking
⚠ Complete the host dispatch move proof: crates/gpu/src/arch/qwen3moe/mtp38.rs:1683. The reported exact-base canon scan establishes identical PTX. The move class also requires preserved graph-node counts, eager/replay behavior and the end-to-end set. Attach those owning-gate outputs when hardware is available to complete validation before merge.
Checked
Duplicates: 0 new definitions in the interdiff. Dryer's pair was read; the two tables map different program-owned arena enums and require no shared abstraction.
Complexity: crapper flagged no changed functions; the interdiff adds one assertion sequence.
Silent failure: 0 new sites. The isolated over-capacity read reaches a named Shape error before copying.
Tests: static mutation check of draft.rs:279. Removing only the capacity filter admits the new input, so expect_err at line 349 fails. The PR reports the compiled mutant failing and both restored tests passing.
Gates: no pins, thresholds or cases removed or relaxed.
Adversarial checks: valid held positions with zero physical capacity are rejected; stale and overflowing reads remain guarded. The new hunk changes no production execution.
Escape catalog: no patterns matched.
Notes
Rust tests and scans were not rerun during this source review. The PR explicitly reports no device execution and carries no card-gate evidence.
Card check: needs-gpu. This pull request changes crates/gpu-glm5next/src/body.rs, crates/gpu-glm5next/src/nextn.rs, crates/gpu-glm5next/src/pair.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)
|
Final cross-change compatibility check (not a GPU runtime claim): the tested combined source tree is exactly the conflict-free merge of final public heads Local test commit Actual combined checks: Held 2/2, slot contracts 2/2, real SlotPass 1/1, actual owning Direct complete comparison of the final combined snapshot: All 8 kernel carriers are covered. This composition check supplements, not replaces, each PR's direct reviewed-base proof or its still-unrun physical GPU/graph gates. |
|
@Burntgogi Thanks for the contribution. The review is done, so I'm merging this. |
Scope
Fixes #581 (the remaining Held positions slice). Implement the approved Held position/read-check owner only; Qwen and GLM keep their program-owned Wrote tables and arena enums.
gpu::draft::Heldowns NONE/at/cut/parts/holds, checked read admission, and overflow-safe rendering.Observed host verification
cargo oxide test --arch sm_86 -- -p bloomery-gpu --release --lib draft::tests:: -- --nocapture: 2 passed.(42, 2)remained readable; stale and overflowing reads reached their named consumer errors. The temporary example was removed.just gate-appthrough the local box/gate wrappers: 27 passed, 0 failed, 0 ignored.docs/research/headpick.mddocuments the common owner.just pre-reviewexits 75: no Claude CLI is installed, so nothing was reviewed.Device-runtime limit
This host has no NVIDIA device/driver or configured remote GPU. No eager/captured GPU execution, graph operand/order/count comparison, or numerical/card-gate PASS is claimed. The host owning
gate-apppassed. The device owning gates includegate-gpu-qwen4exp-mtp,gate-gpu-glm5next-mtp, andgate-gpu-lib. The full official affected/narrowed gate list remains applicable; the named gates are not a substitute for that full list. This PR needs the applicable hardware evidence before landing.Final reviewed-base move proof
Addressed the actual review on
aad5417cin78a2594904a4cd7dc37adfe49b284dc39c3d87dc:Held::check_read; nocheck_target_rows,Held38orheld_shownreference remains in the affected source/docs.Held::at(1, 1), capacity 0, read(0, 1), pos0 2. Held/position checks are valid. Removing only.filter(|&end| end <= rows)makes the actual test FAIL (exit 101,a held row outside the arena: ()); restoring that guard makes both production Held tests PASS (2/2). The temporary mutant was removed before commit.Direct final-snapshot proof:
All 8 kernel carriers are covered. This directly checks the reviewed delta, separately from the earlier 8d91214 and combined-tree results. Formatting/comment checks passed. Required local pre-review still exits 75 (no Claude CLI; nothing reviewed).
Hardware limit remains: no NVIDIA device/driver or configured remote GPU is available. GPU graph-node/operand/eager-replay/card gate results cannot be supplied here and are not inferred from identical PTX. The host owning app gate passed 27/27; that is not a GPU graph proof. Fresh official narrowing against these exact fc/base and final/head pairs retains 77 of 227 recipes (from 157), with all four scan pairs identical. No gate, pin, threshold or skip list was relaxed.