Skip to main content

Crate vyre_runtime

Crate vyre_runtime 

Source
Expand description

§vyre-runtime - persistent megakernel + io_uring zero-copy

This crate provides the execution runtime for vyre - the layer between “I have a compiled Program” and “bytes flow through the GPU continuously.”

§Architecture

  1. megakernel - the persistent GPU process. A vyre Program wrapping Node::forever that loops a ring-buffer interpreter or a JIT-fused payload processor.
    • protocol - slot layout, control words, opcodes
    • opcode - built-in opcode handlers + extension mechanism
    • builder - IR Program construction (interpreted + JIT)
  2. cache - content-addressed compilation cache.
  3. stream - GpuStream glue bridging io_uring completions to the megakernel tail pointer.
  4. uring (Linux only) - raw io_uring syscall wrappers.

§Design laws

  • No CPU executor on the hot path. Compatibility ingest may submit registered mapped reads, but the native path is NVMe passthrough into BAR1 GPU memory; after launch the megakernel owns execution and the CPU only touches queue metadata.
  • Megakernel is IR, not target-text. The persistent kernel is a Program any VyreBackend can compile + dispatch.
  • Structured errors, never silent swallowing. Every failure mode returns PipelineError with a Fix: hint.

Re-exports§

pub use replay::RecordedSlot;
pub use replay::ReplayLogError;
pub use replay::RingLog;
pub use tenant::TenantError;
pub use tenant::TenantHandle;
pub use tenant::TenantRegistry;
pub use tenant::OPCODE_RANGE_PER_TENANT;
pub use tenant::TENANT_ID_MAX;
pub use tenant::TENANT_OPCODE_BASE;
pub use pipeline_cache::RemoteCache;
pub use pipeline_cache::DiskCache;
pub use pipeline_cache::DiskCacheError;
pub use pipeline_cache::InMemoryPipelineCache;
pub use pipeline_cache::LayeredPipelineCache;
pub use pipeline_cache::PersistentPipelineCacheStore;
pub use pipeline_cache::PipelineCacheMetrics;
pub use pipeline_cache::PipelineCacheStore;
pub use pipeline_cache::PipelineFingerprint;
pub use megakernel::Megakernel;
pub use uring::GpuMappedBuffer;

Modules§

megakernel
Persistent megakernel - the vyre Program that runs forever on the GPU, decoding host-fed ring opcodes from a host-fed ring buffer. Persistent megakernel - the GPU becomes a VIR0 bytecode interpreter.
pipeline_cache
Content-addressed pipeline cache: blake3(canonicalize(p).to_wire()) is the cache key. P4.3 - content-addressed pipeline cache.
replay
Differential megakernel replay log - captures every published ring slot so a later cert run can diff epoch-by-epoch execution against a live backend. Differential megakernel replay log.
routing
Backend routing policy for execution plans. High-level execution routing engine.
scheduler
Multi-GPU work partitioning across runtime backends. Multi-GPU work stealing scheduler (Innovation I.7).
tenant
Multi-tenant megakernel multiplexing - one persistent kernel per GPU, shared across producer tools via the tenant_id field already in the ring protocol. Multi-tenant megakernel multiplexing.
uring
Linux io_uring integration. Compiled out on macOS / Windows. Linux io_uring scaffolding for NVMe → GPU-visible memory streaming. All items here are gated on cfg(target_os = "linux") and compiled out on every other platform.

Structs§

GpuStream
Handle to an orchestrated pipeline. Couples a compiled megakernel to its submission + completion infrastructure.

Enums§

PipelineError
Errors surfaced by the runtime layer. Every variant carries a Fix:-bearing message so a reviewer can act on the failure.