recall@10 over all queries
# grade this stage (from your course directory)
npx theinference test --stage recall-eval --watchRun your search over every query embedding, compare each result to gt_knn.json, and average recall@10. This is your end-to-end correctness gate — the proof that your brute force reproduces the exact float64 nearest neighbors.
What to build
Wire the recall eval
In src/eval.ts, implement evalRecall(pack, k): for each query run search(pack.queries.subarray(...), pack.corpus, pack.dim, k), compute recallAtK vs pack.gtKnn[q].slice(0, k), and return the mean. The CLI command eval-recall prints { recall } from it.
export function evalRecall(pack: Pack, k: number): number {
// mean recallAtK over all queries vs pack.gtKnn top-k
}
./your_program.sh eval-recall fixtures/pack # prints {"recall": ...}
process — your printed { recall } is exact-matched to the frozen reference value (atol 1e-6). A correct engine reproduces the exact NN, so the value is 1.000000. The "≥ 0.999" framing you'll hear for real benchmarks lives in the prose; the grade is equality to the reference's deterministic computation.