1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
//! # 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:
//!
//! ```ignore
//! 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.
// P1.11 (closed): `OpEntry` is now POD over `&'static str` + `fn(...)`,
// so stdlib auto-traits give us `Send + Sync` for free. No `unsafe`
// anywhere in vyre-libs - `forbid` catches any future regression.
// P3.3 nested-dialect reshape: each sub-dialect's single op file
// shares the sub-dialect's module name (e.g. `math/broadcast/broadcast.rs`).
// That's the intended shape for community packs that add second/
// third ops to the same sub-dialect later; the lint would fight
// the architectural decision.
/// Build a trap-only program for registry fixtures or infallible composition wrappers.
pub
/// Region builder - the shared helper every composition routes through.
/// Library component.
/// Library component.
/// 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.
/// `TensorRef` - typed buffer-argument wrapper used by every Cat-A
/// composition for dtype + shape + name-uniqueness validation.
/// Library component.
/// Library component.
/// Library component.
/// Library component.
pub use ;
/// Shared builder helpers every Cat-A composition reuses.
/// Library component.
/// Library component.
/// Library component.
/// Library component.
pub use ;
/// Library component.
/// Library component.
/// `ProgramDescriptor` - introspection surface for Cat-A Programs.
/// Library component.
/// Library component.
/// Library component.
/// Library component.
pub use ;
pub use ;
/// Universal op harness - auto-testing infrastructure for every composition.
///
/// Each composition registers an `OpEntry` via
/// `inventory::submit!`. The harness discovers all entries at test
/// time and runs validation, wire round-trip, CSE stability, and
/// reference interpreter tests automatically.
///
/// Hidden from docs.rs - external consumers of vyre-libs don't need
/// this module's surface; it exists for internal test infrastructure
/// only. Kept `pub` so `inventory::submit!` can reference `OpEntry`
/// from per-op source files at crate-root scope.
/// Library component.
/// Library component.
/// Math dialect - linear algebra, scans, broadcasting.
/// Library component.
/// Library component.
/// Logical dialect - element-wise boolean composition.
/// Library component.
/// Library component.
/// Neural-network dialect - activation, normalization, attention, linear.
/// Library component.
/// Library component.
/// 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.
/// 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.
/// 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.
/// 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.
/// Text-processing compositions for the GPU C parser pipeline
/// (Phase L1+): byte classification, UTF-8 validation, line index.
/// Library component.
/// Library component.
/// Representation sub-dialect: bit-packing and unpacking.
/// Library component.
/// Library component.
/// 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.
/// 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.
/// Packed AST walks (`ast_walk_*` catalog ops).
/// Library component.
/// Library component.
/// GPU-native compiler middle-end (CFG and ELF emission helpers) for the C pipeline.
/// Library component.
/// Library component.
pub use ;
/// 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.
/// 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.
/// Compatibility facade for GPU dataflow compositions.
/// This path remains for older `vyre-libs::dataflow::*` consumers and must
/// not grow a parallel dataflow implementation tree.
pub use ;
// vyre-libs::hardware removed (audit 2026-04-21 BLOCKER-1/6).
// Canonical Cat-C intrinsics live exclusively in the `vyre-intrinsics`
// crate; library compositions of atomic / clamp / lzcnt / tzcnt ops
// live in `vyre-libs::math::*` (which uses `Expr::Atomic`, `Expr::min`,
// `Expr::max`, `Expr::popcount` directly per library-tiers.md).
//
// vyre-libs::crypto removed (audit 2026-04-21 BLOCKER-3). Deprecated
// shim deleted in favor of the canonical path at `vyre-libs::hash`.
//
// vyre-libs::composite removed (audit 2026-04-21 BLOCKER-3). The three
// hash ops that lived there (adler32, crc32, fnv1a64) are canonical at
// `vyre-libs::hash::*`.
/// Rule-engine dialect - typed conditions, formulas, and program builder used
/// by detection rule compilers.
/// Library component.
/// Library component.
/// 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.
/// Operation contract presets used by catalog entries.
/// Library component.
/// Library component.
/// Type-signature constants shared across op definitions.
/// Library component.
/// Library component.
/// Re-exports every type-signature constant at the crate root for convenient access.
/// Library component.
/// Library component.
pub use ;
/// Pre-sweep shader snapshot migration entries, collected via inventory.
/// `pub(crate)` because the registry is an internal pre-sweep tool -
/// downstream dialects do not submit through this path.
pub
/// Test support components for vyre-libs.
/// Driver-tier observability re-export so vyre-libs consumers can
/// snapshot substrate counters + decision histograms without taking a
/// direct vyre-driver dependency.
/// 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.