Skip to main content

Crate vyre_libs

Crate vyre_libs 

Source
Expand description

§vyre-libs - Category A composition ecosystem

vyre-libs is the library layer that sits ON TOP of vyre-ops.

Almost every function is a pure Category A composition: it returns a vyre::Program built entirely from existing vyre IR primitives. The sole exception is the math::atomic family, which are Category B (Category::Intrinsic) because they require the backend to own the Expr::Atomic target builder emitter arm (F-IR-35).

This is the ML/DSP/cryptographic ecosystem layer. Examples:

use vyre_libs::nn::linear;
let program = linear(/* input_buf */ "x", /* weights */ "w", /* bias */ "b");
// `program` is a standard vyre::Program you dispatch against any backend.

§Why a single vyre-libs crate, not five?

The initial proposal suggested vyre-nn, vyre-math, vyre-match, vyre-crypto, vyre-graph-stitch as five standalone crates. That is the right endpoint - each becomes its own crates.io identity with its own community - but the migration cost at 0.6 is wrong. This crate starts as one, with public modules for each domain; when a module has its own consumer base + maturity, it promotes to a dedicated crate without breaking downstream code (the vyre-libs::nn path moves to vyre-nn:: via a re-export shim).

vyre-graph-stitch was deliberately omitted - “logical linker for emitted graphs” is a vyre-foundation concern (IR composition), not a library crate.

§Region wrapping

Every public composition wraps its body in a vyre::ir::Node::Region with a stable generator name. The optimizer treats Regions as atomic by default (preserves debuggability + source-mapping); explicit inline passes can unroll them. This is LLVM’s function-vs-always-inline split at IR level.

§Feature flags

Each domain lives behind a feature flag so minimal consumers pay for only what they use:

  • math (default) - linear algebra, scans, broadcasts
  • nn (default, implies math) - neural-net primitives
  • matching (default) - regex, DFA, substring, multi-pattern
  • crypto (default) - hashing, MAC, checksums

Turn defaults off with default-features = false and cherry-pick what you need.

Re-exports§

pub use tensor_ref::check_dtype;
pub use tensor_ref::check_shape;
pub use tensor_ref::check_unique_names;
pub use tensor_ref::TensorRef;
pub use tensor_ref::TensorRefError;
pub use builder::check_tensors;
pub use builder::BuildOptions;
pub use descriptor::BufferDescriptor;
pub use descriptor::ProgramDescriptor;
pub use math::matmul_bias_tiled;
pub use math::matmul_tiled;
pub use math::matmul_tiled;
pub use math::MatmulBias;
pub use math::MatmulBiasTiled;
pub use math::MatmulTiled;
pub use compiler::cfg::c11_build_cfg_and_gotos;
pub use compiler::object_writer::opt_lower_elf;
pub use compiler::regalloc::opt_x86_64_register_allocation;
pub use compiler::stack_layout::opt_stack_layout_generation;
pub use compiler::types_layout::c11_compute_alignments;
pub use signatures::BOOL_OUTPUTS;
pub use signatures::BYTES_TO_BYTES_INPUTS;
pub use signatures::BYTES_TO_BYTES_OUTPUTS;
pub use signatures::BYTES_TO_U32_OUTPUTS;
pub use signatures::F32_F32_F32_INPUTS;
pub use signatures::F32_F32_INPUTS;
pub use signatures::F32_INPUTS;
pub use signatures::F32_OUTPUTS;
pub use signatures::I32_OUTPUTS;
pub use signatures::U32_INPUTS;
pub use signatures::U32_OUTPUTS;
pub use signatures::U32_U32_INPUTS;

Modules§

borrowck
Front-end-agnostic borrow-check engine: the neutral BorrowFacts IR and the dataflow analysis over it. Producers (the Rust front-end now, a rustc adapter later) lower to BorrowFacts; the engine never depends on any front-end, which is what lets the borrow checker eventually run standalone. Front-end-agnostic borrow-check engine.
buffer_names
Library component. Library component. Deterministic buffer naming for generic Cat-A builder aliases.
builder
Shared builder helpers every Cat-A composition reuses. Library component. Library component. Shared helpers used by the per-op Cat-A builders.
compiler
GPU-native compiler middle-end (CFG and ELF emission helpers) for the C pipeline. Library component. Library component. Middle-end compiler pipeline on GPU IR: CFG, codegen, ABI layout.
contracts
Operation contract presets used by catalog entries. Library component. Library component. Shared operation-contract presets for the standard catalog.
dataflow
Compatibility facade for GPU dataflow compositions. This path remains for older vyre-libs::dataflow::* consumers and must not grow a parallel dataflow implementation tree. Compatibility facade for shared dataflow soundness contracts.
decode
Decode / decompression compositions - base64, hex, DEFLATE (stored), more coming. Pairs with vyre-libs::matching::dfa in the fused decode→scan pipeline (Innovation I.1). Library component. Library component. Decode / decompression compositions for GPU-resident pipelines.
descriptor
ProgramDescriptor - introspection surface for Cat-A Programs. Library component. Library component. ProgramDescriptor - lightweight structural introspection of a Cat-A composition’s Program without running the full IR builder.
graph
Packed AST walks (ast_walk_* catalog ops). Library component. Library component. Graph / AST buffer compositions (docs/ops-catalog.md §1).
hash
Hash / checksum dialect - FNV-1a-32, FNV-1a-64, CRC-32, Adler-32, BLAKE3 compression. Consolidated from the former vyre-libs::crypto module per Migration 3. Every op lives here as a pure Cat-A composition over existing IR primitives (no dedicated target builder emitter arm required, per the intrinsic-vs-library rule). Library component. Library component. Cat-A hash / checksum compositions.
intern
Vector-widened string interning. CHD perfect hash over Tier-B label families - 60k+ function-name strings reduce to one subgroup-shuffle + one DRAM load on the GPU. Library component. Library component. Vector-widened string interning.
logical
Logical dialect - element-wise boolean composition. Library component. Library component. Elementwise logical operations (and, or, xor, nand, nor). Ported from the legacy target-text implementations in vyre-ops.
matchingDeprecated
Backwards-compat alias for scan. New code should use vyre_libs::scan::*. The alias will be removed in a future breaking release; until then vyre_libs::scan::Foo and vyre_libs::scan::Foo resolve to the same item. Deprecated compatibility surface for the former vyre_libs::matching API.
math
Math dialect - linear algebra, scans, broadcasting. Library component. Library component. Linear algebra, scans, broadcasting, and atomic compositions.
nn
Neural-network dialect - activation, normalization, attention, linear. Library component. Library component. Neural-net primitives - activation, linear, normalization, attention, optimizer, quantization.
observability
Driver-tier observability re-export so vyre-libs consumers can snapshot substrate counters + decision histograms without taking a direct vyre-driver dependency.
parsing
GPU parser infrastructure (Phase L3+): bracket matching, DFA lexer driver, LR(1) table walker. Grammar tables are generated host-side by downstream analyzer-grammar-gen and loaded as ReadOnly buffers. Library component. Library component. The vyre-libs parsing and AST building domain library.
prelude
Re-export the small set of vyre types every composition function returns. Consumers can use vyre_libs::prelude::* and get the API plus the types it returns.
range_ordering
Domain-neutral byte-range ordering predicates. Previously lived inside vyre-libs::security::topology; hoisted out so non-security callers (a downstream analyzer’s Before/After predicates, future dialects) do not pull the security dialect through the import graph. See CRITIQUE_VISION_ALIGNMENT_2026-04-23 V5. Library component. Library component. Byte-range ordering predicates - substrate-neutral coordination helpers.
region
Region builder - the shared helper every composition routes through. Library component. Library component. Shared Region builder - moved into the standalone vyre-harness crate so external Cat-A wrappers (downstream dataflow engine, decodex, multimatch) can construct provenance-tagged Programs without depending on the rest of vyre-libs. This module is a thin re-export so existing call sites keep compiling unchanged.
representation
Representation sub-dialect: bit-packing and unpacking. Library component. Library component. Representation sub-dialect: bit-packing and unpacking.
rule
Rule-engine dialect - typed conditions, formulas, and program builder used by detection rule compilers. Library component. Library component. Rule-engine dialect: typed conditions, formulas, and program builder.
scan
Pattern-scanning dialect - substring, DFA, Aho-Corasick, rule dispatch, secfinding generation. Renamed from matching per ROADMAP T032 (SEPARATION_AUDIT S7) - “scan” reflects the actual semantic surface (not just substring matching). The original matching name is kept as a deprecated alias for backwards compatibility. Byte and text scan helpers - substring search, DFA / Aho–Corasick. Used as components inside full vyre::Program values (decode, graph, heuristics).
security
Security / taint compositions for static program analysis. Every op registers via inventory::submit! and lives under a stable op id. The implementations compose graph and dataflow primitives so downstream analyzers lower to one production GPU-facing surface. Security / taint compositions for program-analysis pipelines.
signatures
Type-signature constants shared across op definitions. Library component. Library component.
tensor_ref
TensorRef - typed buffer-argument wrapper used by every Cat-A composition for dtype + shape + name-uniqueness validation. Library component. Library component. TensorRef - typed buffer-argument wrapper for Cat-A ops.
test_support
Test support components for vyre-libs. Shared test-support helpers used by library conformance fixtures.
text
Text-processing compositions for the GPU C parser pipeline (Phase L1+): byte classification, UTF-8 validation, line index. Library component. Library component. Text-processing compositions for the GPU C parser pipeline.
visual
GPU-accelerated visual effects - blur, shadow, filter chain, gradient, compositing, and glass material. Tier 3 compositions over math::conv1d (Tier 2.5) and bare IR expressions. The Molten web engine’s visual effect substrate. Library component. Library component. Tier 3 visual compute compositions.

Enums§

Soundness
Soundness regime of a dataflow primitive.

Traits§

SoundnessTagged
Trait for types that carry a soundness marker.