Repository navigation
build(core): bump vecq-core to 0.3.0 — adopt 4-bit + residual profile - #1164
Merged
Merged
Conversation
…file - Bump optional vecq-core dep to 0.3 (issue #1161). API surface used by the integration (new/add/search/len/dim/to_bytes/from_bytes) is unchanged; 0.3.0 reads all persisted formats v1-v1.5. - Switch create_index() to VecqIndex::with_residual: 4-bit base quantization + residual refinement. with_residual pins bits=4 (residual requires the 4-bit width), so the storage profile matches the legacy 0.1 build while recall improves on noise-dominated data (~2x scan cost). Avoids the new 5-bit default deliberately — the recommended profile from #1161 is 4-bit + residual. - File-format note: indexes written by 0.3.0 are not readable by older uteke builds (forward lock-in). Safe because SQLite remains the source of truth and 'uteke repair' rebuilds the index from stored embeddings. Verified: - cargo test -p uteke-core --no-default-features --features onnx,vecq --lib: 529 passed, 0 failed - cargo test -p uteke-core --lib (usearch default): 528 passed - cargo build -p uteke-cli -p uteke-server -p uteke-mcp --no-default-features --features vecq: green
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Aug 31, 2026
ajianaz
added a commit
that referenced
this pull request
Aug 31, 2026
…uild) (#1169) * feat(core): runtime-selectable vector engine — build usearch+vecq together, select via ENV/config (#1168) Replace the compile-time mutual exclusion of vector engines with runtime selection while keeping slim single-engine builds working. - vector.rs: unified runtime enum Engine { Usearch(Box<Index>), Vecq(VecqIndex) } behind the unchanged VectorIndex API; all cfg- branched sites became match arms on the enum. The vecq profile stays 4-bit + residual (with_residual, #1164) on every path. - compile_error guard: 'both engines' no longer errors — only 'no engine at all' does. Features are additive: desktop builds can compile both engines; mobile keeps single-engine builds (unused variants are eliminated at link time). - Selection precedence: UTEKE_VECTOR_BACKEND env > [vector] backend in uteke.toml > compiled-in default (usearch when present). Unknown values / engines not compiled in fall back to the default with a warning — open() never fails on a bad preference. - Per-engine index files kept (uteke_index.usearch / .vecq). Switching engines leaves the old file intact; the new engine starts empty and finish_open_full auto-rebuilds it from SQLite (source of truth). Both files coexist; switching back picks the old file up without a rebuild. - New API surface: VectorBackend (parse/resolve/default_backend), VectorIndex::with_backend / load_or_create_for / load_from_file_for, VectorIndex::backend(). - CLI: [vector] backend config + UTEKE_VECTOR_BACKEND env override. - Docs: configuration.md env table entry. Verified (all green; clippy 0 warnings and fmt clean on all three feature sets): - dual-engine (onnx+usearch+vecq): 537 passed - vecq-only slim (onnx+vecq): 535 passed - default (onnx+usearch): 534 passed; cli config tests: 45 passed - e2e: engine switch usearch->vecq->usearch on one store — auto-rebuild from SQLite, per-engine files coexist, switch back reuses the old file; invalid env falls back to default * ci: extend vecq-check with dual-engine tests (#1168) Guard the runtime-selection feature: dual-engine build must compile and pass the engine-switch + vector module tests on every PR. --------- Co-authored-by: ajianaz <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
vecq-coreoptional dep from0.1to0.3(crates/uteke-core/Cargo.toml+Cargo.lock).create_index()toVecqIndex::with_residual(dims, VECQ_SEED)— 4-bit base quantization + residual refinement.with_residualpinsbits=4internally (residual requires the 4-bit width), so no explicitset_bitscall is needed.Why
uteke repairrebuilds the index from stored embeddings if a rollback ever encounters a newer-format index file. 0.3.0 reads all older formats (v1–v1.5), so existing persisted indexes keep working.Testing
cargo test -p uteke-core --no-default-features --features "onnx,vecq" --lib→ 529 passed, 0 failed (includes the 8 vector-module tests: roundtrip, save/load, top-k, eviction)cargo test -p uteke-core --lib(default usearch backend) → 528 passed, 0 failed — regression-freecargo build -p uteke-cli -p uteke-server -p uteke-mcp --no-default-features --features vecq→ greencargo fmt --all -- --check→ cleanvecq-checkjob will re-verify both feature builds