vyre-conform 0.1.0

Conformance suite for vyre backends — proves byte-identical output to CPU reference
Documentation
use crate::proof::comparator::ComparatorKind;
use crate::spec::types::{ChainSpec, OpSpec, Strictness};
pub use super::suite::ConformanceSuite;
use crate::spec::minimums::{MIN_BOUNDARY_VALUES, MIN_EQUIVALENCE_CLASSES};

/// Construct the conformance workgroup-size schedule for an op.
///
/// P1.20-F16: previously this function silently dropped `Some(0)` and
/// returned `[1, 64]` — a contributor-supplied 0 was invisible. The trust
/// boundary for spec.toml now rejects 0 at load time (P1.20-F28), but the
/// in-process call sites that hand-build a `preferred` (e.g., the chain
/// helpers below) need the same guard. Returning `Result` makes the rejection
/// explicit instead of swallowed.
#[inline]
pub(crate) fn workgroup_sizes(preferred: Option<u32>) -> Result<Vec<u32>, String> {
    let mut sizes = vec![1u32, 64];
    if let Some(size) = preferred {
        if size == 0 {
            return Err(
                "Fix: workgroup_size cannot be 0. Use Some(n) with n in 1..=1024 \
                 or None to accept the default schedule."
                    .to_string(),
            );
        }
        if size > 1024 {
            return Err(format!(
                "Fix: workgroup_size {size} exceeds 1024. Cap to the device max."
            ));
        }
        sizes.push(size);
    }
    sizes.sort_unstable();
    sizes.dedup();
    Ok(sizes)
}