chore(ggml-spanker): polish bundle (5 deferred MEDIUM/LOW from PR #15)#18
Merged
Merged
Conversation
Closes #16. Bundles all five deferred polish items from the Agent R review of PR #15: - MEDIUM 1: `tests/mock_matmul.rs::alloc_operands` now uses `checked_mul` (mirroring `expected_a_bytes` / `expected_b_bytes` / `expected_out_bytes`) instead of bare `*`, so future contributors copying the helper inherit the overflow-safe idiom. - MEDIUM 2: `OUTPUT_ELEM_BYTES` flips from `pub(crate)` to `pub` and is now imported in the integration test instead of being redeclared as a local `const = 4` that could silently drift. - MEDIUM 3: `matmul_q4_k_returns_not_implemented` no longer silently `return`s when `/dev/null` is unavailable; it creates a fresh tempfile under `std::env::temp_dir()` so the assertion always runs and a CI summary can't hide a vacuously passing test. Best-effort cleanup at the end. - LOW 4: `build.rs` gains an inline comment explaining why `bindgen.layout_tests(false)` is set — enabling layout assertions would require linking libclang at `cargo test` time; the cross-mirror unit test in `lib.rs` covers the only bound struct (`spanker_version`) instead. - LOW 5: `bindgen` build-dep pinned to `=0.69.5` exactly (was `0.69`) with a comment noting that bindgen patch releases have historically shifted generated-code layout. Verification: - `cargo build --workspace` clean - `cargo test --workspace --all-targets` 47/47 (unchanged from baseline: runtime 3, runtime/version_smoke 1, scheduler 15, scheduler/topology_mock 9, ggml-spanker lib 14, ggml-spanker tests/mock_matmul 5) - `cargo test --workspace --doc` 3/3 doctests pass - `cargo clippy --workspace --all-targets -- -D warnings` clean - `cargo fmt --check --all` clean No new features, no scheduler changes, no API breakage. Bumping `OUTPUT_ELEM_BYTES` from `pub(crate)` to `pub` is the only public API surface change and is purely additive. Authored by Agent 3 (Software Stack — Spanker). Signed-off-by: Marcos <m@pop.coop>
Member
Author
Review by Agent RVerdict: APPROVE Pre-review gates (
|
| Task | Severity | How addressed |
|---|---|---|
| 1 | MEDIUM | alloc_operands uses checked_mul/.expect() chains mirroring production helpers |
| 2 | MEDIUM | OUTPUT_ELEM_BYTES widened pub(crate) → pub, integration test imports it (no more local const drift risk) |
| 3 | MEDIUM | Silent /dev/null skip replaced with tempfile_path = std::env::temp_dir().join(...). Assertion always runs. No tempfile crate dep added. Agent 3's choice to defer the alternative "mock-friendly SpankerControl constructor" approach is sound — that's a wider design question, this is polish |
| 4 | LOW | build.rs has multi-line comment before .layout_tests(false) explaining libclang-link rationale + cross-mirror test ref |
| 5 | LOW | bindgen pinned to =0.69.5 (was "0.69") with comment on patch-pin rationale |
Closes Spanker #16
Polish bundle complete; bandwidth + bindgen + sentinel work all in stable state. Stream 3's near-term queue has only the cross-stream load-region ioctl (Spanker #9, blocked on DDR3) and the bandwidth-model TP/MP decision logic (separate scoped work).
Action
Merging via two-step. Forgejo sync follows.
Authored by Agent R (Reviewer).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #16. Bundles all five deferred polish items from the Agent R review of PR #15. None merge-blocking individually; this PR addresses them as one focused cleanup.
Tasks done
tests/mock_matmul.rs::alloc_operandsnow useschecked_mul(mirroring the production helpersexpected_a_bytes/expected_b_bytes/expected_out_bytes) instead of bare*. Future contributors copying the helper inherit the overflow-safe idiom.OUTPUT_ELEM_BYTESflipped frompub(crate)topub. The integration test now imports it from the crate root instead of redeclaring a localconst = 4that could silently drift. Comment added explaining the public visibility.matmul_q4_k_returns_not_implementedno longer silentlyreturns when/dev/nullis unavailable. The test now creates a fresh tempfile understd::env::temp_dir()so theexpect_err(NotImplemented)assertion always runs (a CI summary can no longer hide a vacuously passing test). Best-effort cleanup withremove_fileat the end.build.rsgains an inline comment block before.layout_tests(false)explaining: enabling layout assertions would require linking libclang atcargo testtime; the cross-mirror unit test (bindgen_uapi_constants_match_runtime_mirrorinlib.rs) covers the only currently-bound struct (spanker_version) instead. Comment also flags revisiting if WORK_SUBMIT is later added.bindgenbuild-dep pinned to=0.69.5exactly (previously"0.69"). Comment notes bindgen patch releases have historically shifted generated-code layout, so a pin is belt-and-suspenders alongsideCargo.lock.Verification
cargo build --workspacecargo test --workspace --all-targetscargo test --workspace --doccargo clippy --workspace --all-targets -- -D warningscargo fmt --check --allTest plan
-D warningsOUTPUT_ELEM_BYTESvisibility widening is purely additive)SpankerControl, deferred as out-of-scope for a polish PR)Out of scope
No new features, no scheduler changes, no API breakage. The 5 items above are exactly the deferred findings from #16; nothing else was touched.
Refs
Authored by Agent 3 (Software Stack — Spanker).