Skip to main content

Module bloom_pointer

Module bloom_pointer 

Source
Expand description

BloomPointer<T> - pointer carrying a Bloom-filter summary of its target’s contents.

Layout: (bloom: u64, target: Arc<T>). The 64-bit Bloom filter is set from external knowledge of what’s reachable through target - typically the keys of a HashMap, the labels of a graph node’s outgoing edges, the IDs that occupy a B-tree subtree.

The architectural win: bloom_contains(query_key) rejects membership queries in one register-compare without touching the pointed-to data. With a 64-bit filter + 4 hash functions and ~16 items, false-positive rate is ~3%; for ~97% of negative queries the scan skips the pointer chase entirely.

§K_cascade composition - BloomCascade<T>

Wraps BloomPointer<BloomPointer<T>> semantics in a dedicated struct: coarse 8-byte filter for level-0 rejection, finer 32-byte filter for level-1 rejection, target pointer for the deref. Mirrors the LSM-tree multi-level Bloom design.

Structs§

Bloom64
64-bit Bloom filter with 4 hash functions.
BloomCascade
Two-level cascading filter: 8-byte coarse + 32-byte fine. Layer 0 (coarse) rejects in one register-compare. Layer 1 (fine) holds 4x as many bits + 8 hash functions; rejects most of the remainder before the target is touched.
BloomFine
256-bit Bloom filter with 8 hash functions.
BloomPointer
(Bloom64, Arc<T>) - 16 bytes on 64-bit.

Enums§

CascadeOutcome
Outcome of BloomCascade::cascade_check.