Files
zeekayandHanzo Dev 8e405b7de6 Make fmt and clippy pass, keeping NaN a failure in the rmsnorm gate
Both lanes were red on the same two gates: ci.yml's Rustfmt and Clippy
jobs, and cicd.yml's `test fmt`, which is the same rustfmt run reached
through hanzo.yml.

Most of it is mechanical — a `format!` with nothing to format, two
`chunks_exact` with constant sizes (`as_chunks` gives a fixed-size array
back, so the infallible `try_into().unwrap()` goes with them), and a
`Vec<Tensor>` declared then assigned in both arms of an `if`.

The seven `SendError<Response>` results are boxed to match the two in
the same file that already were: the enum is large, each has exactly one
caller, and those callers pass through `map_err(Error::msg)`, which a
`Box` satisfies as well as the bare error.

One is not mechanical. The oracle asked `!(y_rel < 1e-5)`, and clippy is
right that a negated comparison on a partially ordered type reads badly
— but the obvious rewrite, `y_rel >= 1e-5`, is WRONG here: both compare
false against NaN, so the negated form fails a NaN and the direct form
passes it. A kernel emitting NaN is the loudest thing this gate exists
to catch, so the NaN case is now spelled out rather than left to rest on
which way the operator faces.

Verified with the exact CI commands: `cargo fmt --all --check` reports
no diff, `cargo clippy --workspace --tests --examples -- -D warnings`
finishes clean. The clippy one matters — a narrower `-p` run missed the
oracle entirely, because that test lives in hanzo-cli.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-22 23:58:03 -07:00
..