Skip to content

build(core): bump vecq-core to 0.3.0 — adopt 4-bit + residual profile - #1164

Merged
ajianaz merged 1 commit into
developfrom
build/vecq-core-0.3.0
Aug 31, 2026
Merged

ajianaz merged 1 commit into
developfrom
build/vecq-core-0.3.0

Conversation

@ajianaz

@ajianaz ajianaz commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

What

  • Bump vecq-core optional dep from 0.1 to 0.3 (crates/uteke-core/Cargo.toml + Cargo.lock).
  • Switch the vecq backend's create_index() to VecqIndex::with_residual(dims, VECQ_SEED) — 4-bit base quantization + residual refinement. with_residual pins bits=4 internally (residual requires the 4-bit width), so no explicit set_bits call is needed.

Why

  • Closes chore(deps): bump optional vecq-core feature dep to 0.3.0 #1161. vecq-core 0.3.0 is live on crates.io and brings the keyed API, Matryoshka working_dim, cascade search, residual mode, configurable width, and zero-copy VecqView.
  • Profile decision (per chore(deps): bump optional vecq-core feature dep to 0.3.0 #1161 discussion): 4-bit + residual — same storage footprint as the legacy 0.1 profile, better recall on noise-dominated data at ~2x scan cost. Deliberately avoids the new 5-bit default.
  • File-format forward lock-in is accepted: SQLite stays the source of truth; uteke repair rebuilds 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-free
  • cargo build -p uteke-cli -p uteke-server -p uteke-mcp --no-default-features --features vecq → green
  • cargo fmt --all -- --check → clean
  • CI vecq-check job will re-verify both feature builds

Replaces #1163 (closed: deps/ branch prefix not allowed by the Branch Naming check; deps is not a valid conventional-commit type).

…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
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit cf49be8 into develop Aug 31, 2026
29 of 31 checks passed
@ajianaz
ajianaz deleted the build/vecq-core-0.3.0 branch August 31, 2026 01:47
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(deps): bump optional vecq-core feature dep to 0.3.0

1 participant