Expand description
Zero-cost-when-disabled IR execution coverage collector.
Indexes every circuit, conditional branch (Statement::If / Expression::If),
assertion (Expression::Assert), ledger ADT operation (Expression::AdtOp),
and contract event emission (Expression::Emit) inside a MoonIr into
dense u32 site tables keyed by the stable address of each IR node.
Because IrExecutable owns its MoonIr inside an Arc, node addresses
stay fixed for the executable’s lifetime and require zero unsafe code
(std::ptr::from_ref(node) as usize). When coverage is disabled, the
interpreter holds coverage: None and skips all tracking with a single
branch check.
Structs§
- Assert
Coverage - Hit counts for one
assertsite (both passing and reverting executions). - Branch
Coverage - Hit counts for one conditional branch (
thenandelse/fallthrough arms). - Circuit
IrCoverage - Deep IR coverage counters for a single circuit (exported or internal).
- Emit
Coverage - Hit count for one contract event
emitsite. - IrCoverage
Collector - Live mutable hit counters accumulated during one or more circuit executions.
- IrCoverage
Map - Pre-indexed map of coverable IR sites for a single
MoonIr. - IrCoverage
Snapshot - Serializable deep IR coverage snapshot for one contract.
- IrCoverage
Totals - Rolled-up numeric totals across one or more
IrCoverageSnapshots. - Ledger
OpCoverage - Hit count for one ledger ADT operation site.
Enums§
- Branch
Kind - Whether a conditional branch came from a statement or expression
if.