Skip to main content

Crate vyre

Crate vyre 

Source
Expand description

§vyre - LLVM-for-GPU

Vyre is a GPU compute substrate centered on the Program type. Just as LLVM lets frontends emit a single IR that lowers to many processor targets, vyre lets frontends emit a single Program that lowers through any registered backend or the pure-Rust reference interpreter. The crate root re-exports the frozen public API: the Program type, the VyreBackend trait, and the standard operation library.

Frontends, backends, and conformance tools depend only on the stable types exported here. Changing the target-text lowering path never breaks a frontend; changing a frontend AST never affects backend dispatch logic. This module is the single source of truth for the vyre public API.

Modules§

backend
Backend trait surface - VyreBackend, Executable, Streamable, DispatchConfig, BackendError, ErrorCode. The whole backend contract every driver crate implements against. Public API re-export. Public API re-export. VyreBackend trait, BackendError, capability records, validation. Frozen backend extension contract.
cpu_op
Wire-format CPU-reference byte ABI contract. Public API re-export. CPU-side Op trait + helpers for op-by-op evaluation. CPU reference execution contract for operation types.
cpu_references
CPU reference implementations shared across backends. Public API re-export. CPU reference implementations of substrate primitives. CPU references for substrate kernels foundation needs locally.
diagnostics
Structured, machine-readable diagnostics. Public API re-export. Structured, machine-readable diagnostic rendering. Structured, machine-readable diagnostics.
error
Unified error types for the entire crate. Public API re-export. Unified error type for validation, wire format, lowering, and execution. Error types for IR validation, wire-format decoding, and GPU operations.
execution_plan
Substrate-neutral execution planning for performance and accuracy tracks. Public API re-export. Program → substrate-neutral execution planning for fusion, readback, provenance, autotune, and accuracy guard decisions. Substrate-neutral execution planning for performance and accuracy.
ir
The vyre Program model.
lower
Program lowering to the substrate-neutral kernel descriptor.
match_result
Re-export of the native scan match result type from the foundation crate. Public API re-export. Public API re-export. Engine-wide match-result type (carries findings + telemetry). Native scan match result - legacy scan-domain shim.
memory_model
Substrate-neutral memory ordering model. Public API re-export. Memory model: ordering, scope, and consistency rules. Substrate-neutral memory model contracts.
optimizer
IR-to-IR optimizer pass framework.
pipeline
Pipeline-mode dispatch: compile a Program once, dispatch repeatedly. Public API re-export. Public API re-export. Compiled-pipeline cache, dispatch config, batched dispatch. Pipeline mode - pre-compile a Program once, dispatch repeatedly with new inputs.
routing
Distribution-aware runtime algorithm selection. Public API re-export. Runtime routing: profile-guided variant selection, algorithm heuristics. Runtime distribution-aware algorithm routing.
soundness
Soundness lattice for dataflow primitives. Canonical home is vyre-foundation; re-exported here so vyre-libs (and any downstream consumer) reaches it via vyre::soundness. Per the LEGO discipline, vyre never imports from domain dataflow crates - this is the originating definition. Soundness lattice for dataflow primitives. Canonical home - dataflow engines and composition crates consume from here per the LEGO discipline (consumers always calls vyre, vyre never calls anything else). Soundness regime markers for dataflow primitives.

Structs§

BackendRegistration
One backend constructor contributed by a linked backend crate.
ByteRange
Domain-neutral byte-range type. A tagged, half-open byte range [start, end).
DispatchConfig
Immutable execution policy supplied by the caller before dispatch.
InterpCtx
Re-export of the core IR program type and validation entry point.
Match
Re-export of the native scan match result type.
NodeId
Re-export of the core IR program type and validation entry point.
Program
Re-export of the core IR program type and validation entry point.
ResidentGraphReuseTelemetry
Cold-upload and warm-reuse counters for a retained resident graph.

Enums§

BackendError
Actionable backend dispatch failure.
Error
The unified failure enum for every vyre operation.
MemoryOrdering
Substrate-neutral memory ordering type. Public API re-export. Memory ordering attached to atomic and barrier operations.
NodeStorage
Re-export of the core IR program type and validation entry point.
PersistentThreadMode
Persistent-thread dispatch policy for dispatch paths. Caller-controlled persistent-thread dispatch policy.
ResidentGraphReuseTelemetryError
Resident graph reuse telemetry arithmetic failed.
SpeculationMode
Speculation policy for dispatch paths. Caller-controlled speculation policy.
Value
Re-export of the core IR program type and validation entry point.

Constants§

OPTIMIZE_CACHE_CAPACITY
N9 cache capacity (entries). Sized to hold the working set of a long-running scanner without unbounded growth - each entry is roughly the size of one optimized Program. 256 entries is ~10MB worst-case for typical scanner-shaped Programs.

Traits§

CompiledPipeline
A program that has been pre-compiled by a backend, ready for repeated dispatch with new inputs without paying compilation cost on each call.
Executable
Backend capability for direct program execution.
TypedDispatchExt
Extension methods for callers that work with typed POD buffers instead of manually packing and unpacking byte vectors.
VyreBackend
The frozen contract between vyre and every execution backend.

Functions§

optimize
R2: single canonical pre-lowering optimize entry point.
optimize_for_backend
Device-aware public optimizer entry point for a live backend.
optimize_for_device
Device-aware public optimizer entry point.
validate
Re-export of the core IR program type and validation entry point.

Type Aliases§

Memory
Owned memory returned by a backend dispatch.
MemoryRef
Borrowed memory supplied to a backend dispatch.
OpId
Re-export of the core IR program type and validation entry point.
OutputBuffers
Output of one dispatch: a vector per output buffer slot, each vector holding the raw bytes read back from the GPU. Consumers decode the bytes per the Program’s output buffer declarations. The outer vec is indexed in the same order as the Program’s is_output: true buffers.