Skip to main content

Module streaming

Module streaming 

Source
Expand description

Host-ingress chunk bridge for callers that still receive bytes through CPU memory. Host-ingress compatibility stream for chunked inputs.

This module is not VYRE’s canonical streaming model. It exists for callers that still receive bytes through host memory and need a bounded bridge while the device-resident megakernel queue is being used elsewhere. The stream owns a compiled WgpuPipeline and keeps at most one chunk in flight. Calling HostIngressStream::push_chunk starts GPU work for the new chunk, then returns the previous chunk’s completed output.

The CPU side is limited to ingress orchestration: owning the worker queue, handing byte chunks to wgpu, and collecting completion. It must not perform parser, matcher, scheduler, retry, or analysis semantics. The canonical VYRE path is vyre-runtime::megakernel: CPU launches/publishes descriptors, while the GPU owns phase progression and execution.

Worker-pool channel: crossbeam-channel. std::sync::mpsc::Receiver is single-consumer - wrapping it in Arc<Mutex<_>> to let N workers drain the same queue serialises wakeups on the mutex (the audit called this “Mutexmpsc::Receiver locking every recv”). crossbeam-channel is multi-producer multi-consumer natively, so N workers do N independent lock-free recvs.

Modules§

async_copy
Async copy stream primitives. Host-side async copy stream scheduling.

Structs§

HostIngressStream
Host-ingress adapter for one in-flight chunked dispatch stream.