Skip to content

feat: golden eval sets, store benches, batched rescore, greedy HyDE - #1

Merged
Verdenroz merged 7 commits into
mainfrom
feat/eval-sets-and-store-perf
Sep 4, 2026
Merged

Verdenroz merged 7 commits into
mainfrom
feat/eval-sets-and-store-perf

Conversation

@Verdenroz

@Verdenroz Verdenroz commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Description

The ranking pipeline had no checked-in golden set and no benchmark below the chunker, so nothing measured whether a search change helped. This adds eval sets for three repos, a multi-run eval report that prints the noise floor, and soothfast coverage of dense, lexical, and fused search. Two things fell out of measuring: the coarse rescore was slower than exact search at 22k chunks, and HyDE was sampling, which made every HyDE number a single draw.

Changes

  • Added eval/scry.toml, eval/finance-query.toml, and eval/soothfast.toml, written from docs and identifiers rather than search output.
  • Added --runs N and --limit N to scry eval, with per-case ranks side by side and the recall/MRR spread across runs.
  • Added bench_dense_search, bench_lexical_search, and bench_search_with_vector at 2k and 16k chunks, plus examples/refiner_curve.rs for coarse-pass recall against exact KNN on a copy of a live index.
  • Rescored coarse candidates with one KNN query using a rowid IN set instead of one point lookup per candidate. hydrate_chunks batches the same way and errors on a missing id.
  • Set temperature to 0 on chat completions and capped HyDE at 120 tokens.
  • Added synchronous=NORMAL, busy_timeout, cache_size, and mmap_size pragmas, FTS optimize and PRAGMA optimize at graceful shutdown, and VACUUM after prune. guard_meta now runs before migrate.

Testing

  • cargo test --workspace: 57 passed, 0 failed. cargo clippy --workspace --all-targets -- -D warnings clean.
  • Eval on one index copy, evals run one at a time, HyDE off: scry 0.762 / 0.485, finance-query 0.667 / 0.495, soothfast 0.567 / 0.364, all with zero spread across three runs.
  • Greedy HyDE with Qwen3.5-2B, hyde = auto, three runs: scry 0.746 / 0.515 with zero spread, finance-query 0.700 / 0.556-0.564, soothfast 0.650-0.667 / 0.395-0.412, p50 1.8-2.4s.
  • gate.yml will report the three new benches as new rather than regressed, since they have no prior baseline.

- Expectations are written from docs and identifiers, never from search
  output, so the sets cannot tune the ranker to itself
- --runs N prints per-case ranks side by side plus the recall/MRR spread,
  the noise floor any ranking change must clear
- Baselines reset: these sets are not comparable to earlier numbers
- dense, lexical, and fused search were unmeasured; the gate now
  covers them at 2k and 16k chunks so E1/E2 changes cannot regress
  silently
- refiner_curve sweeps coarse_k against exact KNN on a copy of a live
  index, excluding each query's own chunk from both lists
- The float rescore ran one point lookup per candidate (400 per query)
  and was slower than exact search at 22k chunks: 187ms vs 64ms
- vec0 accepts a rowid IN set on a KNN query, so the rescore is now a
  single vector-native query: 54ms at coarse_k 400, recall 0.995
- hydrate_chunks batches the same way and keeps candidate order
- synchronous=NORMAL under WAL trades the last transactions on power
  loss for fewer fsyncs; the index is rebuildable from the repos
- FTS optimize costs 277ms on 22k chunks and VACUUM 1.2s, so they run
  only at graceful shutdown and after a prune, never per sync
- Model/dim guard now runs before migrate, so a mismatched file is
  refused untouched
- Sampling made every HyDE eval a single draw; at temperature 0 the
  2B auto arm repeats bit-for-bit (scry 0.746/0.515 x3, finance-query
  0.700/0.556-0.564, soothfast 0.650-0.667/0.395-0.412, p50 1.8-2.4s)
- The prompt asks for a short snippet; 120 tokens keeps p95 under the
  6s budget on a CPU-bound 2B generator where 220 did not
@Verdenroz Verdenroz changed the title feat/eval sets and store perf feat: golden eval sets, store benches, batched rescore, greedy HyDE Sep 4, 2026
@Verdenroz
Verdenroz merged commit 08c82b0 into main Sep 4, 2026
2 checks passed
@Verdenroz
Verdenroz deleted the feat/eval-sets-and-store-perf branch September 5, 2026 22:02
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.

1 participant