Skip to main content

Module encoding

Module encoding 

Source
Expand description

Unified vector-representation plane (ADR-297 §1).

One interface — VectorCodec / EncodedQuery — for every way RuVector can hold a vector: FP32, FP16, Int8, Turbo4 (and, from their own crates, PQ and RaBitQ). Storage, indexes, snapshots, WASM, and bindings consume &dyn VectorCodec and opaque blobs; they never name a concrete codec. This is what lets precision become a per-vector, per-query decision instead of a compile-time choice.

Also home to VectorProvenance (ADR-297 §7): the metadata every stored vector must carry so that migrations are auditable and snapshots stay deterministic and independently verifiable.

Modules§

codecs
In-core implementations of the VectorCodec plane: Fp32, Fp16, Int8, and the Turbo4 adapter over ruvector-turboquant (ADR-297 §1).

Structs§

VectorProvenance
Provenance every stored vector carries (ADR-297 §7). Snapshots must be reproducible from (source, provenance) alone — which is why rotation seeds are recorded and codecs are versioned.

Enums§

CodecKind
Every representation the plane knows about. Pq and RaBitQ1 are reserved here (stable blob-header / provenance values) but their codecs live in ruvector-pq-search / ruvector-rabitq (ADR-297 phase C).

Constants§

CODEC_VERSION
Current layout version of the in-core codecs.

Traits§

EncodedQuery
A prepared query bound to one codec + metric.
VectorCodec
A vector codec: encodes f32 vectors into opaque blobs and scores blobs without the caller knowing the representation.

Functions§

codec_for
Construct a codec by kind. The single entry point bindings and storage use, so adding a codec never touches consumers.