Skip to main content

Module vector_quantization

Module vector_quantization 

Source
Expand description

In-tree LogQuantized + unified distance kernels (WEFT-15 / 128 / 352 / 353).

§Vendor independence (2026-07-31)

These features were originally gated on ruvnet/RuVector#352 (still unmerged / conflicting). WeftOS now ships first-party implementations so activation no longer waits on that PR:

  • KG-011 LogQuantized — log-scaled int8 bins for skewed embeddings
  • KG-012 Unified distance — single codepath for cosine / L2 / IP with optional power-of-two padding and unrolled scalar SIMD-friendly loops

Config types remain serializable; is_available() is true when enabled is set (implementation always present in this crate).

Structs§

LogQuantizedConfig
Configuration for logarithmic quantization.
LogQuantizedVector
Log-scaled int8 quantized vector (in-tree; no ruvector-core).
SimdDistanceConfig
Configuration for the unified distance kernel.

Enums§

SimdDistanceMetric
Distance metric for the unified kernel.

Functions§

maybe_pad
Optionally pad with zeros to power-of-two length.
next_pow2
Next power of two ≥ n (n ≥ 1).
unified_distance
Unified distance: one codepath for cosine / L2 / IP with unrolled loops.