vyre-conform 0.1.0

Conformance suite for vyre backends — proves byte-identical output to CPU reference
Documentation
//! Coverage-matrix subcommand.
//!
//! Emits the (op × law) coverage matrix as JSON.
//!
use clap::Parser;

/// Arguments for coverage matrix output.
#[derive(Debug, Parser)]
pub struct Args {
    /// Emit the coverage matrix as pretty JSON.
    #[arg(long)]
    pub json: bool,
}

/// Emit the operation by law coverage matrix.
pub fn run(args: Args) -> Result<(), Box<dyn std::error::Error>> {
    if !args.json {
        return Err("Fix: use --json to emit the coverage matrix.".into());
    }

    let matrix = crate::proof::algebra::coverage::compute_coverage_matrix();

    let json = serde_json::to_string_pretty(&matrix)
        .map_err(|err| format!("Fix: failed to serialize coverage matrix: {err}"))?;
    println!("{json}");
    Ok(())
}