v1.0.0 — Stable API #1
jamesgober
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
iqdb-quantize v1.0.0 — Stable
The quantization layer is stable. v1.0.0 commits the public API of
iqdb-quantizeunder SemVer for the entire 1.x series: no breaking changes until 2.0. The three schemes every iQDB deployment dials between — scalar, product, binary, behind oneQuantizertrait — are now a fixed point the index crates can build on without churn. Nothing in the public surface changed since 0.5.0; this release adds the consumer-simulation soak, runnable examples, and the stability commitment.What is iqdb-quantize?
The memory-efficiency layer of the iQDB vector database. It compresses
f32embedding vectors into compact codes that preserve similarity-search quality — a million 768-dim vectors drop from ~3 GB to as little as ~96 MB. Three schemes share oneQuantizertrait: scalar (SQ8, ~4×, every metric), product (PQ, up to ~192×, with batch-ADC scoring for IVF-PQ), and binary (BQ, ~32×, Hamming). Distance is asymmetric — the database is compressed, the query staysf32— and the recommended quality path is to search quantized, then rerank the shortlist with full precision.Why 1.0 now
The road here was deliberate, one verified phase at a time:
Quantizertrait. The first scheme behind the trait every quantizer implements, with per-dimension affine calibration and asymmetric distance throughiqdb-distance.PqAdcTablesbatch-ADC primitive — the path IVF-PQ scores through.f32baselines,tracinginstrumentation, the criterion bench harness, and the surface locked.By 0.5.0 every Definition-of-Done criterion was met. The 0.6–0.9 RC phase exists to soak the API against live consumers; under the spine-first ordering the real consumer (
iqdb-ivf) is not yet published against this surface, so its intent was met by a consumer-simulation built at the exact shape IVF-PQ uses. The crate proceeds to 1.0 on a fully-satisfied checklist rather than a calendar — the same pathiqdb-typesandiqdb-distancetook.What 1.0.0 adds
Consumer-simulation soak
tests/consumer_simulation.rsis a mini IVF-PQ index built only on the public surface: it partitions a corpus into coarse clusters, stores each member as aPqCode, builds the ADC tables once per query withbuild_query_tables, and scans the probed clusters throughPqAdcTables::distance— exactly the intra-cluster scaniqdb-ivfperforms. It asserts the contracts the consumer relies on:PqAdcTables::distanceever drifted fromProductQuantizer::distance, this fails.f32-rerank recovers the exact top-10 (overlap ≥ 0.9); an SQ8 flat index preserves the exact top-10 directly (≥ 0.9).Runnable examples
Five documented examples (
cargo run --example <name>):scalar_quantization— SQ8 train / quantize / asymmetric distance / decode.product_quantization— PQ withbuild_query_tablesbatch scoring.binary_quantization— BQ and the Hamming-only contract.rerank— the search-quantized-then-rerank quality path, matching the exact answer.compression— the three schemes' code sizes side by side.The 1.x compatibility promise
dev/ROADMAP.mdis frozen until 2.0: theQuantizertrait, the three quantizers (ScalarQuantizer,BinaryQuantizer,ProductQuantizer), the three code types (Sq8Code,BqCode,PqCode), thePqAdcTablesbatch-ADC primitive, andVERSION.DistanceMetrica scheme does not support returnsIqdbError::InvalidMetricrather than panicking — the forward-compatible handling for the#[non_exhaustive]enum.Breaking changes
None. No public API changed from 0.5.0; 1.0.0 is the SemVer stability commitment.
Performance
Compression is exact and deterministic — the same
seed+ data yield byte-identical PQ codes on every platform:M = 16)Per-vector throughput, benchmarked on Windows x86_64 at 768 dims (criterion medians):
The
f32distance SQ8 and PQ delegate to is SIMD-accelerated transparently throughiqdb-distance(AVX2 / NEON), so quantized search inherits those kernels without a feature flag here.Verification
All green. 119 tests across unit, edge-case, property (
proptest), recall, determinism, tracing, smoke, consumer-simulation, and doctest suites, plus five runnable examples.cargo deny checkandcargo auditare clean. There is zerounsafein the crate. TheloomDefinition-of-Done item is N/A by design — the quantizers own their calibration by value with no interior mutability and no lock-free path, so there is no concurrent protocol to model (recorded indev/ROADMAP.md).What's next
iqdb-quantizeis done. Its consumer builds on it:iqdb-ivfscores in-cluster codes through this stable 1.x surface (PqAdcTables). Anything that consumer surfaces as a genuinely useful addition will be an additive1.0.xrelease.Installation
MSRV: Rust 1.87.
Documentation
Full diff:
v0.5.0...v1.0.0.Changelog:
CHANGELOG.md.This discussion was created from the release v1.0.0 — Stable API.
All reactions