research(nightly): distance-adaptive beam search — REJECT with evidence - #929
Draft
ruvnet wants to merge 2 commits into
Draft
research(nightly): distance-adaptive beam search — REJECT with evidence#929ruvnet wants to merge 2 commits into
ruvnet wants to merge 2 commits into
Conversation
Follow up on ADR-303's untested prior-art citation (arXiv:2505.15636) by implementing the (1+gamma)*d_k relative-distance stopping rule for ANN graph traversal, with baseline/candidate-A/candidate-B variants, a matched-budget control, and a corrected entry-routing scheme (fixes a real cluster-unreachability bug found by the crate's own test suite).
Documents the REJECT verdict with full benchmark evidence: the gamma stopping rule shows real per-query adaptivity (unlike ADR-303's entropy signal) but adapts to local density rather than query difficulty, and misses its own pre-registered matched-budget bar.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hypothesis
ADR-303 (
ruvector-entropy-ann) rejected Shannon-entropy-based adaptive beam-width control for ANNgraph traversal, but its prior-art table cited an untested alternative: the
(1+γ)·d_krelative-distance stopping rule from Distance Adaptive Beam Search for Provably Accurate
Graph-Based Nearest Neighbor Search (arXiv:2505.15636, NeurIPS 2025). This nightly implements and
measures that alternative, on the same dataset/graph construction ADR-303 used, subject to the same
matched-budget-control discipline that caught the entropy signal's flaw.
Pre-registered acceptance (fixed before any run):
for "does it actually adapt."
FixedEf(100)reference on every query set.FixedEfbaseline calibrated (on a disjoint query set) to the sameaverage cost, by ≥ 2 recall points.
Architecture
crates/ruvector-dab-search:FixedEf(baseline),AdaptiveGammauncapped (candidate A),AdaptiveGammacapped (candidate B, production safety bound).(
entry_seeds) — a real bug was found and fixed during development: a single fixed entry pointcannot reach graph components/clusters it isn't connected to (measured 19% recall before the fix).
Benchmark
Real, reproducible numbers (two independent runs matched to printed precision):
vary substantially per query (unlike ADR-303's constant ~124), but in the wrong direction: it
tracks local point density, not task difficulty.
than a plain fixed budget for equal recall, the opposite of the paper's reported 10–50% reduction
(measured on real navigable HNSW graphs over real embeddings — this PoC's flat exact-k-NN graph is
not proven navigable, which is the leading candidate explanation; see ADR-340's Open Questions).
Acceptance Result
REJECT (pre-registered logic: Test 1 or Test 2 failing → REJECT; only Test 3 failing →
INCONCLUSIVE. Test 1 failed outright, so REJECT applies.)
Darwin / Flywheel
No Darwin evolution phase was run (Darwin/MetaHarness CLI tooling was probed —
npx metaharness --helpresolves to the harness-scaffolding generator, not a research-orchestrationAPI for this repo;
npx ruvector harness doctordoes not resolve in this environment) — thiscapability was verified absent rather than assumed. The negative result and its evidence are
retained directly in ADR-340 and the research README as this run's Flywheel-equivalent record,
including the specific mechanism (density vs. difficulty confound) so a future attempt doesn't
rediscover it blindly.
Security Review
No security-relevant surface: benchmark-only crate, no I/O, no network access, no production
integration path, no secrets or external data.
Main Limitations
theorem's precondition) is not verified to hold.
Production Recommendation
Do not adopt in this PoC form. If revisited: test on a real incrementally-built HNSW graph and real
embedding dataset before drawing conclusions about the method itself (see ADR-340's Open Questions
and "If this is ever revisited" sections).
Files
crates/ruvector-dab-search/— implementation, tests (17, all passing), benchmark binarydocs/adr/ADR-340-distance-adaptive-beam-search.md— ADRdocs/research/nightly/2026-08-25-distance-adaptive-beam-ann/README.md— full research reportdocs/research/nightly/2026-08-25-distance-adaptive-beam-ann/gist.md— standalone technical articleCargo.toml/Cargo.lock— workspace member registrationGenerated by Claude Code