Repository navigation
fix(metal): reject missing values after repeated probe flags - #1115
Conversation
There was a problem hiding this comment.
Verdict: CLEAN: The guard rejects missing trailing values after repeated flags before parsing, file writes or device access.
Checked
Duplicates: 1 new item checked, the regression test; no duplicate contract found. Dryer reported no pairs.
Complexity: crapper flagged no functions; the existing condition is replaced.
Silent failure: 1 changed guard followed through run to the named stderr error and failure exit code.
Tests: restoring the first-occurrence check at crates/metal/src/bin/metal_gemm_time/mac.rs:439 lets the repeated shape case reach the source-only success return, contradicting the new assertion. The PR body includes FAIL-first output. A static guard check rejects all 26 missing-value cases and preserves the guard behavior for 13 valid repetitions and empty arguments.
Gates: no pins moved or cases removed.
Escape catalog: no patterns matched.
Adversarial checks: repeated source-output flags fail before writing. Sibling timing probes check values at each occurrence.
Notes
The Rust test is macOS-only and was not run here. Validation here was static; macOS test and CLI output is supplied in the PR body.
🔨 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. |
metal_gemm_time에서 같은 옵션을 반복하고 마지막 옵션의 값을 빼먹으면 오류 없이 넘어가던 문제를 고쳤습니다.
What and why
metal_gemm_timechecks that each value-taking flag has a value, but it looked only at the first occurrence of the flag. With a repeated flag, for example--shape 1:2:3 --shape, the first occurrence has a value, so the trailing--shapewith no value was accepted and the command ran as if nothing was missing. The check now looks at whether the last argument is one of those flags, so a missing value is refused with<flag> takes a valuewhether or not the flag appeared earlier. This covers all 13 value flags the existing check lists.Fixes #1110. The change is one condition in
crates/metal/src/bin/metal_gemm_time/mac.rsplus a regression test that runs every value flag with and without an earlier occurrence.Release notes: Fixed:
metal_gemm_timenow rejects a repeated option whose last occurrence has no value.Code shape
The review reads these first. A box left unticked needs one line of why.
copying it (
AGENTS.md"Common code first",docs/rust-quality.mdR14). Where I found an existing copy, Inamed it below.
(tensor shapes, the attention kind, the quant). A common owner gained no per-model branch, flag or trait method.
tools/check-comments.sh).PIN(YYYY-MM-DD):and its reason.
cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line), or "none": noneWhat I ran
Base
7364a5f86917ee9f5cb8816b7cab7043bf7d65a0, PR headeb9f0073d7498811da935b882a57e877d67b98da, on a macOS machine.Without the fix, the new regression test alone fails:
With the fix (PR head):
cargo clippy -p bloomery-metal --bin metal_gemm_time --no-deps -- -D warningsfinishes with no warnings or errors.The built binary (
cargo build -p bloomery-metal --bin metal_gemm_time), run with a missing trailing value and with valid repeated values in source-only mode:The workspace clippy ratchet check on the PR head passes:
chain-clippy: lint rc 0 (^warning: 0, the ratchet 0 in tools/lint-ratchet.txt).AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.