Repository navigation
feat(hnsw): quantization, narrow vector columns, exact prefilter, memory-sized models - #31468
Conversation
- QUANTIZATION option for HNSW: float32/float16/bf16/float64 for every op_type, int8/uint8 for L2 only. MO converts vectors and queries to the storage type before usearch. int8/uint8 use one trained [min,max] range sampled like IVF-Flat (SAMPLE ... PERCENT ... LIMIT), stored in the metadata table (quantize_min/quantize_max); CDC reuses it. - Index vecf16/vecbf16/vecint8/vecuint8 columns directly. - REINDEX keeps quantization and rejects changing it. - Exact filtered search when the prefilter candidate count is at most hnsw_prefilter_exact_threshold (default 100000). - usearch 2.26.5 matrixone_20261030 (usearch_filtered_search exact flag); Go binding redirected to cpegeric/usearch. - Upgrade 4.0.18 adds the metadata columns to existing HNSW indexes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Design doc docs/design/20261026-hnsw-quantization.md; every claim maps to a BVT section and unit tests. - BVT reorganized by claim; tie-free query points; adds narrowing, l2sq, empty-table CDC, delete, saturation, REINDEX retrain, copy ALTER/CLONE/TRUNCATE, exact-threshold and overflow cases. - Sync: a model created before int8/uint8 bounds were known takes them once trained (a chunk with no vectors no longer wedges the sync). - Reject a finite element the stored type cannot hold instead of storing Inf (float16/bf16/float32 narrowing). - Rescale int8/uint8 distances in float64. - Build the quantized metadata column list without patching SQL text. - Exact prefiltered search comments state its cost precisely. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A filtered graph walk is cheaper than the exact scan once qualifying rows exceed roughly 30-85 x ef_search, nearly independent of index size and dimension (measured at 100k/1M rows, 128/768 dims). 5000 sits at that crossover for the default ef_search. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-scanning build, narrow types - int8/uint8 indexes keep their range in a key/value hidden table (hnsw_dict) instead of two metadata columns; the 4.0.18 upgrade is removed. - max_index_capacity defaults to 0: a model holds what fits 75% of available host memory (dimension, stored width, M), as ivfpq; build and sync use the index option, then the session variable, then the estimate. Models reserve only the rows they receive. - hnsw_create(params, cfg) counts, samples and streams the source itself; no CROSS APPLY. - Build, sync, CDC and search use the column's element type; a vector already in the stored type is passed to usearch as it is. - ISCP accepts the third hidden table; a vecint8/vecuint8 index without a dict uses its type range; a multi-batch sync grows the model's reservation. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Unit tests for the hnsw_dict table def, quantization/column checks, the QUANTIZATION param, and narrow-type search dispatch (diff coverage 84.8%). - usearch >= 2.25 replaced SimSIMD with NumKong and ignores the SimSIMD CMake flags, so remove the SimSIMD tarball and its thirdparties Makefile rules. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: a74601615dd2a7b1713281ee6d0a8a930617461e
Assessment: approve
Reviewed the complete delta, design, linked issue and discussion. The prior streaming-cleanup deadlock is resolved: capacity two accommodates the verified two-error publication bound. No actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1
Validation:
-
Full table_function package passed with the race detector. Build-error and caller-cancellation regressions each passed 28 repetitions; stream-error and successful-build controls passed 100 repetitions.
-
Qualified retained HNSW/plugin/usearchex and targeted ISCP/planner results against unchanged inputs; verified 199 native inputs and six native output hashes.
-
Receipts, source fingerprints, logs and all five discussion items reconciled. Source unchanged. Artifacts: /home/xupeng/.local/state/mo-bot/jobs/ae0562ff3b3e82762188bb0d/attempt-1/validation-audit.json and discussion-assessment.json.
Limitations:
-
Cancellation tests use the real builder with a stream stub matching the inspected production executor contract.
-
No local distributed SQL BVT or production-scale performance rerun; frozen CI conclusions lack raw logs.
🚫 Left the queue2 h 8 min in the queue, with no time running CI. So far
Reason Pull request #31468 has been dequeued Queue conditions are not satisfied:
Hint You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Requeued — the merge queue status continues in this comment ↓. Times in UTC · dashboard · how the merge queue works |
# Conflicts: # pkg/frontend/variables.go
🚫 Left the queue1 h 29 min in the queue, with no time running CI. So far
Reason The pull request #31468 has been manually updated Tick the box to put this pull request back in the merge queue (same as
Times in UTC · dashboard · how the merge queue works |
What type of PR is this?
Which issue(s) this PR fixes:
issue #31467
What this PR does / why we need it:
Design:
docs/design/20261026-hnsw-quantization.md(status: proposed — design review requested).Behavior
QUANTIZATIONon HNSW: float32 / float16 / bf16 / float64 / int8 / uint8 (int8/uint8 L2 only, one trained range per index; no widening; fixed at CREATE, REINDEX keeps it).hnsw_dict(only int8/uint8 indexes have it; existing indexes need no upgrade).max_index_capacitydefault 0: each model holds what fits 75% of available host memory (dimension, stored width, M), as IVF-PQ; build and sync use the index option, then the session variable, then the estimate. Models reserve only the rows they receive.hnsw_create(params, cfg)counts, samples and streams the source itself (no CROSS APPLY).hnsw_prefilter_exact_threshold(default 5000, from a measured exact-vs-walk crossover).Validation
vector_hnsw_quantization179/179 and all existing HNSW BVT files pass.Limits
cpegeric/usearch, filtered searchexactflag) until Add: Exact filtered search in C and Go unum-cloud/USearch#828 merges.🤖 Generated with Claude Code