Skip to main content

vyre_std/
lib.rs

1//! vyre-std — the vyre standard library.
2//!
3//! Vyre's core crate ships primitive GPU ops (arithmetic, bitwise, memory,
4//! workgroup coordination). `vyre-std` ships the L2 layer: compositional
5//! helpers built from those primitives plus the full GPU DFA assembly
6//! pipeline (Thompson NFA → subset construction → Hopcroft → pack).
7//!
8//! The one-line consumer API is
9//! [`pattern::dfa_assemble::dfa_assemble`]: pass a slice of
10//! `Pattern::Literal(&[u8])` or `Pattern::Regex(&str)` and get back a
11//! `PackedDfa` whose bytes are backend-neutral dispatch payloads.
12//! Aho-Corasick construction as a companion primitive is deferred —
13//! see `coordination/L.1.4-aho_corasick_build-rewrite-deferred.md`.
14//!
15//! # Example
16//!
17//! ```
18//! use vyre_std::pattern::{dfa_assemble, AssembleOptions, Pattern};
19//!
20//! let patterns = [Pattern::Literal(b"hello"), Pattern::Regex("wor[ld]+")];
21//! let packed = dfa_assemble(&patterns, AssembleOptions::default()).unwrap();
22//! assert!(!packed.bytes.is_empty());
23//! ```
24
25#![warn(missing_docs)]
26#![forbid(unsafe_code)]
27
28/// GPU-native pattern matching and DFA assembly.
29pub mod pattern;
30
31/// Compositional arithmetic helpers (saturating, wrapping, clamp/lerp/etc.).
32pub mod arith;