Skip to main content

Module slots

Module slots 

Source
Expand description

Rich assertion slot tracking for the Antithesis-style assertion suite.

Maintains a fixed-size table of assertion slots. Supports boolean assertions (always/sometimes/reachable/unreachable), numeric guidance assertions (with watermark tracking), and compound boolean assertions (sometimes-all with frontier tracking).

Each slot is accessed via raw pointer arithmetic on the assertion region (heap by default, or MAP_SHARED memory when an exploration backend installs one). With multiple fork children running concurrently, find_or_alloc_slot claims slots by atomically writing msg_hash before re-scanning, ensuring concurrent allocators see each other.

On a “discovery” (first Sometimes/Reachable pass, numeric watermark improvement, or frontier advance) the accounting calls [crate::hooks::on_slot_discovery]. With no hook installed this is a no-op (pure accounting); the exploration backend wires it to coverage + forking.

Structs§

AssertionSlot
A single assertion tracking slot.
AssertionSlotSnapshot
A snapshot of an assertion slot for reporting.

Enums§

AssertCmp
Comparison operator for numeric assertions.
AssertKind
The kind of assertion being tracked.

Constants§

ASSERTION_TABLE_MEM_SIZE
Total size of the assertion table memory region in bytes.
MAX_ASSERTION_SLOTS
Maximum number of tracked assertion slots.

Functions§

assertion_bool
Boolean assertion backing function.
assertion_numeric
Numeric guidance assertion backing function.
assertion_read_all
Read all allocated assertion slots from the region.
assertion_sometimes_all
Compound boolean assertion backing function (sometimes-all).
msg_hash
FNV-1a hash of a message string to a stable u32.