Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Evaluation: golden sets and gates

Source: written from pkgs/atlas-search/eval/ (README.md, eval3.py, gate5733.py, gate-5733-results.md, boundary_drift_6038.py, boundary-drift-6038.md, overlap-experiment.py, overlap-report-6039.md, fixtures/golden-311.json, fixtures/heldout-nearexact-54.json) and pkgs/atlas-search/crates/atlas-core/src/ (eval.rs, feedback.rs, feedback_normalise.rs, trace_stats.rs, shingles.rs) in https://github.com/developing-today/code/blob/main/pkgs/atlas-search/. Provenance only — this chapter is complete without following it.

Atlas makes ranking claims — hybrid beats either branch alone, a rescore helps, a chunking choice is safe — and evaluation is the part of the system whose job is to keep those claims honest. Its shape is deliberately conservative: a golden set (a fixed set of queries, each with judged relevant chunks, called qrels) is scored against saved rankings by an offline harness, and a proposed change earns adoption only by passing a gate: a pre-agreed numeric bar, on a held-out set, measured after the harness has first reproduced a known result exactly. This chapter covers the golden sets, the harness and its split discipline, the gates that have actually run — including the one that failed — and the feedback loop that exists beside them. The retrieval machinery being measured is in Retrieval: hybrid full-text and vector search.

Golden-311 v3: the standing yardstick

The corpus golden set is golden-311 v3: 311 queries, frozen on 2026-10-26, built against the merged corpus in data/atlas.db — 101,471 chunks across 18,116 sessions. The set is guarded by a corpus fingerprint so it can never be silently scored against a different corpus: take the chunks whose id is divisible by 997 (101 chunks), concatenate their content hashes, and SHA-256 the result; the recorded fingerprint begins 07b3e17b and any mismatch aborts the evaluator with exit code 2 before a single query is scored. The set itself is a checked-in fixture, byte-for-byte the v3 golden queries file from the bake-off that chose the production embedding model.

Construction matters for what the numbers mean. Each question was written from a one-to-two-sentence summary of its gold chunk or chunks — recorded on the query as its source summary — not mined by checking a hint string verbatim in the text first. The expected hint was chosen after the question was written and only then verified present. Scoring is by gold chunk ids: a query is a hit when one of its recorded chunk ids appears in the top-k ranked ids, and its reciprocal rank is the position of the first gold id. Queries carry a category (the header names an exact-fact versus non-exact distinction), all their gold chunk ids and session ids including cross-session cases, the originating client, and a verbatim-overlap audit (a 5-gram check) for the non-exact categories. Because questions were written from summaries rather than copied from chunks, golden-311 measures whether search finds the right material for a genuinely rephrased question — the thing agents actually ask.

The held-out 54: verbatim passages on purpose

Golden-311’s discipline has a complement built for a different question: can search surface a chunk when the query is a piece of it? The held-out near-exact set has 54 queries, built 2026-11-17. Its passages are verbatim: walk the corpus chunks whose ids are divisible by 997, in ascending order — the same every-997th sampling spine as the corpus fingerprint — keep chunks with at least 60 normalized tokens and at least 40 raw tokens, take raw whitespace tokens 10 through 40 (a 30-token passage) joined by single spaces as the query, and record the source chunk as the single gold. The first 54 qualifying chunks make the set. It is held out in the practical sense that matters here: it was built for one gate, after the signal it tested was already designed, and its queries test a property — near-exact overlap — that golden-311’s summary-written questions barely exercise.

The harness and split discipline

The Rust harness (atlas_core::eval, format atlas-eval/v1, issue #5741) was built before any new signal was adopted or rejected, so that the ablation matrix — dense alone, BM25 alone, SPLADE alone, dense+BM25 (today’s production shape), dense+SPLADE, all three, each with and without a Jaccard rescore — would be measured, not argued. It scores saved rankings offline against qrels; it generates no rankings itself, measures no latency, and makes no adoption decision. A document is relevant at grade 1 or above (grades are unsigned, capped at 30 because the gain formula is exponential), unjudged documents score zero, and a run that returns nothing for a query is scored as an empty ranking — incomplete runs are penalized, never skipped. Rank order is the whole contract, which is what lets dense, BM25, SPLADE, and fused rankings share one input format.

Per query, then averaged over the queries that have at least one relevant document, overall and per query class, the harness reports four metrics: nDCG@10 (graded gain, exponentially weighted and log-discounted, over the first ten ranks), Recall@100 and Recall@1000 (the fraction of relevant documents inside those depths), and MRR@10 (mean reciprocal rank of the first relevant document in the top ten). Reports are deterministic — sorted signals, queries, and classes, floats rounded to six places, byte-identical for identical input — and each per-query record preserves the run’s top-1000 ids and the judged grades, so any number in a report can be recomputed from the report alone.

The split discipline is the harness’s social contract. Every query belongs to a dev split or a test split. Dev is for iteration and parameter selection. Test is the held-out set: score it once, at decision time. The code enforces the sharpest edge of that rule — the best-signal selector refuses to run on a test-split report at all — because a held-out set consulted repeatedly during tuning quietly becomes a dev set, and its verdict stops meaning anything.

Two “production hybrid” rows, stated honestly

Golden-311 carries two recorded rows that are both labelled the production hybrid, and they do not agree. This book states both, with their configurations, rather than picking one:

RowConfigurationResult on golden-311
Bake-off best row, recorded in the Python reference’s header as the 2026-10-31 production decisionone-stage hybrid, reciprocal rank fusion at k=10, pool 100 per branch189 hits@10, MRR 0.3894
Row reproduced by the gate-5733 sanity check from the fused rerank evaluatorbranch depth 30, reciprocal rank fusion at k=60, query vectors truncated to 384 dimensions183 of 311 at recall@10, MRR 0.3640

These are different configurations, not a measurement error — pool 100 against depth 30, fusion constant 10 against 60, full-width against truncated vectors — both called themselves “production hybrid” and, until the #13283 reconciliation, neither source named the other’s row; the source records now cross-name the two configurations, so each row can be traced to the configuration that produced it. The shipped service’s fusion constant is 10 (the versioned query-parameters contract); the Python eval lineage, including the gate below, fuses at 60. Any future citation of a golden-311 production number that does not name its configuration is incomplete.

Gate 5733: the Jaccard gate, and its FAIL

The Jaccard rescore (issue #5733) proposes a third signal at rescore time only — never at retrieval: token-shingle overlap between query and chunk, computed over the fused candidate union, with a near-exact tier (overlap at or above 0.60) promoted decisively and a standard blend (0.85 of normalized fusion score plus 0.15 of overlap) beneath it. Its held-out gate was pre-agreed: on the held-out 54, near-exact MRR@10 must gain at least +0.10 with the rescore on; on golden-311, nDCG@10 must not regress by more than 0.01. Before any gate number was trusted, the gate’s base pipeline had to reproduce the recorded production-hybrid row exactly — it did, at the depth-30 configuration in the table above (183 of 311, MRR 0.3640). The rescore implementation itself was pinned against the shipped Rust test vectors before measuring. The gate ran on 2026-11-17.

Verdict: FAIL. Near-exact MRR@10 moved from 0.5635 to 0.5997 — a gain of +0.0361 against a +0.10 bar. The general-set guard passed comfortably (nDCG@10 regression 0.0017 against a 0.01 allowance), per-query MRR improved for seven queries and worsened for none, and the gold chunk was already inside the top-100 candidate union for 50 of the 54 queries — retrieval was not the problem. The near-exact tier simply almost never fired: 4 of 54 near-exact queries, 0 of 311 general queries. The recorded diagnosis is geometric, not incidental: a 30-token passage’s shingle set measured against a long chunk’s full shingle set has its overlap capped far below 0.60 by set-size ratio alone, so the signal as designed cannot deliver the required gain at that threshold on real chunk lengths. The consequence stands in the shipped defaults today: jaccard_depth is 0, the rescore is off, and no production ranking change was made. One disclosure belongs with the run: the laptop corpus file used held 101,339 of the frozen 101,471 chunks (132 ids absent, including one gold chunk); every golden-311 query retained other gold chunks and all 311 scored, but a rerun should use a bit-exact frozen corpus.

The boundary-drift and overlap experiments

Two experiments guard the chunking decisions underneath retrieval. Boundary drift (#6038) asks whether a span’s stored vector stays valid when the span is reused inside a new version of its document. It is not: across 50 sampled targets and 20 fixed queries, dropping a single sentence from the preceding paragraph — target byte-identical — flipped top-10 membership for 5.8% of query/target pairs, and replacing one neighbouring paragraph flipped 10.3 to 17.8%. The rule the experiment justifies is absolute: reuse only byte-identical windows; re-embed on any context change, and key stored vectors by the hash of the exact window text.

The overlap experiment (#6039) priced chunk overlap at a fixed 200-word window over prose documents and logs: 0%, 10%, and 20%. Ten percent captured essentially all the measurable boundary-coverage benefit for both source types; 20% cost roughly twelve points more index and embedding than 10% and bought no measurable recall; 0% failed exactly on boundary-straddling passages. The standing answer is 10%, and “do not default to 20%”. Its limits are recorded with it: BM25 only, a small repo slice, and a provisional golden set the script derived from that slice itself — not golden-311 — with reruns owed under the dense signal and the standing qrels when those land.

SPLADE: named, never gated

SPLADE — a learned sparse retrieval signal — appears in the ablation matrix above and as an example signal name in the harness’s documentation. That is the whole of its presence. There is no SPLADE encoder, no postings table, and no SPLADE run anywhere in the repository, and no SPLADE gate has ever run. The gate-5733 verdict explicitly does not transfer: it is a result about raw set-overlap geometry, which neither validates nor undermines the lexical signal family. SPLADE’s adoption decision rests on its own ablation through this harness, whenever the signal exists to be measured.

The truncation caveat

Every gate number above carries a dimension caveat. The eval lineage — eval3.py and the gate-5733 base pipeline — runs its vector branch at trunc-384: query vectors truncated to the first 384 of 768 dimensions and renormalized, a Matryoshka-style width reduction the Snowflake model supports. Production search defaults to trunc 0, the full 768 dimensions. The gate results are therefore 384-dimensional measurements of a system whose shipped configuration is 768-dimensional. They are valid comparisons between the arms of each experiment (both arms share the width), and they reproduced the recorded row they aimed at — but they are not, strictly, measurements of the production configuration, and this book does not present them as such.

Feedback: captured, normalized, and not fed back

Beside the golden sets sits a live signal: feedback capture, format atlas-feedback/v1 (issue #9976). A vote attaches to the (query id, chunk id) pair that identifies a result — never to a rank position, which would rot as rankings change — or, with a null chunk id, to the query as a whole. A record carries an up or down vote, an optional verbatim comment (the field supports at least 64 KiB; the capture ceiling is 256 KiB), whether the result was opened before voting, and the requester (kind: Drew, agent, user, or anonymous, plus an id). Records are append-only JSON lines in daily files under the Atlas state directory, never mutated; a later vote from the same requester on the same result supersedes the earlier one in a derived view, never by rewriting it. A normalization pass (atlas-feedback-normalised/v1) classifies active, commented records into eight categories (wrong content, stale content, right file wrong chunk, ranking too low or too high, missing result, duplicate, other), flags agent self-feedback at weight zero, and weights the rest (Drew and users at 1.0, agents at 0.25, anonymous at 0.1).

And there the signal stops — deliberately, and worth stating plainly: feedback has no ranking consumer. Nothing in the search, fusion, or rescore code reads feedback records. Its consumers are statistics (the weekly trace-and-feedback report, where weighted down-votes can nominate results for human review), retention (feedback references protect traced queries from compaction), and read-back by query and chunk. Feedback can nominate; it cannot re-rank. Closing that loop — letting judged user signal change what Atlas returns — is future design work, taken up in Design: the standing evaluation programme, alongside the standing programme this chapter’s one-off gates point toward.