vyre 0.4.0

GPU compute intermediate representation with a standard operation library
Documentation
//! Structural and semantic IR validation.
//!
//! Catches errors at construction time rather than at GPU compile time.
//! A program that passes validation is guaranteed to be well-formed: every
//! buffer reference is declared, every type is consistent, and every
//! recursive depth is bounded. Validation is the mandatory gate between
//! frontend emission and backend lowering.

/// Buffer name and binding validation.
///
/// Ensures that buffer names are unique, binding slots do not collide,
/// and workgroup buffers have positive element counts.
pub mod binding;

/// Default depth limits and limit tracking for recursive validation.
///
/// Defines the maximum call depth, nesting depth, and node count that
/// the validator will accept. These limits prevent pathological programs
/// from causing stack overflow or adapter limit violations.
pub mod depth;

/// Validation error construction helpers.
///
/// Internal utilities for building consistent `ValidationError` values
/// with actionable `Fix:` messages.
pub mod err;

/// Adapter limit validation.
///
/// Checks that buffer sizes, workgroup dimensions, and program scale
/// stay within the limits of the target GPU adapter.
pub mod limits;

/// The main validate entry point.
///
/// `validate` is the top-level function that runs every validation pass
/// and returns a vector of errors (empty on success).
pub mod validate;

/// Detailed validation failure report.
///
/// `ValidationError` describes exactly which invariant was violated,
/// where in the program it occurred, and how to fix it.
pub mod validation_error;

mod atomic_rules;
mod barrier;
mod bytes_rejection;
mod cast;
mod expr_rules;
mod nodes;
mod shadowing;
mod typecheck;

pub(crate) use binding::Binding;
/// Re-export of default depth limits and limit tracking.
///
/// These constants and types are used by the validator and by tests
/// that need to construct limit configurations.
pub use depth::{
    LimitState, DEFAULT_MAX_CALL_DEPTH, DEFAULT_MAX_NESTING_DEPTH, DEFAULT_MAX_NODE_COUNT,
};
pub(crate) use err::err;
/// Re-export of the top-level validation function.
///
/// This is the stable entry point called by frontends before handing a
/// `Program` to a backend.
pub use validate::validate;
/// Re-export of the detailed validation error type.
///
/// Consumers inspect `ValidationError` to produce human-readable
/// diagnostics or to decide whether a program can be retried.
pub use validation_error::ValidationError;