Skip to main content

Module codecs

Module codecs 

Source
Expand description

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

Fp32/Fp16/Int8 score by decoding — they are the verification / hot tiers, where fidelity matters more than per-candidate cost. Turbo4 scores directly on packed codes (never reconstructs), as required by ADR-296.

Structs§

Fp16Codec
IEEE 754 binary16: 2 bytes/dim. Hot-tier codec (~1e-3 relative error). Conversion is implemented in-crate (no half dependency) with round-to-nearest-even, matching hardware semantics.
Fp32Codec
Identity codec: 4 bytes/dim, exact. The verification anchor of the plane.
Int8Codec
Per-vector min/scale uniform int8: [min f32 | scale f32 | D bytes]. Same scheme as the legacy ScalarQuantized, but blob-oriented so the plane can move it around like any other representation.
Turbo4PlaneCodec
VectorCodec adapter over ruvector_turboquant::Turbo4Codec — scores on packed codes, never reconstructs (ADR-296).

Functions§

f16_bits_to_f32
binary16 bits → f32 (exact).
f32_to_f16_bits
f32 → binary16 bits, round-to-nearest-even; overflow → ±inf.