Commit e0b8c84
committed
tests: tighten three thresholds with empirical calibration
Each new bound was probed against the actual test landing zone before
tightening (one regression-test cycle per change), per the calibration
discipline. Two findings the agent flagged were verified unfounded
and left as-is.
tests/adsampling_regression.rs::adsampling_l2_recall_matches_hnsw
Replaces the HNSW-as-oracle comparison with brute-force ground truth
in doc_id space. The original input array is still in scope and was
added with doc_ids = 0..n in insertion order, so vectors[i*dim..]
maps directly to doc_id i. This avoids the previous "we don't have
the internal->doc_id mapping" workaround that compared ADSampling
to HNSW (a correlated oracle: both share the graph, so they tend to
be wrong together; a graph-traversal regression in the shared path
passes the assertion). Floor at 0.5 to accommodate HNSW's own
imperfect recall at these parameters.
tests/correctness_regression.rs::nsw_recall_oracle
Tightens the recall floor from 0.6 to 0.9. Empirical avg recall@5 at
the test parameters (n=200, dim=16, m=16, ef_construction=50,
ef_search=50) is 1.0; the 0.9 floor gives 10pp slack but catches a
regression that drops recall from ~1.0 to ~0.85 (40pp below the
prior threshold). Floor was probed via a one-shot example before
tightening; that probe was discarded.
tests/opq_vs_pq.rs::opq_does_not_degrade_on_uncorrelated_data
Tightens the OPQ-vs-PQ MAE ratio ceiling from 3.0x to 1.5x.
Empirically OPQ on this fixture lands at ~0.97x PQ MAE (Procrustes
finds a near-identity rotation; codebook re-fit is mildly
beneficial). The previous 3x slack would pass even when a broken
Procrustes solve returned codes 2-3x worse than PQ -- exactly the
bug class the test names. Probed and verified to pass at the
current implementation.
tests/recall_ground_truth.rs::ivf_pq_recall_vs_brute_force
Floor kept at 0.20. Probed empirical recall is 0.21 at the test
regime (N=300, DIM=32, num_codebooks=4, codebook_size=16, nprobe=4
full coverage). 4 codebooks * 16 centroids over 8-d subspaces with
300 training vectors is a high-quantization-error regime; the floor
is not paper-grounded but it is calibrated to the empirical landing
zone. Tightening without expanding the parameters would risk CI
flakiness on within-seed variance. Comment now states this honestly
rather than passing the threshold off as a tuned bound.
scann_recall_oracle (correctness_regression.rs:498-): Track F flagged
this for a possible MIPS-vs-cosine metric mismatch. Verified the
IVFAVQIndex::search uses dot product with descending sort
(src/ivf_avq/search.rs:220-224), which matches the test's negated-dot
oracle. No change needed; finding was unfounded on inspection.1 parent 28262b2 commit e0b8c84
4 files changed
Lines changed: 47 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
240 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
241 | 247 | | |
242 | 248 | | |
243 | | - | |
| 249 | + | |
244 | 250 | | |
245 | 251 | | |
246 | 252 | | |
247 | 253 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
| 254 | + | |
253 | 255 | | |
254 | | - | |
| 256 | + | |
255 | 257 | | |
256 | 258 | | |
257 | | - | |
258 | | - | |
| 259 | + | |
259 | 260 | | |
260 | 261 | | |
261 | 262 | | |
262 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
263 | 269 | | |
264 | | - | |
265 | | - | |
| 270 | + | |
| 271 | + | |
266 | 272 | | |
267 | 273 | | |
268 | 274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
279 | 285 | | |
280 | | - | |
281 | | - | |
| 286 | + | |
| 287 | + | |
282 | 288 | | |
283 | 289 | | |
284 | 290 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
229 | 237 | | |
230 | | - | |
231 | | - | |
| 238 | + | |
| 239 | + | |
232 | 240 | | |
233 | 241 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
340 | 349 | | |
341 | 350 | | |
342 | 351 | | |
| |||
0 commit comments