Skip to content

Lint the wasm32 build in CI; fix its three clippy lints - #5

Merged
ilnmtlbnm merged 2 commits into
mainfrom
wasm32-clippy
Oct 9, 2026
Merged

ilnmtlbnm merged 2 commits into
mainfrom
wasm32-clippy

Conversation

@ilnmtlbnm

Copy link
Copy Markdown
Member

CI ran clippy only for the native build, so three lints in the wasm32 simd128 kernels went unnoticed on main (clippy::chunks_exact_to_as_chunks in crates/lean/src/cpu_kernels.rs).

  • The three loops use as_chunks instead of chunks_exact (N = 18, 34, 210). Outputs are bitwise identical to the previous code over 30,000 random Q4_0 / Q8_0 / Q6_K calls in a wasm32 +simd128 build.
  • CI gains a clippy step for wasm32 with the web feature, so the browser build is linted too.

clippy 1.99 (chunks_exact_to_as_chunks) rejects chunks_exact with a
constant size in the simd128 dot_q4_0, dot_q8_0 and dot_q6_k loops, which
only compile for wasm32. Same rewrite already applied to the scalar and
NEON kernels: as_chunks::<N>().0.iter() yields the same blocks and drops
the same remainder.
The native clippy step never compiles the wasm32-only code (the simd128
dot kernels, the web bindings), so lints there went unnoticed. The
workspace .cargo/config.toml enables +simd128 for wasm32, so this step
covers the simd128 module.
@ilnmtlbnm
ilnmtlbnm merged commit c58cf16 into main Oct 9, 2026
2 checks passed
@ilnmtlbnm
ilnmtlbnm deleted the wasm32-clippy branch October 9, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant