chore: cargo fmt + clippy -D warnings clean + regenerate Cargo.lock#1
Conversation
All 26 clippy errors fixed across src/, tests/, and examples/: - manual_is_multiple_of (13×): x % n == 0 → x.is_multiple_of(n), stable since 1.87, safe on MSRV 1.89 - manual_range_contains (2×): negated range comparisons → !(a..=b).contains(&x) - manual_repeat_n (1×): repeat(v).take(n) → repeat_n(v, n), stable 1.82 - too_many_arguments (7×): #[allow] with justifying comment on scan_b2_fastscan_avx512, scan_b2_fastscan_scalar, scan_via_lut_scalar (src), finalise_row, bench_two_stage, bench_two_stage_batched, bench_sign_two_stage_batched (examples) - needless_range_loop (9×): #[allow] on all SIMD kernel loops (bitmap.rs AVX-512 kernels, sign_bitmap.rs AVX-512 kernel, fastscan.rs scalar finalize) plus two clear mechanical rewrites in tests/rank_index/quant.rs and two #[allow] in tests/rank_index/index.rs (raw index used in assertion message) cargo fmt --all run; reformatted bitmap.rs, fastscan.rs and several test/example files. No behavior change.
Old lockfile was version 3 and still listed serde as a transitive dependency that no longer exists in the dependency tree. Regenerated with `cargo generate-lockfile`; new lockfile is version 4, contains no serde entries, and passes `cargo build --locked` and `cargo test --locked`.
Review Summary by QodoApply cargo fmt and fix 26 clippy lints; regenerate Cargo.lock
WalkthroughsDescription• Applied cargo fmt across all source, test, and example files • Fixed 26 clippy lints via mechanical rewrites and justified #[allow] attributes - manual_is_multiple_of (13×): replaced x % n == 0 with x.is_multiple_of(n) - manual_range_contains (2×): replaced negated range comparisons with !(a..=b).contains(&x) - manual_repeat_n (1×): replaced repeat(v).take(n) with repeat_n(v, n) - too_many_arguments (7×): added #[allow] on kernel functions with intrinsic arity - needless_range_loop (9×): added #[allow] on SIMD kernel loops and raw pointer arithmetic • Regenerated Cargo.lock from version 3 to version 4, removing stale serde dependency Diagramflowchart LR
A["Source/Test/Example Files"] -->|cargo fmt| B["Formatted Code"]
B -->|clippy fixes| C["Lint-Clean Code"]
C -->|manual rewrites| D["is_multiple_of, range_contains, repeat_n"]
C -->|justified allows| E["SIMD kernels, too_many_arguments"]
F["Cargo.lock v3"] -->|regenerate| G["Cargo.lock v4"]
G -->|remove stale| H["No serde dependency"]
File Changes1. examples/bench_rank.rs
|
There was a problem hiding this comment.
Code Review
This pull request primarily focuses on code formatting, dependency cleanup, and minor refactoring for idiomatic improvements and lint compliance. Key changes include updating Cargo.lock to version 4, removing serde and its related sub-crates, and applying extensive formatting across the codebase, such as reordering imports and breaking long function signatures into multiple lines. The PR also introduces several clippy allow attributes for intentional manual indexing and high-arity functions, replaces manual modulo checks with is_multiple_of, and refactors various test loops and assertions for better readability. I have no feedback to provide as no review comments were submitted.
The x86 SIMD dispatch (select_simd_tier + the SimdTier match arms, the AVX kernels, BATCHED_AVX512_CHUNK) is cfg(target_arch=x86_64)-gated, but the glue it references — the SimdTier::Avx2/Avx512 variants, the batched-chunk consts, and the simd_tier / centre_drop_used bindings — was defined unconditionally. On non-x86 (aarch64 / macos-latest CI) those are dead/unused and, under RUSTFLAGS=-D warnings, fail the build with 7 dead_code/unused errors. Add cfg_attr(not(target_arch=x86_64), allow(...)) to each so the crate builds clean on aarch64 (scalar path) while x86 is untouched. Verified: aarch64 lib + tests + examples compile clean under -D warnings; x86 fmt/clippy/test 80/86.
… review) Address the bot review wave (gemini/Codex/qodo) — all "convert core panics to clean Python errors", completing the binding's boundary-guard design: - Width validation (check_width): every f32 input now checks ncols == dim (2-D) / len == dim (1-D). The core derives n = len/dim and only asserts divisibility, so a wrong-but-divisible shape (e.g. (1,128) into a dim-64 index) was silently reinterpreted as a different vector count, or panicked on the result reshape. Now a clean ValueError. (gemini x3 critical, Codex x2 P1, qodo #3) - Constructor validation: Rank/RankQuant/Bitmap/SignBitmap `new` return PyResult and validate against the EXACT core asserts (dim in [2, u16::MAX]; bits in {1,2,4} + dim multiple of 8/bits and 2^bits; dim % 64 + 0 < n_top < dim; dim % 64 + <= MAX_SIGN_BITMAP_DIM) -> ValueError instead of panic. (gemini x4) - swap_remove (Rank, RankQuant): bounds-check -> IndexError, not panic. (gemini high, qodo #4) - README provenance tightened to the canonical "developed within turbovec, factored out" phrasing. (qodo #2) Tests: +9 (width-mismatch x6, swap_remove OOB x3); constructor-rejection tests tightened from BaseException to ValueError. Suite now 117 passed + 1 xfail. clippy -D warnings + fmt clean; MSRV 1.89 builds core + binding. Not changed: qodo #1 (ndarray via numpy) is a deliberate, documented core-vs- binding split (deps grep + publish scoped to -p ordvec; the core's published lock is clean; the binding is publish = false, PyPI-only) -- explained on-thread.
… (qodo) Two robustness fixes to part (2) of release_publish_invariants.sh: - Publish-scoped (qodo #1): step_line grepped the whole workflow with head -1, so a download-artifact in another job could satisfy the ordering even if the publish job regressed. Now extract the 'publish:' job body (its key to the next 2-space-indented job key or EOF) and search only within it. - Multi-line aware (qodo #4): the cleanup was anchored on a single-line 'run:', so a 'run: |' block would false-fail. Now match the delete command on its own line, so both 'run: ... -delete' and a multi-line 'run: |' block work — still requiring a real delete ('find ... -delete' or 'rm ... *.cdx.json'). Verified A-G: passes on the real workflow and multi-line run:| (F); fails on removed / reordered-in-publish / comment-only / non-deleting-find; and is no longer fooled by a decoy download-artifact in another job (G).
Foundational hygiene — merge first
Brings the extracted crate up to a strict lint gate (including the cross-platform matrix) so the three workstream PRs build on a clean base. No behavior change.
Changes
cargo fmt --allacrosssrc/,tests/,examples/.cargo clippy --all-targets --all-features -- -D warningsclean (26 lints):manual_is_multiple_of(13×,x % n == 0→is_multiple_of, stable since 1.87 ≤ MSRV 1.89),manual_range_contains(2×),manual_repeat_n(1×, test).#[allow]with justification:too_many_arguments(7× — SIMD kernels + bench fns whose arity is intrinsic) andneedless_range_loop(7× — kernel loops doing raw pointer arithmetic / multi-array indexing). Only 2 trivial single-array test loops were converted to iterators.SimdTier::Avx2/Avx512,BATCHED_AVX512_CHUNK, thesimd_tier/centre_drop_usedbindings) was defined unconditionally but referenced only bycfg(target_arch="x86_64")dispatch → dead/unused on aarch64, failing-D warnings(caught bymacos-latest). Gated each withcfg_attr(not(x86_64), allow(...))so the crate builds clean on ARM (scalar path); x86 untouched.Cargo.lock(was version 3 with staleserde; now version 4, serde gone).Verification
cargo fmt --all --check+clippy --all-targets --all-features -- -D warnings— cleancargo test80/0;--features experimental86/0;RUSTFLAGS="-D warnings" cargo test80/0 (rustc-warning-clean)cargo +1.89.0 build(MSRV) +cargo build --locked— pass-D warnings) — clean; CImacos-latest(aarch64) greenNo tests deleted or skipped.