Skip to content

fix(#139): vector index consistency — atomic save, error propagation - #263

Merged
ajianaz merged 2 commits into
developfrom
fix/139-vector-index-consistency
Jun 10, 2026
Merged

ajianaz merged 2 commits into
developfrom
fix/139-vector-index-consistency

Conversation

@ajianaz

@ajianaz ajianaz commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Problem (#139)

Multiple issues in vector index:

  1. Sidecar file consistency risk — .keys file written non-atomically, corruption risk on crash
  2. Silent error swallowing — insert() and build() returned (), errors logged but not propagated
  3. ef parameter ignored — _ef accepted but not wired to usearch
  4. embed(&mut self) — forces Mutex on all callers

Fixes

  1. ✅ Atomic save — .keys file written via temp + rename (POSIX atomic)
  2. ✅ Error propagation — insert() returns Result<(), Error>, build() returns Result<(), Error>
  3. ⚠️ ef parameter — usearch v2.25.3 Rust bindings dont expose ef in search(). Cannot wire without forking usearch. Left as _ef with TODO.
  4. ⚠️ embed(&mut self) — ONNX tokenizer requires &mut self internally. Architectural limitation. Kept as-is.

What was already fixed (by previous PRs)

  • ✅ HashMap instead of Vec for sparse mapping (done before this PR)

Verification

  • ✅ cargo clippy --all-targets -- -D warnings — clean
  • ✅ cargo test — 107/107 pass

Fixes: #139

@coderabbitai

coderabbitai Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@ajianaz, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 17 minutes and 32 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4f3a79fc-6123-4dfa-a3f4-464a075bef4d

📥 Commits

Reviewing files that changed from the base of the PR and between 9b897af and b6c453d.

📒 Files selected for processing (5)
  • crates/uteke-core/src/import_export.rs
  • crates/uteke-core/src/lib.rs
  • crates/uteke-core/src/maintenance.rs
  • crates/uteke-core/src/memory/vector.rs
  • crates/uteke-core/src/operations.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/139-vector-index-consistency

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-cli · BYOK · MIT

ajianaz added 2 commits June 10, 2026 08:45
- Atomic write for .keys sidecar file (temp + rename)
- insert() now returns Result instead of silently logging errors
- remove() already returned bool — no change needed
- build() now returns Result — callers must handle errors
- All callers updated: operations, maintenance, import_export, lib
- ef parameter: usearch v2.25.3 Rust bindings don't expose ef in
  search() — cannot wire without forking. Added TODO comment.
- embed(&mut self): ONNX tokenizer requires &mut — documented as
  architectural limitation in issue.

Fixes: #139
@ajianaz
ajianaz force-pushed the fix/139-vector-index-consistency branch from 3d6d816 to b6c453d Compare June 10, 2026 01:45
@ajianaz
ajianaz merged commit 38a79c9 into develop Jun 10, 2026
9 checks passed
@ajianaz
ajianaz deleted the fix/139-vector-index-consistency branch June 10, 2026 01:49
ajianaz added a commit that referenced this pull request Aug 13, 2026
…263)

* fix(#139): vector index consistency — atomic save, error propagation

- Atomic write for .keys sidecar file (temp + rename)
- insert() now returns Result instead of silently logging errors
- remove() already returned bool — no change needed
- build() now returns Result — callers must handle errors
- All callers updated: operations, maintenance, import_export, lib
- ef parameter: usearch v2.25.3 Rust bindings don't expose ef in
  search() — cannot wire without forking. Added TODO comment.
- embed(&mut self): ONNX tokenizer requires &mut — documented as
  architectural limitation in issue.

Fixes: #139

* style: cargo fmt
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.

🔧 [P2] Fix vector index consistency and error handling

1 participant