vyre 0.4.0

GPU compute intermediate representation with a standard operation library
Documentation
//! Canonical test fixture types for operation KATs.

use serde::Deserialize;

/// One known-answer test case.
///
/// Fields are `Option` so that a single TOML fixture file can hold cases for
/// many different operations; each op reads only the fields it needs.
#[derive(Debug, Deserialize)]
pub struct Case {
    /// Target operation for this case (used by the harness to filter).
    pub op: Option<String>,
    /// Input payload as lowercase hex.
    pub input_hex: Option<String>,
    /// Expected output payload as lowercase hex.
    /// Also accepts the alias `expected_hex` used by some data-movement ops.
    #[serde(alias = "expected_hex")]
    pub expected_output_hex: Option<String>,
    /// Whether the case is expected to succeed.
    pub ok: Option<bool>,
    /// Partition predicate id.
    pub predicate_id: Option<u32>,
    /// Gather indices buffer as lowercase hex.
    pub indices_hex: Option<String>,
    /// Broadcast scalar value.
    pub value: Option<u32>,
    /// Broadcast repetition count.
    pub count: Option<u32>,
    /// Compact mask buffer as lowercase hex.
    pub mask_hex: Option<String>,
    /// Partition expected pass buffer as lowercase hex.
    pub expected_pass_hex: Option<String>,
    /// Partition expected fail buffer as lowercase hex.
    pub expected_fail_hex: Option<String>,
}

/// Top-level fixture container.
#[derive(Debug, Deserialize)]
pub struct Cases {
    /// Fixture cases loaded from the `[[case]]` TOML array.
    pub case: Vec<Case>,
}