Skip to content

fix(core,delta-core): upsert without HNSW ghosts, reject NaN/Inf, real no_std delta-core - #1443

Merged
ruvnet merged 1 commit into
mainfrom
fix/retrieval-correctness-nostd
Nov 9, 2026
Merged

ruvnet merged 1 commit into
mainfrom
fix/retrieval-correctness-nostd

Conversation

@ruvnet

@ruvnet ruvnet commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #1310
Fixes #1313
Fixes #1239

ruvector-core 2.5.1: retrieval correctness (#1310, #1313)

Qualified on current main (1b3e11d) before changing anything, with crates/ruvector-core/tests/retrieval_correctness.rs:

Check (10k × 32-D, HNSW and flat) main this PR
Filtered top-10 is full at 1% and 10% selectivity pass (already fixed by #1368) pass
Re-inserting an existing ID is an upsert with no ghost fail: ghost of v0 at old position, score 0 pass
NaN / ±Inf rejected on insert, insert_batch, search fail: insert accepted NaN pass
  • Duplicate ID means upsert. One live row; the old HNSW node becomes a tombstone. HnswIndex::add/add_batch now drop the superseded node's reverse mapping. Unfiltered search also accepts only an ID's live node, which covers snapshots written by older versions. This replaces the reject semantics proposed in draft fix(core): reject nonfinite vectors and duplicate IDs before index mutation #1316, which is superseded.
  • Non-finite input is rejected at the VectorDB boundary with InvalidInput. insert_batch validates the whole batch before storage, so a bad row leaves storage untouched.
  • The filtered-search contract stays locked in by the new test plus tests/filtered_search.rs. Both now run on every PR in regression-guard (ruvector-core-retrieval-correctness).

npm level: npm/packages/core/test-retrieval.js runs the same contract through the native binding.

  • Published @ruvector/core@0.1.37, installed in a fresh temp dir: filtered top-10 passes; FAIL upsertWithoutGhosts: hnsw=true: ghost of v0 at its old position; FAIL rejectsNonFinite: ... insert accepted NaN.
  • A ruvector-node binding built from this branch, dropped into the same install: retrieval correctness: all passed.

The npm release of this fix goes through the attested protected-release.yml (round 4). @ruvector/core 0.1.38 built from before this merge will not contain it.

ruvector-delta-core 0.1.1: real no_std (#1239)

  • Dropped the dependencies the crate never used: parking_lot, bincode, thiserror, arrayvec, serde_json.
  • serde is now no_std + alloc; compression and simd imply std.
  • vec! and sqrt work without std (alloc macro_use, libm).
  • cargo build -p ruvector-delta-core --no-default-features [--features serde] --target thumbv7em-none-eabihf now succeeds. The no_std dependency tree is libm and smallvec only. On main it failed with can't find crate for std.
  • Added a regression-guard job (ruvector-delta-core-no-std) for this build.

Test plan

  • cargo test --release -p ruvector-core: all suites pass (lib 289 passed)
  • cargo test -p ruvector-delta-core --all-features: 31 passed
  • no_std builds for thumbv7em-none-eabihf (with and without serde)
  • cargo check on the delta-core dependents (delta-index/consensus/graph/wasm, mcp-brain-server)
  • cargo test -p ruvector-node --lib
  • cargo clippy clean for both crates
  • cargo publish --dry-run for both crates
  • npm-level test against the published 0.1.37 (fails as expected) and against the patched binding (passes)

Note for reviewers

Open PR #1435 also edits crates/ruvector-core/src/index/hnsw.rs (#1161 live identities). Whichever PR merges second needs a rebase.

🤖 Generated with claude-flow

…ectors, real no_std delta-core

ruvector-core 2.5.1 (#1310, #1313), qualified on main 1b3e11d:
- Filtered top-k already full at 1%/10% selectivity on 10k vectors (#1368);
  locked in by tests/retrieval_correctness.rs.
- Re-inserting an existing id left the old HNSW node mapped to the id, so the
  old vector answered queries (ghost). add/add_batch now retire the old node,
  and unfiltered search only accepts an id's live node.
- NaN/±Inf vectors were accepted. VectorDB::insert, insert_batch (whole batch,
  before storage) and search now reject them with InvalidInput.
- npm/packages/core/test-retrieval.js runs the same contract through the
  native binding (fails on published @ruvector/core 0.1.37, passes on a
  binding built from this tree).

ruvector-delta-core 0.1.1 (#1239):
- Drop unused parking_lot, bincode, thiserror, arrayvec, serde_json.
- serde is no_std+alloc; compression and simd imply std.
- vec!/sqrt work without std (alloc macro_use, libm).
- regression-guard builds it for thumbv7em-none-eabihf.

Co-Authored-By: claude-flow <ruv@ruv.net>
@ruvnet
ruvnet merged commit b59a81a into main Nov 9, 2026
69 checks passed
ruvnet added a commit that referenced this pull request Nov 9, 2026
release: @ruvector/core 0.1.38 + platforms 0.1.35 in one attested protected release (#1299, #1384, #1443)
ruvnet added a commit to rudycelekli/RuVector that referenced this pull request Nov 10, 2026
…ected release)

- @ruvector/core 0.1.38 pins ruvector-core-* 0.1.35. The committed core
  binaries (bot commit debd3ca) are built from b59a81a: ruvnet#1299 (HNSW
  small graphs), ruvnet#1384 (baseline aarch64) and ruvnet#1443 (upsert without ghosts,
  NaN/Inf rejection). Gate: every binary built from >= b59a81a; linux
  x64/arm64 GLIBC_2.34; arm64 LDAPR 0 (0.1.34: 2,524); test.js and
  test-retrieval.js pass on x64 and on arm64 under qemu -cpu cortex-a72
  (0.1.34 arm64 dies with SIGILL there).
- regression-guard optional-deps-resolvable-on-npm: a core pin that equals
  the exact version in npm/core/platforms/* is co-released by
  protected-release.yml (platforms first) and cannot be on npm before the
  merge it is cut from; it is noted instead of failing. Any other
  unpublished pin still fails (checked locally with a 0.1.99 pin).
  Platforms and core now ship in one attested release instead of a
  hand-published platform step (ruvnet#1250).
- protected-release runtime grader also runs test-retrieval.js against the
  sealed install.

Co-Authored-By: claude-flow <ruv@ruv.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant