Summary
PulseMap's core engine uses unsafe code (AtomicU64 CAS operations in MetaWord, raw pointer casts in SlabPool). We need fuzz testing to catch edge cases that unit tests miss.
What To Do
- Add
cargo-fuzz as a dev dependency
- Create a
fuzz/fuzz_targets/ directory with at least one fuzz target that:
- Generates random
insert / get / remove sequences on a PulseMapRaw
- Verifies that
get() never returns corrupted data after any sequence of operations
- Tests TTL expiration with random epoch values and per-entry TTL overrides
- Tests eviction correctness: after filling a bucket beyond 4 entries, all returned values must match what was inserted
- Add a
fuzz/README.md explaining how to run it (cargo +nightly fuzz run ...)
Context
- Core engine files:
src/engine/meta.rs, src/engine/slot.rs, src/engine/slab.rs, src/raw.rs
- The
MetaWord uses AtomicU64 with Relaxed ordering — fuzz testing can help verify CAS loop correctness under rapid state transitions
- The
SlabPool does manual heap allocation via Layout — a prime candidate for fuzzing
Acceptance Criteria
Summary
PulseMap's core engine uses unsafe code (
AtomicU64CAS operations inMetaWord, raw pointer casts inSlabPool). We need fuzz testing to catch edge cases that unit tests miss.What To Do
cargo-fuzzas a dev dependencyfuzz/fuzz_targets/directory with at least one fuzz target that:insert/get/removesequences on aPulseMapRawget()never returns corrupted data after any sequence of operationsfuzz/README.mdexplaining how to run it (cargo +nightly fuzz run ...)Context
src/engine/meta.rs,src/engine/slot.rs,src/engine/slab.rs,src/raw.rsMetaWordusesAtomicU64withRelaxedordering — fuzz testing can help verify CAS loop correctness under rapid state transitionsSlabPooldoes manual heap allocation viaLayout— a prime candidate for fuzzingAcceptance Criteria
cargo +nightly fuzz runruns without panics for at least 60 secondsfuzz/README.mdexists with setup instructions