vyre-conform 0.1.0

Conformance suite for vyre backends — proves byte-identical output to CPU reference
Documentation
use crate::proof::comparator::ComparatorKind;
use crate::spec::types::{ChainSpec, OpSpec, Strictness};
pub use super::suite::ConformanceSuite;
use crate::spec::minimums::{MIN_BOUNDARY_VALUES, MIN_EQUIVALENCE_CLASSES};

/// Highest spec version in the chain, or 0 for an empty chain.
///
/// P1.20-F18: previously this used `.unwrap_or_default()` which silently
/// produced `chain_version = 0` for an empty `chain.specs`. The `0` then
/// surfaced in the certificate as if a real op had been certified at v0.
/// Public API kept its `u32` return for backward compat, but a debug_assert
/// catches the empty case in test builds and the doc comment now warns
/// callers explicitly. Library callers that want to reject empty chains
/// should check `chain.specs.is_empty()` themselves before calling this.
#[inline]
pub(crate) fn chain_version(chain: &ChainSpec) -> u32 {
    debug_assert!(
        !chain.specs.is_empty(),
        "chain_version called on empty chain '{}' — caller should reject \
         empty chains explicitly (P1.20-F18)",
        chain.id
    );
    chain
        .specs
        .iter()
        .map(|spec| spec.version)
        .max()
        .unwrap_or(0)
}