research: local-min-cut-guided HNSW deletion repair (REJECT — negative result) - #941
research: local-min-cut-guided HNSW deletion repair (REJECT — negative result)#941ruvnet wants to merge 4 commits into
Conversation
Makes the reconnection routine EagerRepair uses pub, so other deletion- strategy experiments can reuse the exact same logic instead of re-implementing it and risking behavioural drift. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01Fq5TBQookSmVsyF9STNiie
Adds ruvector-mincut-repair, composing ruvector-mincut's LocalKCut (arXiv:2510.08297) with ruvector-hnsw-repair's deletion strategies: eagerly repair only nodes whose removal exposes a small local cut in a shadow graph mirroring HNSW level-0 edges, tombstone everything else. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01Fq5TBQookSmVsyF9STNiie
Records a negative result: LocalKCut::find_cut costs 24.8-158.0 seconds per call at HNSW's real construction density (vs. a sub-25%-overhead target), driven by HNSW's small-world topology plus an O(m) edge-lookup defect in LocalKCut::check_cut (localkcut/mod.rs:368). Recommendation: reject for production; the check_cut defect is flagged as separate follow-up work. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01Fq5TBQookSmVsyF9STNiie
|
$(cat <<'EOF' CI status check-in
Why it isn't this PR's: the job logs show it was still mid-compile (60+ crates compiling cleanly, including both crates this PR touches — This same Everything else on this PR is green: all other 60 of 61 check runs completed successfully, including Given the strength of that evidence (11+ independent historical confirmations on Generated by Claude Code |
|
(Correcting a formatting artifact in my previous comment — a stray shell-heredoc wrapper leaked into the posted text. Re-posting clean; no edit tool is available to fix the original.) CI status check-in
Why it isn't this PR's: the job logs show it was still mid-compile (60+ crates compiling cleanly, including both crates this PR touches — This same Everything else on this PR is green: all other 60 of 61 check runs completed successfully, including Given the strength of that evidence (11+ independent historical confirmations on Generated by Claude Code |
ruvnet
left a comment
There was a problem hiding this comment.
Dream evidence review — exact head fd30aa349c2ee8802bf3915ad9422e9bf39c1903
Frozen hypothesis: LocalKCut-guided HNSW deletion repair matches eager-repair recall with less than 25% overhead.
The recorded 3-deletion benchmark rejects the hypothesis: LocalCutGuided takes 318,024.78 ms versus 0.78 ms for EagerRepair, while equal recall is obtained only because cut-guided repair performs no repair. The negative result is valuable and should remain documented.
A separate reachable implementation defect amplifies the result: LocalKCut::check_cut scans/materializes the full edge set for each boundary edge although the graph already maintains indexed lookup. This is now scoped in issue #942 with a seeded correctness benchmark and ≥100× speedup threshold. Fixing that defect must not be used to revive the rejected bounded-locality design without new evidence.
Supply-chain, native, WASM dedup, Clippy, and regression-guard checks pass; the required Workspace CI run was cancelled.
REJECT
A reviewer independently filed #942 for the same check_cut fix this ADR recommended as scoped follow-up work. Link it directly instead of the prior vague "separate nightly" phrasing. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01Fq5TBQookSmVsyF9STNiie
|
Thanks for the evidence review — agrees with this PR's own conclusion, so no code changes needed here. One small doc update pushed (96282d9): both the ADR and the nightly README now link directly to issue #942 instead of the vague "separate nightly" phrasing they had, since #942 already scopes exactly the follow-up this ADR recommended (the To confirm alignment on the CI note: the Generated by Claude Code |
CI status check-in (2)
What failed: Why it isn't this PR's: Re-run: attempted Generated by Claude Code |
Summary
Nightly research run testing whether
ruvector-mincut'sLocalKCut(a real, recent local minimum-cut algorithm, arXiv:2510.08297) could cheaply triage which HNSW deletions needruvector-hnsw-repair's expensiveEagerRepairvs. cheap tombstoning. Result: REJECT, with precise root-cause evidence.LocalCutGuidedRepair(new,crates/ruvector-mincut-repair) should recover most ofEagerRepair's recall at a fraction of its cost, by usingLocalKCut::find_cutto decide per-node whether eager repair is warranted.find_cutcalls took 24.8-158.0 seconds each at the benchmark's real construction density (m0=32) — four to six orders of magnitude over the pre-registered 25%-of-delete-time overhead budget. Three independent runs (an interrupted 1,000-deletion run, an interrupted 12-deletion run, and a completed 3-deletion run) all confirm the same order of magnitude.LocalKCut's bounded-degree locality assumption, and (2) a genuine O(m) implementation defect inLocalKCut::check_cut(crates/ruvector-mincut/src/localkcut/mod.rs:368): it callsgraph.edges()(materializing every edge in the graph) and linearly scans it, instead of the O(1)get_edge(u, v)lookup the graph already provides via itsedge_indexmap.What's in this PR
crates/ruvector-mincut-repair— new crate implementingLocalCutGuidedRepair: DeletionStrategy, its benchmark (4-way comparison againstTombstoneOnly/BatchRepair/EagerRepair), and tests (all passing).crates/ruvector-hnsw-repair—repair_onemadepubso it can be reused directly instead of re-implemented (small, additive, tested).docs/adr/ADR-340-mincut-guided-hnsw-repair.md— full ADR with the rejection rationale, root cause, and a scoped follow-up recommendation (fixingcheck_cut's O(m) lookup is flagged as separate future work, not bundled into this rejected design).docs/research/nightly/2026-08-28-mincut-guided-hnsw-repair/— README (full methodology + raw benchmark output) and gist (standalone write-up).docs/adr/INDEX.md— regenerated vianode scripts/adr-index.mjs.Benchmark command & real results
cargo run --release -p ruvector-mincut-repair --bin benchmarkImportant honesty caveat (detailed in the ADR/README): at
n_delete=3(reduced from the originally-hypothesized 20% because larger runs didn't complete in bounded time — see "How n_delete Was Chosen" in the README), all three deleted nodes were judged "safe" by the cut-finder, so criteria 1 and 2 pass by inaction, not by successfully triaging fragile nodes. Only criterion 3 (a direct wall-clock measurement, sample-size-independent) carries real evidentiary weight, and it fails decisively and reproducibly across all three runs performed.Darwin / Flywheel / MetaHarness
npx metaharnessis installed and was inspected;npx ruvector harnessis not a resolvable package in this environment (recorded, not assumed). No Darwin evolution phase was run — there is no accepted parent candidate to evolve from; the negative result itself is the retained evidence for future nightly runs to avoid rediscovering this dead end.Security / Governance
No new
unsafecode, no I/O, no authorization or provenance surface. N/A for RVF/RVM/MCP/WASM/edge — see ADR and README for the explicit "not evaluated, given rejection" reasoning.Production recommendation
Do not integrate
LocalCutGuidedRepair. Recommended follow-up (separate nightly): fixLocalKCut::check_cut's O(m) edge lookup inruvector-mincuton its own merits (with its own correctness verification), independent of whether cut-guided HNSW repair is ever revisited.Generated by Claude Code