Skip to content

Commit a42d9b0

Browse files
committed
feedback
1 parent 3aef062 commit a42d9b0

6 files changed

Lines changed: 5 additions & 28 deletions

File tree

fuzz/fuzz_targets/decode_arbitrary.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//!
55
//! Why this target is needed
66
//! -------------------------
7-
//! The existing `compress_oracle` target only feeds *well-formed* data to the Rust
7+
//! The existing `encode_oracle` target only feeds *well-formed* data to the Rust
88
//! decoder (it first compresses valid input, then decompresses).
99
//! That means corrupted or truncated compressed streams never reach the decoder, so
1010
//! out-of-bounds panics in `decode_page` are invisible to the fuzzer.

fuzz/justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ run-iters target iters='10000' *args:
3434
# Run encode_oracle (pure Rust roundtrip, no C++ required)
3535
rust-encode *args: (run 'encode_oracle' args)
3636

37-
# Run decode_oracle (parallel Rust + C++ roundtrips, cross-checks decodeed values)
37+
# Run decode_oracle (parallel Rust + C++ roundtrips, cross-checks decoded values)
3838
rust-decode *args: (run 'decode_oracle' args)
3939

4040
# Feed arbitrary bytes directly to the Rust decodeor (no panic check)

justfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,15 @@ fmt:
8585
#!/usr/bin/env bash
8686
set -euo pipefail
8787
for dir in "./" "fuzz"; do
88-
cd "$dir"
88+
pushd "$dir"
8989
if (rustup toolchain list | grep nightly && rustup component list --toolchain nightly | grep rustfmt) &> /dev/null; then
9090
echo "Reformatting Rust code using nightly Rust fmt to sort imports in $dir"
9191
cargo +nightly fmt --all -- --config imports_granularity=Module,group_imports=StdExternalCrate
9292
else
9393
echo "Reformatting Rust with the stable cargo fmt in $dir. Install nightly with \`rustup install nightly\` for better results"
9494
cargo fmt --all
9595
fi
96-
if [ -f .git ]; then
97-
cd ..
98-
fi
96+
popd
9997
done
10098
10199
# Reformat all Cargo.toml files using cargo-sort

src/rust/integer_compression/fastpfor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::{BlockCodec, FastPForError, FastPForResult};
1313
/// Overhead cost (in bits) for storing each exception's position in the block
1414
const OVERHEAD_OF_EACH_EXCEPT: u32 = 8;
1515

16-
/// Default page size in number of integers (64 KiB / 4 bytes = 16 Ki integers).
16+
/// Default page size in number of integers.
1717
const DEFAULT_PAGE_SIZE: u32 = 65536;
1818

1919
/// Type alias for [`FastPFor`] with 128-element blocks.

src/test_utils.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
//! Criterion benchmarks, integration tests, and `#[cfg(test)]` unit tests in the
33
//! `fastpfor` crate.
44
//!
5-
//! - **Library unit tests:** `crate::test_utils` via `#[cfg(test)] mod bench_utils` in `lib.rs`
6-
//! and `extern crate self as fastpfor` so this file can `use fastpfor::...`.
7-
//! - **Integration tests:** `#[cfg(test)] #[path = "../src/test_utils.rs"] mod bench_utils`.
8-
//! - **Criterion benchmarks:** `#[path = "../src/test_utils.rs"] mod bench_utils` (`cfg(test)` is not
9-
//! enabled for bench targets, so the module is included unconditionally there).
10-
//!
115
//! Loaded as a module via `#[path]` or as a normal child module, so every item
126
//! consumed from outside must be `pub`. Each consumer uses a different subset,
137
//! so dead-code is allowed at module scope.

tests/basic_tests.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,6 @@ fn saul_test() {
2020
roundtrip_all(&[2u32, 3, 4, 5]);
2121
}
2222

23-
/// Sub-block-sized inputs produce no output via `BlockCodec`.
24-
#[test]
25-
fn spurious_out_test() {
26-
fn check<C: BlockCodec + Default>(len: usize) {
27-
let x = vec![0u32; 1024];
28-
let (blocks, _) = slice_to_blocks::<C>(&x[..len]);
29-
let out = block_compress::<C>(cast_slice(blocks)).unwrap();
30-
assert!(out.is_empty() || blocks.is_empty());
31-
}
32-
for len in 0..32usize {
33-
check::<FastPForBlock256>(len);
34-
check::<FastPForBlock128>(len);
35-
}
36-
}
37-
3823
/// `AnyLenCodec` round-trips empty input correctly.
3924
#[test]
4025
fn zero_in_zero_out_test() {

0 commit comments

Comments
 (0)