From dd67adccd920c5c2cfddfed31797a4c4f1fef1c7 Mon Sep 17 00:00:00 2001 From: aaltshuler Date: Sun, 5 Jul 2026 15:22:19 +0300 Subject: [PATCH] fix(bench): honor --baseline in nearest-prefilter Greptile follow-up: the scenario ignored the flag and ran the full query loop, so a baseline/delta pair measured ~0 instead of the queries' memory cost. Baseline now exits after seeding + optimize, matching merge-all-changed's shape. --- crates/omnigraph/benches/scenarios.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crates/omnigraph/benches/scenarios.rs b/crates/omnigraph/benches/scenarios.rs index fb88081f..57b3e11f 100644 --- a/crates/omnigraph/benches/scenarios.rs +++ b/crates/omnigraph/benches/scenarios.rs @@ -487,6 +487,17 @@ async fn nearest_prefilter(args: &Args) -> serde_json::Value { db.optimize().await.expect("optimize"); let optimize_ms = optimize_start.elapsed().as_millis() as u64; + if args.baseline { + // Identical workload minus the measured query loop — see + // Args::baseline (the peak-RSS delta isolates the queries' cost). + return serde_json::json!({ + "seed_ms": seed_ms, + "optimize_ms": optimize_ms, + "hit_rows": hit_rows, + "baseline": true, + }); + } + // Query vector = +e1 (the "miss" cluster's pole): the global ANN top-k is // dominated by non-matching rows by construction. let mut query_vec = vec![0.0f32; args.dims];