Skip to content

chore(fff-core): use as_chunks in flush_seen (clippy 1.98) - #808

Merged
dmtrKovalenko merged 1 commit into
mainfrom
triage-bot/clippy-as-chunks
Aug 22, 2026
Merged

chore(fff-core): use as_chunks in flush_seen (clippy 1.98)#808
dmtrKovalenko merged 1 commit into
mainfrom
triage-bot/clippy-as-chunks

Conversation

@gustav-fff

@gustav-fff gustav-fff commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

No issue. Unblocks CI on #807 and every other open PR.

Root cause

cargo clippy --no-default-features --features zlob -- -D warnings fails on main:

error: using `chunks_exact` with a constant chunk size
   --> crates/fff-core/src/index/bigram_filter.rs:267:34
267 |         for (blk, block) in seen.chunks_exact(8).enumerate() {
    |                                  ^^^^^^^^^^^^^^^ help: consider using `as_chunks` instead: `as_chunks::<8>().0.iter()`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#chunks_exact_to_as_chunks
error: could not compile `fff-search` (lib) due to 1 previous error

chunks_exact_to_as_chunks is new in clippy 1.98. Stable rolled to 1.98.0 (88d9e12ae) on 2026-08-18; rust-toolchain.toml tracks channel = "stable" and the clippy job uses dtolnay/rust-toolchain@master with toolchain: stable, so every run since the roll fails. The line itself is from a487120 (#676, 2026-07-14) and was clean under 1.92.

Fix

One line in flush_seen: seen.chunks_exact(8) -> seen.as_chunks::<8>().0.iter(). SEEN_WORDS = 1024 is a multiple of 8, so the remainder slice is always empty and iteration is unchanged. Block type becomes &[u64; 8] instead of &[u64], which gives the vectorizer a static length for the OR-test fold — same or better codegen, no behavior change.

Steps to reproduce

git checkout main
rustup toolchain install 1.98.0 --component clippy --profile minimal
cargo +1.98.0 clippy --no-default-features --features zlob -- -D warnings

Expected: clean. Actual on main: the error above, exit 101. Under 1.92.0 it is clean, which is why nothing caught it earlier.

How verified

cargo +1.98.0 clippy --no-default-features --features zlob -- -D warnings
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.51s

That is the full CI command and it is the only clippy job; no other 1.98 lint fires on the workspace.

cargo test -p fff-search --no-default-features --features zlob --lib
test result: ok. 159 passed; 0 failed
cargo fmt -- --check   # clean

Automated triage via Gustav. Honk-Honk 🪿

Summary by CodeRabbit

  • Performance
    • Improved internal processing efficiency when flushing tracked bigrams, with no change to observable search behavior.

clippy 1.98 added chunks_exact_to_as_chunks, which fails CI under
-D warnings. SEEN_WORDS is a multiple of 8, so the remainder is
always empty and the fixed-size chunk keeps codegen identical or
better.
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5b53b04d-b006-41a5-82a7-0c283c8ea39f

📥 Commits

Reviewing files that changed from the base of the PR and between d5b4abd and dedc0c8.

📒 Files selected for processing (1)
  • crates/fff-core/src/index/bigram_filter.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

flush_seen now uses as_chunks::<8>() to scan the fixed-size bitmap. Bigram flushing remains unchanged.

Changes

Bigram filter bitmap scan

Layer / File(s) Summary
Compile-time bitmap chunking
crates/fff-core/src/index/bigram_filter.rs
flush_seen replaces chunks_exact(8) with as_chunks::<8>(). Existing bitmap scanning and bigram flushing remain unchanged.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to dedc0

This localized lint-compatibility change preserves behavior and has passed the stated checks; no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the flush_seen change and its Clippy-related purpose.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch triage-bot/clippy-as-chunks

Comment @coderabbitai help to get the list of available commands.

@dmtrKovalenko
dmtrKovalenko merged commit 28fce41 into main Aug 22, 2026
53 checks passed
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.

2 participants