vyre-conform 0.1.0

Conformance suite for vyre backends — proves byte-identical output to CPU reference
Documentation
use vyre::ir::{BufferDecl, DataType, Expr, Node, Program};
use vyre_conform::{reference::interp, spec::value::Value};

/// ADVERSARIAL: Cast to U64 truncates upper 32 bits — vector: a U64 source value with a
/// non-zero high word is silently narrowed to 32 bits, corrupting 64-bit data.
#[test]
fn cast_to_u64_preserves_full_64_bits() {
    let high_word: u64 = 0x1_0000_0000;
    let program = Program::new(
        vec![
            BufferDecl::read("u64_in", 0, DataType::U64),
            BufferDecl::read_write("u64_out", 1, DataType::U64),
        ],
        [1, 1, 1],
        vec![Node::store(
            "u64_out",
            Expr::u32(0),
            Expr::Cast {
                target: DataType::U64,
                value: Box::new(Expr::load("u64_in", Expr::u32(0))),
            },
        )],
    );

    let input = Value::U64(high_word);
    let outputs = interp::run(&program, &[input.clone(), Value::U64(0)])
        .expect("cast must preserve full u64 payload");

    assert_eq!(outputs, vec![input]);
}