vyre-conform 0.1.0

Conformance suite for vyre backends — proves byte-identical output to CPU reference
Documentation
use crate::spec::types::ParityFailure;
use std::fs;
use std::io::{self, Write};
use std::path::PathBuf;
use std::sync::atomic::{AtomicU64, Ordering};
use std::time::{SystemTime, UNIX_EPOCH};
#[cfg(loom)]
use loom::sync::Mutex as LoomMutex;
use super::hex::*;

/// Persist a failing streaming input as raw bytes.
///
/// Streaming regressions use `regressions/<op_id>/<hash>.bin` so large inputs
/// can be written without hex expansion while remaining deterministic.
#[inline]
pub fn save_binary(failure: &ParityFailure) -> io::Result<PathBuf> {
    let dir = regression_dir(&failure.op_id);
    fs::create_dir_all(&dir)?;
    let name = format!("{}.bin", sha256_hex(&failure.input));
    let path = dir.join(name);
    atomic_write_new(&path, &failure.input)?;
    Ok(path)
}