Skip to content

research(nightly): distance-adaptive beam search — REJECT with evidence - #929

Draft
ruvnet wants to merge 2 commits into
mainfrom
claude/focused-darwin-8jw932
Draft

research(nightly): distance-adaptive beam search — REJECT with evidence#929
ruvnet wants to merge 2 commits into
mainfrom
claude/focused-darwin-8jw932

Conversation

@ruvnet

@ruvnet ruvnet commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Hypothesis

ADR-303 (ruvector-entropy-ann) rejected Shannon-entropy-based adaptive beam-width control for ANN
graph traversal, but its prior-art table cited an untested alternative: the (1+γ)·d_k
relative-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):

  1. Per-query cost must vary more on hard queries than easy queries (ratio ≥ 1.15) — the direct test
    for "does it actually adapt."
  2. Recall within 3 points of a high-recall FixedEf(100) reference on every query set.
  3. On hard queries, beat a FixedEf baseline calibrated (on a disjoint query set) to the same
    average cost, by ≥ 2 recall points.

Architecture

  • crates/ruvector-dab-search: FixedEf (baseline), AdaptiveGamma uncapped (candidate A),
    AdaptiveGamma capped (candidate B, production safety bound).
  • Same flat k-NN graph construction as ADR-303, but with a corrected entry-routing scheme
    (entry_seeds) — a real bug was found and fixed during development: a single fixed entry point
    cannot reach graph components/clusters it isn't connected to (measured 19% recall before the fix).
  • Zero external dependencies, deterministic fixed-seed dataset generation throughout.

Benchmark

cargo test --release -p ruvector-dab-search      # 17/17 pass
cargo run --release -p ruvector-dab-search --bin benchmark

Real, reproducible numbers (two independent runs matched to printed precision):

Query set FixedEf(50) recall FixedEf(100) recall Adaptive(γ=0.5) recall Adaptive mean dist_comp
easy 0.811 0.846 0.903 346.7 (sd 153.6)
hard 0.706 0.722 0.756 317.3 (sd 130.4)
mixed 0.635 0.663 0.678 291.5 (sd 95.7)
  • Test 1 (adapts per query): FAIL. hard/easy cost ratio = 0.915 (needed ≥1.15) — the rule does
    vary substantially per query (unlike ADR-303's constant ~124), but in the wrong direction: it
    tracks local point density, not task difficulty.
  • Test 2 (recall floor): PASS on all three query sets.
  • Test 3 (matched-budget crux test): FAIL, narrowly. +0.014 recall advantage vs required +0.02.
  • Headline (cost at matched recall, the source paper's own metric): -6.6% — needs more work
    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 --help resolves to the harness-scaffolding generator, not a research-orchestration
API for this repo; npx ruvector harness doctor does not resolve in this environment) — this
capability 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

  • Single synthetic dataset (N=2,000, dim=16, 10 clusters); no real embedding benchmark this run.
  • Flat exact-k-NN graph, not an incrementally-built HNSW/Vamana graph — navigability (the source
    theorem's precondition) is not verified to hold.
  • Single hardware configuration; no SIMD/multi-thread path measured.

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 binary
  • docs/adr/ADR-340-distance-adaptive-beam-search.md — ADR
  • docs/research/nightly/2026-08-25-distance-adaptive-beam-ann/README.md — full research report
  • docs/research/nightly/2026-08-25-distance-adaptive-beam-ann/gist.md — standalone technical article
  • Cargo.toml / Cargo.lock — workspace member registration

Generated by Claude Code

claude added 2 commits August 25, 2026 07:42
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.
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.

2 participants