Skip to content

Commit ee30eba

Browse files
committed
Add AFL fuzz target for prefix filter correctness
Oracle-based differential fuzzer: runs the same AFL-derived operation sequence against two trees (one with prefix extractor, one without) and asserts all reads return identical results. Any mismatch = wrongly applied filter = silent data loss, saved by AFL as a crash for replay. Covers all identified correctness dimensions: - 9 extractor variants × 3 bpk levels × 3 filter partitioning policies - MVCC snapshot reads at older seqnos while writes continue - Weak tombstones and their compaction GC interaction - Extractor changes on reopen (prefix_filter_allowed compatibility) - Partitioned filter forced on all levels (the path that had the panic) - Bidirectional iterator stepping (PrefixPingPong) - Unbounded iteration (FirstKV/LastKV) - Clustered keys (first byte 0..7, len 1..9) for realistic prefix distribution with natural in-domain / out-of-domain key mix
1 parent c5c0cea commit ee30eba

File tree

3 files changed

+643
-0
lines changed

3 files changed

+643
-0
lines changed

fuzz/prefix_filter/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
in*
2+
out*

fuzz/prefix_filter/Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[package]
2+
name = "prefix_filter"
3+
version = "0.1.0"
4+
edition = "2024"
5+
6+
[dependencies]
7+
afl = "*"
8+
arbitrary = { version = "1", features = ["derive"] }
9+
lsm-tree = { path = "../.." }
10+
tempfile = "3.23.0"

0 commit comments

Comments
 (0)