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::*;

/// Fuzz entry point: load versioned failures from an arbitrary directory.
#[inline]
pub fn load_failures_from_dir(dir: &std::path::Path) -> Vec<ParityFailure> {
    let Ok(entries) = fs::read_dir(dir) else {
        return Vec::new();
    };
    let mut failures = Vec::new();
    for entry in entries.flatten() {
        let path = entry.path();
        if path.extension().and_then(|ext| ext.to_str()) != Some("json") {
            continue;
        }
        if let Ok(text) = fs::read_to_string(path) {
            if let Ok(persisted) = serde_json::from_str::<PersistedFailure>(&text) {
                failures.push(persisted.into_failure());
            }
        }
    }
    failures.sort_by(|a, b| a.input_label.cmp(&b.input_label));
    failures
}