Repository navigation
gpu: own shared slot row admission and operand views - #775
Conversation
There was a problem hiding this comment.
Verdict: MUST_FIX: two new methods expose unnecessary public API in violation of R13.
Must fix
1. Keep the admission and id-view methods crate-visible
crates/gpu/src/model/slots.rs:227 and crates/gpu/src/model/slots.rs:249: admit and ids have no caller outside bloomery-gpu. MiMo2 uses tiled_rows; GLM uses no_parked. R13 permits pub only for actual callers in another crate (kind B).
Narrow these methods now, before external consumers create compatibility obligations. Replace their definitions with:
pub(crate) fn admit(
self,
what: &'static str,
rows: &[SlotRange],
parked: usize,
) -> Result<usize, GpuError> {
let at = self.tiled_rows(what, rows)?;
let others = rows.iter().filter(|r| r.slot != 0).count();
if at == 0 || parked != others {
return Err(GpuError::shape(
what,
format!(
"a pass of {at} rows with {parked} parked sequences for {others} slots past slot 0"
),
));
}
Ok(at)
}pub(crate) fn ids<'i>(&self, what: &'static str, ids: &'i [u32]) -> Result<&'i [u32], GpuError> {
ids.get(self.rows.clone()).ok_or_else(|| {
GpuError::shape(
what,
format!(
"slot {}'s rows {:?} of {} ids",
self.slot,
self.rows,
ids.len()
),
)
})
}Non-blocking
⚠ Complete the move evidence against this PR's base: crates/gpu/src/arch/qwen3moe/body38.rs:5637.
The supplied canonical comparison starts at 8d912142, while this PR's base is fc0537b6.
Run just canon-check fc0537b6fb821beda085998718a7b44c9b8eb686 and attach the owning eager/captured slot and graph-count gate output when hardware is available. These checks establish host bindings that PTX identity cannot prove.
Checked
Duplicates: 11 new items checked (6 production items, 5 test functions); no duplicate owner found. Dryer reported 0 pairs.
Complexity: MiMo2 Body::plan 20→21 and Body::enqueue_pass 17→18 inline the existing empty-pass refusal; harmless branch growth.
Silent failure: 10 migrated id/parked call sites followed; named errors propagate without defaults.
Tests: static mutation review found assertions rejecting deletion of the prefix/parked checks (model/slots.rs:213,235), a shifted slice (:250), and removal of the arena bound (slot_pass.rs:315). All 3 new tests belong to gate-gpu-lib; tests were not executed here.
Gates: no pins moved or clauses removed. Empty, reversed, overlapping and maximal ranges retain their prior validation order.
Performance: slot decode admission changes add no allocation, launch, copy or synchronization.
Escape catalog: C1–C4 do not match the diff.
Notes
The body reports host verification and no available GPU. It supplies no card gate run meeting the evidence list; GPU evidence is false.
Card check: needs-gpu. This pull request changes crates/gpu-glm5next/src/pair.rs, crates/gpu-mimo2/src/slots.rs, crates/gpu/src/arch/qwen3moe/body35_slots.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)
|
|
||
| /// Admit a nonempty pass and one parked sequence per range past slot 0, | ||
| /// after checking tiling and the arena's order requirement. | ||
| pub fn admit( |
There was a problem hiding this comment.
R13: all callers of this method are inside bloomery-gpu; keep it crate-visible.
| pub fn admit( | |
| pub(crate) fn admit( |
|
|
||
| impl SlotRange { | ||
| /// This slot's operand ids, with an invalid range refused by slot name. | ||
| pub fn ids<'i>(&self, what: &'static str, ids: &'i [u32]) -> Result<&'i [u32], GpuError> { |
There was a problem hiding this comment.
R13: this id view has no caller outside bloomery-gpu; keep it crate-visible.
| pub fn ids<'i>(&self, what: &'static str, ids: &'i [u32]) -> Result<&'i [u32], GpuError> { | |
| pub(crate) fn ids<'i>(&self, what: &'static str, ids: &'i [u32]) -> Result<&'i [u32], GpuError> { |
ea2ee88 to
43a1500
Compare
|
Addressed R13 in |
There was a problem hiding this comment.
Since the last review:
- Must-fix 1 is fixed: crates/gpu/src/model/slots.rs:227 and crates/gpu/src/model/slots.rs:249 are now
pub(crate). - The move-proof item is partly fixed: the body supplies the exact-base canonical comparison. The owning slot/graph gate evidence remains open at crates/gpu/src/arch/qwen3moe/body38.rs:5637.
Verdict: CLEAN: The visibility defect is fixed; the interdiff introduces no must-fix defect.
Non-blocking
⚠ Complete the owning slot/graph evidence: crates/gpu/src/arch/qwen3moe/body38.rs:5637.
The supplied comparison reports all 1,448 entries identical against fc0537b6.
PTX identity does not validate host bindings. Attach the applicable eager/captured slot and graph operand/order/count gate commands and output when hardware is available.
Checked
Duplicates: 0 new items in the interdiff; no new owner added. Dryer reported 0 pairs.
Complexity: crapper flagged MiMo2 Body::plan 20→21 and Body::enqueue_pass 17→18. Their empty-pass branch growth was already reviewed; neither changes in this interdiff.
Silent failure: 0 new sites. Both narrowed methods retain named errors; invalid id ranges reach callers as GpuError::Shape.
Tests: no new or changed tests. Existing assertions reject a dropped retained-prefix/parked-count check, shifted id slice, or removed arena bound. Static mutation review only; tests were not run here.
Gates: no pins or clauses changed. The body reports the exact-base canonical move proof.
Adversarial checks: no external caller needs the narrowed methods; empty/reversed ranges and a misplaced retained slot 0 retain their guards.
Performance: visibility and documentation edits add no per-token work.
Escape catalog: C1–C4 do not match.
Notes
The body reports host tests and no available NVIDIA device. It contains no card gate run meeting CONTRIBUTING's evidence list; GPU evidence is false.
Card check: needs-gpu. This pull request changes crates/gpu-glm5next/src/pair.rs, crates/gpu-mimo2/src/slots.rs, crates/gpu/src/arch/qwen3moe/body35_slots.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
Refs #609. Implement C1 only; C2–C9 and the frozen familywide census remain unchanged.
gpu::model::slotsownsSlotRowOrder::{Any, RetainedPrefix}, tiled/nonempty/parked-count admission, checked borrowed SlotRange id views, and shared missing-parked/duplicate-slot refusals.Observed host verification
SlotPass::checkregression: 1 passed, viacargo oxide test --arch sm_86without CUDA initialization.[12, 13, 14], rejected that parked-first pass under RetainedPrefix, and refused maximal invalid endpoints. The temporary example was removed.docs/research/layer-composition.md; the frozen census JSON is untouched.just gate-appthrough the local box/gate wrappers: 27 passed, 0 failed, 0 ignored.just pre-reviewexits 75 because no Claude CLI is installed; nothing was reviewed.Device-runtime limit
No NVIDIA device/driver or configured remote GPU is available. Body35/Body38 device-backed methods, eager/captured execution and retained-prefix scheduling still need the applicable owning GPU gates; no numerical, graph operand/order/count, or performance result is claimed. The official
--narrowrun with all four identical scan pairs retains the full 157-recipe list:crates/gpu-mimo2/src/slots.rshas no applicable gate-path row. No mapping was added to shrink the obligations. The hostgate-apppassed; this is not a claim that the device recipes passed. No gate or pin was weakened.Final review correction and reviewed-base move proof
The actual R13 finding is fixed in
43a15006d10365452f54ec422d512b3da8a23d1b:SlotRowOrder::admitandSlotRange::idsarepub(crate). Actual external callers retain only the needed publictiled_rows(MiMo2) andno_parked(GLM) methods. No public compatibility shim is retained.The common slot contracts (2) and real SlotPass admission regression (1) passed after rebasing to the exact requested
fc0537b6base. Formatting and comment checks passed; local pre-review exits 75 (no Claude CLI, nothing reviewed). Narrowing the ids signature caused Rustfmt to add four code-bearing rows; the existing AST counter now measures 6 common units / 69 rows versus 8 retired helpers / 85, and the document is corrected. The frozen census is unchanged; these are not net-removal/performance numbers.The original standalone admission/id-view consumer ran before internalization. Final private-method evidence is from the actual in-crate production-method tests; the earlier consumer is not presented as a supported external API.
Direct final-snapshot comparison against the review-requested base:
The complete repository scan set covers all 8 kernel carriers, including the MiMo2/GLM consumers compiled through the full-feature serve target. CUDA 13.3, explicit LLVM 21, pinned oxide 87bc9518, sm_86. No selected-entry comparison or JIT/device execution is substituted for the complete scan set.
GPU eager/captured slot behavior, graph operand/order/count checks and numerical/card gates still cannot be run on this host (no NVIDIA device/driver or configured GPU remote). Identical PTX and the 27/27 host app gate are not presented as those device results. No gate criteria, mapping, pin, dependency or skip list was weakened.
Fresh official narrowing against these exact fc/base and final/head scan pairs retains all 157 recipes because the MiMo2 slot source still has no gate-path mapping. The mapping was deliberately not changed merely to reduce the obligations.