vyre-libs
Category A composition ecosystem over vyre's hardware-intrinsic
primitives. Every function here returns a vyre::Program (or a
list of vyre::ir::Node a consumer can embed in a larger Program)
built entirely from existing vyre-ops primitives. No shader source,
no new inventory::submit!, no backend-specific code.
Modules
vyre_libs::math: linear algebra, scans, broadcastsvyre_libs::nn: neural-net primitives (linear, ReLU, softmax, layer_norm, attention)vyre_libs::matching: string scanning (substring, DFA, multi-string): one building block inside arbitrary programsvyre_libs::crypto: hashing (FNV-1a, BLAKE3, SHA-256, CRC32)
Design
Every public function wraps its IR body in a Node::Region with a
stable generator name. The optimizer treats Regions as opaque by
default (preserves source-mapping + debuggability); explicit inline
passes can unroll. This is LLVM's function-vs-always-inline split at
IR level.
One crate with four public modules today; each module promotes to
its own crates.io identity (vyre-nn, vyre-math,
vyre-crypto) when its consumer base justifies the fragmentation.
Usage
use dot;
let program = dot;
Production callers place library programs in a validated ProgramGraph and
execute them through the compiler artifact lifecycle.
Bounded regex replay
Open-ended regexes need a finite accelerator work bound. Set that bound when you compile the pipeline:
use ;
let pipeline = build_regex_dfa_pipeline_with_policy?;
The limit applies to each candidate origin. Bounded patterns use their exact
maximum. Open-ended patterns expose max_bytes = None and the selected finite
limit through CompiledRegexSet::pattern_extents. The whole-buffer program
derives each match start from its replay origin, so variable-length matches do
not subtract a guessed maximum from the end. Region evidence returns one
longest match for each pattern and origin.
Multi-device paged scans
Use scan_sharded_fused_weighted_timed when one corpus spans several
physical adapters. Pass one backend and one measured throughput weight per
adapter. The result is identical to the single-device paged scan.
ShardedScanTiming reports each adapter's windows, own bytes, wall time, and
device time. You can use those values to rebalance the next batch and to
separate kernel work from staging and host aggregation.
Feature flags
[]
= { = "0.1", = false, = ["nn"] }
math(default): linear algebrann(default, impliesmath): neural-net primitivesmatching(default): string scanning primitivescrypto(default): hashing
License
MIT OR Apache-2.0
Crate contract
This section is generated by python3 scripts/crate_readmes.py --write from
the crate manifest, release train, ownership registry, and crate-guide metadata.
Purpose
Own product-facing Tier 3 program compositions built from neutral primitives and contracts.
Boundaries
The product-libraries owner maintains this libraries crate at vyre-libs.
Its allowed internal production dependencies are: vyre-foundation, vyre-primitives, vyre-spec.
Any other normal or build dependency requires an ownership-registry change.
Minimal real example
Run the checked-in behavior from vyre-libs/examples/check_select1.rs:
CARGO_BUILD_JOBS=1 ./cargo_full run -p vyre-libs --example check_select1
Features
- Manifest features:
bench,c-parser,cpu-parity,crypto,crypto-blake3,crypto-fnv,decode,default,full,go-parser,hash,intern,logical,matching,matching-dfa,matching-nfa,matching-regex,matching-substring,math,math-algebra,math-broadcast,math-linalg,math-scan,math-succinct,nn,nn-activation,nn-attention,nn-inference,nn-linear,nn-linear-4bit,nn-moe,nn-norm,parsing,python-parser,rule,security,test-fixtures,text,visual - Default feature members:
math-linalg,math-scan,math-broadcast,nn-activation,nn-linear,nn-norm,matching-substring,matching-dfa,hash,decode
Errors and unsupported behavior
Invalid shapes, unsupported compositions, arithmetic overflow, and malformed evidence are rejected by the builder or validator before dispatch.
Testing
Use docs/testing/vyre-libs.md for exact commands, Cargo targets, hardware
requirements, evidence outputs, expected skips, and failure semantics.
Release status
vyre-libs@0.7.2 is a publishable crate on the current Vyre release train. Publication still requires the release evidence and user-approval gates.
Ownership
docs/CRATE_OWNERSHIP.toml is authoritative for this crate's responsibility
and allowed internal edges. Regenerate docs/CRATE_GRAPH.md and
docs/OWNERSHIP.md after changing that registry.
License
Licensed under either of
- Apache License, Version 2.0, or
- MIT license
at your option. See the workspace LICENSE-APACHE and LICENSE-MIT files.