Skip to main content

Module buckets

Module buckets 

Source
Expand description

Per-value bucketed accounting for assert_sometimes_each!.

Each unique combination of identity key values creates one bucket. On first discovery the accounting calls [crate::hooks::on_bucket_split]; on every call it calls [crate::hooks::on_bucket_mark]. With no hook installed both are no-ops (pure accounting); the exploration backend wires them to coverage marking and fork dispatch. Optional quality watermarks allow re-signalling when the packed quality score improves.

§Memory Layout

[next_bucket: u32, _pad: u32, buckets: [EachBucket; MAX_EACH_BUCKETS]]

The next_bucket counter is incremented atomically (via AtomicU32::fetch_add) to allocate new buckets safely across fork boundaries.

Structs§

EachBucket
One bucket’s state for per-value bucketed assertions.

Constants§

EACH_BUCKET_MEM_SIZE
Total memory size for the EachBucket region.
MAX_EACH_BUCKETS
Maximum number of EachBucket slots.
MAX_EACH_KEYS
Maximum number of identity keys per bucket.

Functions§

assertion_sometimes_each
Backing function for per-value bucketed assertions.
each_bucket_read_all
Read all recorded EachBucket entries.
unpack_quality
Unpack a quality i64 back into individual values for display.