Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,25 @@ jobs:
- name: Rust Test
run: cargo test --workspace --all-features

msrv:
name: MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Read MSRV
id: msrv
shell: bash
run: echo "version=$(grep '^rust-version' Cargo.toml | awk -F'\"' '{print $2}')" >> $GITHUB_OUTPUT

- name: Rust Toolchain
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
with:
toolchain: "${{ steps.msrv.outputs.version }}"

- name: Rust Check
run: cargo +${{ steps.msrv.outputs.version }} check --lib --all-features

bench-codspeed:
name: Benchmark with Codspeed
runs-on:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = "https://github.com/spiraldb/onpair"
readme = "README.md"
keywords = ["compression", "strings", "onpair", "random-access", "lightweight"]
categories = ["compression"]
rust-version = "1.91.0"
rust-version = "1.95.0"
edition = "2024"
exclude = [".github/*"]

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.91.0"
channel = "1.100.0"
components = ["rust-src", "rustfmt", "clippy", "rust-analyzer"]
profile = "minimal"
4 changes: 3 additions & 1 deletion src/encoding/dictionary_matcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ impl DictionaryMatcher {
chains.resize(keys.len(), PrefixChain::new(dict, &chain, &mut prefix_pool));

let blocks: Vec<KeyBlock> = keys
.chunks_exact(BLOCK_KEYS)
.as_chunks::<BLOCK_KEYS>()
.0
.iter()
.map(|chunk| KeyBlock {
hi: std::array::from_fn(|i| (chunk[i] >> 64) as u64),
lo: std::array::from_fn(|i| chunk[i] as u64),
Expand Down
4 changes: 2 additions & 2 deletions src/search/substring/probe/scan/matcher/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ impl Matcher for Table {
/// Always packs: a lookup per code leaves nothing to skip.
fn check(&self, codes: &Block, bits: &mut Mask, _skip_empty: bool) -> bool {
let mut any = 0;
for (word, codes) in bits.iter_mut().zip(codes.chunks_exact(64)) {
for (word, codes) in bits.iter_mut().zip(codes.as_chunks::<64>().0) {
// Eight independent shift-OR chains per word.
let mut packed = 0u64;
for (group, codes) in codes.chunks_exact(8).enumerate() {
for (group, codes) in codes.as_chunks::<8>().0.iter().enumerate() {
let mut byte = 0u64;
for (bit, &code) in codes.iter().enumerate() {
byte |= u64::from(self.admits[usize::from(code)]) << bit;
Expand Down
6 changes: 3 additions & 3 deletions src/search/substring/probe/scan/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ mod tests {
//! hit density and row length, including empty rows, long gaps, and rows that
//! span blocks. These tests accept every hit to isolate row resolution.

use super::{Mask, Resolver, find_row};
use super::{Resolver, find_row};
use crate::core::dictionary::Dictionary;
use crate::core::offset::Offset;
use crate::core::types::Token;
Expand All @@ -161,8 +161,8 @@ mod tests {
};
let mut out = Vec::new();
let mut resolver = Resolver::new(input);
for (block, bits) in mask.chunks_exact(BLOCK / 64).enumerate() {
let bits: &Mask = bits.try_into().unwrap();
let (blocks, _) = mask.as_chunks::<{ BLOCK / 64 }>();
for (block, bits) in blocks.iter().enumerate() {
if bits.iter().any(|&set| set != 0) {
resolver.rows(bits, block * BLOCK, &mut out);
}
Expand Down
Loading