Skip to main content

Module codec

Module codec 

Source
Expand description

Codec layer: deterministic CodecConfig, canonical rotation matrix, rotation cache, codebook quantization, residual helpers, the stateless Codec service, and the PreparedCodec session object.

Phase 13 introduced the rotation primitives; Phase 14 adds the uniform-quantile Codebook plus scalar quantize / dequantize kernels. Phase 15 adds the Codec service, FP16 residual helpers, CompressedVector value object, and Parallelism enum. Phase 26 adds PreparedCodec — a pre-built session that caches the rotation matrix for reuse across batch calls, enabling the GPU backend attachment point (Phase 27+).

Re-exports§

pub use codebook::Codebook;
pub use codec_config::CodecConfig;
pub use codec_config::MAX_DIMENSION;
pub use codec_config::SUPPORTED_BIT_WIDTHS;
pub use compressed_vector::CompressedVector;
pub use parallelism::Parallelism;
pub use prepared::PreparedCodec;
pub use rotation_cache::RotationCache;
pub use rotation_cache::DEFAULT_CAPACITY as ROTATION_CACHE_DEFAULT_CAPACITY;
pub use rotation_matrix::RotationMatrix;
pub use service::compress;
pub use service::decompress;
pub use service::Codec;

Modules§

codebook
Immutable quantization lookup table with Python-parity training.
codec_config
CodecConfig: immutable value object describing codec parameters.
compressed_vector
In-memory CompressedVector value object (Phase 15).
gaussian
Deterministic ChaCha20-backed standard-normal f64 stream.
parallelism
Parallelism dispatch for batch codec methods (Phase 15).
prepared
PreparedCodec: pre-built session object for the hot compress/decompress path.
residual
FP16 residual helpers (Phase 15).
rotation_cache
Process-wide LRU cache for rotation matrices, keyed by (seed, dim).
rotation_matrix
Canonical orthogonal rotation matrix (ChaCha → faer QR → sign correction).
service
Stateless Codec service (Phase 15).