Repository navigation
Description
Goal
Eliminate silent underfill and integrity ambiguity in RuVector retrieval, with version-bound regression evidence.
Provenance and scope
The retained 24 October 2026 CPU comparison (Titan Vector vs RuVector, prepared 2 November) measured 10,000 vectors per fixture. At 10% and 1% eligible selectivity, each tested older RuVector core flat/HNSW configuration returned fewer than the requested eligible top 10 on 7,200/7,200 queries. No wrong-namespace IDs were observed. Tested npm identities: ruvector 0.3.3 / @ruvector/core 0.1.33 / Linux native 0.1.31; separate repository binary c44d733. These are historical results, not verification of today's npm release.
Current repository inspection (2026-11-02):
crates/ruvector-core/src/vector_db.rsstill calls index.search_ef(k), enriches metadata, then filters, without replenishing the requested k. The Turbo4 branch also truncates to k before filtering. This is an independently visible code path, not proof that the older native binary contains precisely the same bytes.crates/ruvector-core/src/advanced_features/filtered_search.rshas fixed 1.5x/2x overfetch and can underfill selective predicates; it is a separate public helper, not necessarily active in Node VectorDB.- The historical report also records duplicate-ID score/vector mismatch and non-finite input acceptance in older binaries. Related work already exists: ruvector-py 0.1.0 tester feedback: recall claim at D=128, NaN accepted, duplicate ids, error messages #1134 (Python, closed), Sweep: 91 panicky float sorts (
sort_by(partial_cmp().unwrap())) across 27 crates — NaN-reachable in core query paths (ADR-340 invariant 1) #931 (float sort safety, open), ruvector-router-core HNSW: search returns 0 results from inserted vectors at scale (recall@1 << 1.0) #430 (router HNSW, closed), and fix(python): enforce LlamaIndex query restrictions and empty-field filters #1150 (LlamaIndex filtered top-k, open). Do not duplicate those fixes or conflate APIs.
Work packages
- P0: core VectorDB filtered top-k contract. Guarantee the complete eligible top
min(k, eligible_count)for exact flat retrieval. Prefer a clearly documented correctness-first route, with bounded behavior, exact distance oracle, deterministic tie handling, and no unfiltered regression. Separate quantitative/performance optimization after correctness is proven. Do not advertise HNSW-filtered recall as exact unless explicitly reranked against the full eligible set. - P1: duplicate ID mutations. Reproduce on HEAD across flat/HNSW and Node binding; define explicit upsert or reject semantics, and ensure returned vector and score always refer to the same revision. Avoid implicit mutation across persistence/index boundaries. Link any existing fix.
- P1: non-finite input checks. Audit insert, batch, search and persisted restored data across public bindings; reject NaN/±Infinity before mutation and distance sorts; fold into Sweep: 91 panicky float sorts (
sort_by(partial_cmp().unwrap())) across 27 crates — NaN-reachable in core query paths (ADR-340 invariant 1) #931 where relevant. - Regression and benchmark matrix. Corpus sizes 10K/100K/1M; dimensions 128/384/768; selectivity 1%/10%/100%; flat and HNSW; warm/cold, update/delete/restart, concurrent reads. Measure recall@10, complete eligible top-k, namespace validity, p50/p95/p99, build and memory. Compare identical work and latest published vs source binary.
Acceptance criteria
- With >=10 eligible entries: all 10 returned, unique, allowed namespace IDs, correctly scored and ordered; with <10: return exactly eligible_count.
- Exact filtered flat path recall@10 = 100% against an independent distance oracle (including boundary ties).
- Duplicate-ID insert/update either rejects with no side effects or enforces deterministic upsert with matching vector/score in storage and ANN.
- NaN/Infinity inputs produce a typed error with no persisted mutation; non-finite scores never reach result sorting.
- Preserve unfiltered behavior, demonstrate CI + isolated tests + before/after benchmark and label all untested environments explicitly.
Execution policy
Use small linked PRs, tests first, no claim of production readiness from source inspection, no automatic merge until matching performance/security review. This issue tracks the gap; individual PRs must state exactly which public path they fix.
Activity
fix(core): refill selective filtered top-k from exact eligible candid…
ruvnet commentedon Nov 2, 2026
Execution progress, 2026-11-02
P0 core filtered path implemented in draft PR #1311, commit
bd73ee8a. It adds exact eligible fallback on underfill and two regression tests. Hosted CI triggered; no Rust passing result claimed until checks finish.Additional issue/PR triage to avoid duplicate fixes:
sort_by(partial_cmp().unwrap())) across 27 crates — NaN-reachable in core query paths (ADR-340 invariant 1) #931 is the wider unresolved nonfinite sort audit; fix(rvf-cli): refuse non-finite queries, name error codes, verify-witness exits non-zero on failure #1280 addresses RVF CLI query inputs. Keep the accepted-input contract coordinated; do not duplicate these patches.Next gate: CI for #1311, benchmark correctness fallback at 10K/100K/1M with selectivity 1%/10%, and decide whether to replace O(N) scan with indexed exact prefilter before enabling in latency-sensitive production. Historical 2026-10-24 comparison tested older npm native bytes; an updated source commit does not establish a new published binary result.
fix(node): reject malformed filter and metadata JSON instead of dropp…
ruvnet commentedon Nov 2, 2026
Progress: draft PR #1312 fixes the separate Node JSON boundary problem. It now rejects malformed search filters and insert metadata instead of silently dropping either field. This is independent of the filtered top K correction in draft PR #1311. Both require hosted CI and a pinned native binding test before release.
ruvnet commentedon Nov 2, 2026
Integration review: #1161, #1167 and #1150 currently report mergeable=false, so treat those existing fixes as unresolved until conflicts are handled and tests rerun. #1078 reports mergeable=true but remains open. None should be called a shipped fix yet.
test(core): cover selective HNSW filtered top-k refill (#1310)
fix(node): reject malformed filter and metadata JSON instead of dropp…
fix(node): reject malformed filter and metadata JSON instead of dropp…
perf(core): filter-aware HNSW search (ACORN-style) + fail-closed filt…
ruvnet commentedon Nov 9, 2026
Fixed by #1443 (merge b59a81a) and published as ruvector-core 2.5.1 on crates.io.
Qualified on main (1b3e11d) before the fix, with the new
crates/ruvector-core/tests/retrieval_correctness.rs(10k × 32-D, HNSW and flat):ghost of v0 at old position, score 0insert accepted NaNDuplicate-ID semantics are upsert: one live row, and the superseded HNSW node becomes a tombstone that can no longer answer for the ID (this also covers snapshots written by older versions). Non-finite vectors get
InvalidInput. Both contracts, plustests/filtered_search.rs, now run on every PR (regression-guard/ruvector-core-retrieval-correctness).npm level (
npm/packages/core/test-retrieval.js, the same contract through the native binding):@ruvector/core@0.1.37, fresh install: filtered top-10ok;FAIL upsertWithoutGhosts: hnsw=true: ghost of v0 at its old position;FAIL rejectsNonFinite: … insert accepted NaN.retrieval correctness: all passed.From crates.io, in a fresh project depending on
ruvector-core = "=2.5.1":The npm build of
@ruvector/corethat contains this fix comes next through the attested release workflow. Releases built before b59a81a (including the in-flight 0.1.38 platform build) do not include it. I'll note the version here once it's out.fix(core,delta-core): upsert without HNSW ghosts, reject non-finite v…