Expand description
RerankCodec wrapper for RaBitQ 1-bit quantization.
RaBitQ is a training-based codec: train() runs centroid calibration and
stores a randomised WHT rotation. Until training is complete, encode and
prepare_query return RerankError::NotTrained.
Distance is computed by inlining the asymmetric Hamming-based formula from
RaBitQCodec::exact_asymmetric_distance:
approx_l2 = q_norm² + v_norm² − 2 · q_norm · v_norm · (1 − 2·hamming/dim)
The prepared form is PreparedQuery::Bytes with the layout:
[0..4] query_norm as f32 little-endian
[4..] rotated_signs bytes (length = dim.div_ceil(8))
Structs§
- RaBitQ
Rerank - Object-safe
RerankCodecwrapper aroundRaBitQCodec.
Constants§
- DEFAULT_
ROTATION_ SEED - Default rotation seed used when the caller does not specify one.