Expand description
§rave-core
Core types, traits, context, and error model shared by all RAVE crates.
rave-core defines the engine contracts used across decode, preprocess,
inference, and encode stages. It is the foundation crate for pipeline assembly.
§Scope
- GPU context and memory pooling (
GpuContext,PoolStats,HealthSnapshot) - Frame and pixel contracts (
GpuTexture,FrameEnvelope,PixelFormat) - Backend trait for inference (
UpscaleBackend,ModelMetadata) - Codec I/O traits (
BitstreamSource,BitstreamSink,FrameDecoder,FrameEncoder) - Unified error hierarchy (
EngineError,Result) - Low-level CUDA/NVDEC/NVENC FFI aliases used by higher-level crates
§Key Modules
context: CUDA device/stream ownership, pooled allocations, VRAM accountingtypes: GPU-resident frame and pixel format contractsbackend: inference backend trait + model metadata contractcodec_traits: decode/encode source/sink abstractionserror: typed errors with stable error codesffi_types: C ABI type aliases and enums used by codec crates
§Feature Flags
debug-alloc: enables host-allocation instrumentation helpers indebug_alloc
§Runtime Notes
- On Linux/WSL, runtime must resolve NVIDIA driver libraries (
libcuda.so, etc.). - This crate is shared by both runtime code and tests, so linker/runtime setup for CUDA affects downstream workspace crates.
§Minimal Example
use rave_core::context::GpuContext;
use rave_core::error::Result;
fn init() -> Result<()> {
let ctx = GpuContext::new(0)?;
let (_current, _peak) = ctx.vram_usage();
Ok(())
}§Relationship to Other Crates
rave-cuda: implements CUDA kernels and stream helpers usingrave-coretypesrave-tensorrt: implementsUpscaleBackendrave-nvcodec: implementsFrameDecoderandFrameEncoderrave-pipeline: orchestrates stage concurrency with these shared contracts
Modules§
- backend
- Upscale backend trait — the GPU-only inference contract.
- codec_
traits - Shared codec traits used across crate boundaries.
- context
- Shared CUDA context — single device, explicit stream management, bucketed buffer pool, VRAM accounting, hardware-aligned allocation, GPU profiling hooks, and production metrics enforcement.
- debug_
alloc - Debug-only host allocation tracker.
- error
- Typed error hierarchy for the engine.
- ffi_
types - Shared CUDA and Video Codec SDK FFI type aliases.
- host_
copy_ audit - Feature-gated host-copy audit helpers.
- types
- GPU-resident frame types and pixel format contracts.