vyre-conform 0.1.0

Conformance suite for vyre backends — proves byte-identical output to CPU reference
Documentation
use std::fmt;
use std::path::{Path, PathBuf};
use crate::generate::archetypes::Archetype;
use crate::generate::templates::TemplateError;
use crate::spec::types::OpSpec;

/// Generator failure.
#[derive(Debug)]
pub enum GenError {
    /// The generation plan is internally inconsistent.
    InvalidPlan {
        /// Actionable reason the plan cannot be generated.
        reason: String,
    },
    /// Template rendering failed.
    Template(
        /// Underlying template subsystem error.
        TemplateError,
    ),
    /// Generated Rust failed syntax validation.
    InvalidRust {
        /// Test name whose generated file failed parsing.
        test_name: String,
        /// Parser diagnostic.
        reason: String,
    },
    /// Writing a generated file failed.
    Io(
        /// Underlying filesystem error.
        std::io::Error,
    ),
    /// Two tuples produced the same deterministic test name.
    NameCollision(
        /// Colliding deterministic test function name.
        String,
    ),
    /// The generator's independence certificate rejected an emitted test
    /// because it would compute its expected value from the op under test
    /// (tautology). See [`independence::verify_test_independence`] for the
    /// specific rule that fired.
    TautologicalTest {
        /// The test function name that was rejected.
        test_name: String,
        /// The op under test whose call path appeared on the expected
        /// binding's right-hand side.
        op: String,
        /// Source line of the offending binding.
        line: usize,
        /// The forbidden call path the certificate matched.
        call_path: String,
        /// Actionable hint — forwarded verbatim from the certificate.
        hint: String,
    },
    /// Multiple errors occurred during generation.
    Multiple(
        /// Underlying errors.
        Vec<GenError>,
    ),
    /// Arity mismatch between archetype input and op signature.
    ArityMismatch {
        /// Expected arity from op signature.
        expected: usize,
        /// Actual arity from archetype input.
        actual: usize,
        /// Op id for context.
        op: &'static str,
    },
}