rvf_quant/lib.rs
1//! Temperature-tiered vector quantization for the RuVector Format (RVF).
2//!
3//! Provides three quantization levels mapped to temperature tiers:
4//!
5//! | Tier | Quantization | Compression |
6//! |------|-------------|-------------|
7//! | Hot | Scalar (int8) | 4x |
8//! | Warm | Product (PQ) | 8-16x |
9//! | Cold | Binary (1-bit)| 32x |
10//!
11//! The [`rabitq`] module provides a RaBitQ-style 1-bit codec (centroid
12//! centering + seeded random rotation + correction scalars) with an
13//! asymmetric distance estimator, intended for two-stage
14//! (scan-then-rescore) search at ~32x code compression.
15//!
16//! A Count-Min Sketch tracks per-block access frequency to drive
17//! promotion/demotion decisions.
18
19#![cfg_attr(not(feature = "std"), no_std)]
20
21extern crate alloc;
22
23pub mod binary;
24pub mod codec;
25pub mod product;
26pub mod rabitq;
27pub mod scalar;
28pub mod sketch;
29pub mod tier;
30pub mod traits;
31
32pub use binary::{decode_binary, encode_binary, hamming_distance};
33pub use product::ProductQuantizer;
34pub use rabitq::{RabitqCode, RabitqQuantizer, RabitqQuery};
35pub use scalar::ScalarQuantizer;
36pub use sketch::CountMinSketch;
37pub use tier::TemperatureTier;
38pub use traits::Quantizer;