clippy: no workspace reports an error, and the unsafe FFI states its contract #241
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/clippy-sweep"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Three of the seventeen workspaces could not be linted at all. A deny-level clippy lint errored in each, and clippy stops at the first erroring crate, so every lint behind it went unreported — which is also why the earlier count of this work was far too low: the number only appears once the errors are gone.
None of the ten errors was a bug. Each is fixed anyway, because an error masks the next one:
jouleclaw-loader-gguf,-contract,-runtimeerasing_op0 * stridespells the shared kv head (MQA) and the (row, col) cell address, mirroring thehh * sbeside it — kept, lint allowed, reason recordedjouleclaw-backend-apple,ssmapproximate_constantSQRT_2/LN_2where the constant is the point (softplus(0) = ln2) — nowstd::f32::consts, and exactjouleclaw-bounded,-outlier,-tools,joule-ui-coreapproximate_constant3.14as an arbitrary test value; given a value not near pi (in-toolsthe decimal is the format assertion's subject, so input and expectation moved together)jouleclaw-policy-ipcnever_loopparse_argslooped, but every arm returns or exits —if letsays what happenssmart-byte-edvalmost_swappeds.sequence = curassigned the field to itself;updatetakes a document at its current sequence and bumps it, so the no-op was dead and the comment ("bump twice") described neitherjcp-schemaTryFromError = Infallible, carried toFromwith#[serde(from = ...)]so the wire still normalises the top of the latticewai-rs: 19 unsafeextern "C"entry points stated no safety contract, beside neighbours that did. Each now names what its caller must guarantee, per pointer, derived from its own signature.Verified on the build host
SQRT_2swap that alters a numeric inputwai-rsbuilds, lints and documents;origins_wire_normalizes_on_deserializestill pins the lattice normalisationNot in this change
The remaining 2084 warnings are cosmetic — collapsible
if, unnecessary blocks, doc-list indentation,needless_range_loop— and 1842 of them are injouleclawalone. That is a churn-versus-tidiness call across twelve workspaces with four PRs open, so it is left to the owner rather than bundled here.🤖 Generated with Claude Code
Three workspaces could not be linted at all: a deny-level clippy lint errored, and clippy stops at the first erroring crate, so everything behind it went unreported. None of the ten errors was a bug; each is fixed so it cannot mask the next. jouleclaw-loader-gguf, jouleclaw-contract, jouleclaw-runtime: `0 * stride` spells the shared kv head (MQA) and the (row, col) cell address, mirroring the `hh * s` beside it. Kept, with the lint allowed and the reason written down, rather than dropping a term that documents which head is read. jouleclaw-backend-apple, jouleclaw-loader-gguf/ssm: a truncated SQRT_2 and LN_2 where the constant is what is meant -- `softplus(0) = ln2` is the assertion's whole point. Now `std::f32::consts`, which is also exact. jouleclaw-bounded, jouleclaw-outlier, jouleclaw-tools, joule-ui-core: 3.14 as an arbitrary test value, which clippy reads as an attempt at pi. Given a value that is not near pi; in jouleclaw-tools the decimal is the subject of the format assertion, so expectation and input moved together. jouleclaw-policy-ipc: `parse_args` looped, but every arm returns or exits, so it could only ever run once. `if let` says what happens. smart-byte-edv: `s.sequence = cur` assigned the field to itself. `update` takes a document at its current sequence and bumps it, so the no-op was dead and the comment above it ("bump twice") described neither. Removed; the comment now states the mechanism the test relies on. jcp-schema: `Origins`'s `TryFrom<OriginsWire>` had `Error = Infallible`. Carried over to `From` with `#[serde(from = ...)]`, so the normalisation that keeps the top of the lattice single-encoded still runs on the wire -- `origins_wire_normalizes_on_deserialize` pins it. wai-rs: 19 unsafe `extern "C"` entry points stated no safety contract, beside neighbours that did. Each now names what its caller must guarantee, per pointer, from its own signature. Verified on the build host: all 17 workspaces lint with zero errors; the tests of every crate whose values changed pass; wai-rs builds, lints and documents. Co-Authored-By: Claude Opus 5 <[email protected]>