vyre-conform 0.1.0

Conformance suite for vyre backends — proves byte-identical output to CPU reference
Documentation
//! Category A/C enum helpers.
//!
//! The canonical `Category` enum lives in `vyre-spec`, the leaf specification
//! crate. Conform keeps only helper predicates and finding data at this layer;
//! enforcement modules import these definitions instead of owning them.
//!
//! New category-level helpers (category-specific invariant checks,
//! per-category test families, conformance-track routing) live here so
//! the enforce module stays focused on the A/B/C rule itself.

pub use super::{CategoryFinding, FindingLocation};
pub use vyre_spec::{Category, IntrinsicTable};

/// Return true when the category is Category A — compositional,
/// zero-overhead after lowering.
///
/// Category A is the default home for every op that can be expressed as a
/// composition of primitives. When this predicate returns true, the
/// decomposition enforcer has jurisdiction and the op must lower to
/// byte-identical WGSL with its reference composition.
#[must_use]
#[inline]
pub fn is_compositional(category: &Category) -> bool {
    matches!(category, Category::A { .. })
}

/// Return true when the category is Category C — hardware intrinsic
/// with declared per-backend availability.
///
/// Category C ops are the escape hatch for silicon-specific instructions
/// that have no software fallback. When this predicate returns true, the
/// intrinsic-table enforcer checks that the backend's availability predicate
/// is honest and that the lowered output matches the hardware reference.
#[must_use]
#[inline]
pub fn is_intrinsic(category: &Category) -> bool {
    matches!(category, Category::C { .. })
}