Repository navigation
Withhold benchmark comparisons when either arm has unfinished or broken runs - #2219
Harsh-pa-thak wants to merge 4 commits into
Conversation
Validate run health before publishing a paired bench comparison: unfinished items, all-errored repeats, and harness failure receipts count as broken per arm, and a comparison is withheld when the broken share exceeds the per-arm failure limit (default 0.05) instead of emitting accuracy/delta/headline. Wires run-health receipts into locomo_qa, longmemeval, membench, relied_on_sweep and route_replay, documents the limit and its evidence in the benchmark methodology, and adds unit tests for the gate and each harness. Signed-off-by: Harsh Pathak <harphy45@gmail.com>
sync repo
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Hey @zlareb1, thanks for assigning me this issue. I've opened a PR with the implementation, regression tests and methodology updates. I went through the existing benchmark results, but couldn't find enough evidence to establish a reliable default failure threshold. For now, I've set it to 5% and documented the reasoning in the PR. Do you think 5% is reasonable for now, or should we require an explicit threshold? If there are other historical benchmark results I should look at, please let me know. Thanks! |
zlareb1
left a comment
There was a problem hiding this comment.
Rejudging a limited replay withholds valid results. LongMemEval still prints failed runs in the accuracy column after withholding its delta.
| judge_cost += await _judge(rs, by_qid, a) | ||
| results[arm] = rs | ||
| summary = summarize(results) | ||
| summary = validated_summary(results, frozen, a) |
There was a problem hiding this comment.
P2 — Replay a frozen file with two questions using --limit 1, then rejudge the saved output. This passes both frozen IDs to the gate, so it marks the intentionally unselected question unfinished in both arms and withholds a complete comparison. Reuse the saved replay inventory when validating rejudge, and cover a limited replay with healthy rows.
| row["gate"] = g.as_dict() | ||
| row["gate_lines"] = g.lines() | ||
| if g.verdict == "withheld": | ||
| row["delta"] = "withheld" |
There was a problem hiding this comment.
P2 — With one correct baseline row and one treatment row marked item error:, this branch prints a withheld delta but the table still shows 100% versus 0% under judge. The latter is a failed run, so the table still presents the accuracy regression that the gate is meant to withhold. Publish accuracy from the validated pair when it exists and omit accuracy for a withheld pair.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit af73203. Configure here.
| print(" " + line) | ||
| gates = {k: v for k, v in summary.items() if k.endswith("_gate")} | ||
| if any(g["verdict"] == "withheld" or g["excluded"] for g in gates.values()): | ||
| return gates |
There was a problem hiding this comment.
Unjudged replays withhold the summary
High Severity
validated_summary always runs the accuracy gate on _labels_of. An empty verdict (judging disabled, or no reference) normalizes to ERROR, so the arm looks fully broken. The comparison is withheld and the returned summary keeps only gate records, which drops cost, latency, citation, and routing results and skips _print_summary.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit af73203. Configure here.
| print(" " + line) | ||
| gates = {k: v for k, v in summary.items() if k.endswith("_gate")} | ||
| if any(g["verdict"] == "withheld" or g["excluded"] for g in gates.values()): | ||
| return gates |
There was a problem hiding this comment.
Under-limit exclusions drop published reports
Medium Severity
Route replay and LoCoMo discard the outer report when excluded is non-zero, even if the verdict is not withheld. A broken share within --gate-failure-limit is supposed to stay publishable. Route replay then returns only gate dicts, so cost, latency, and routing stats disappear along with the unadjusted accuracy delta.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit af73203. Configure here.


Summary
Addresses #1770.
Previously,
paired_gaterelied on correctness labels without checking whether the underlying benchmark runs completed successfully. As a result, failed ingestion or missing outputs could be interpreted as treatment regressions.This PR adds run-health validation before computing the paired comparison.
Changes
RunHealthandWithheldResultto track unfinished items, broken runs, failure reasons and exclusion counts.--gate-failure-limitto configure the maximum broken-item share per arm.Testing
Added synthetic regression tests covering:
--gateis not enabled.The added fixtures use synthetic data and mocked operations without requiring paid provider calls.
Failure threshold
I went through the available stored benchmark results to investigate a suitable failure limit.
The glossary curation results show a request-level failure rate of 2.11% per arm, while the parser downstream results show failed ingestion affecting 8.02% of queries. These observations use different comparison units and represent different types of failures, so they aren't sufficient to establish a calibrated item-level threshold.
For now, I've used 5% per arm as a provisional default and documented the reasoning, supporting observations and a script to reproduce them in
docs/benchmarks/methodology.md.Unfinished items always cause the comparison to be withheld, regardless of the configured limit.
@zlareb1, I'd appreciate your input here. Would you prefer to keep 5% as a provisional default or require an explicitly specified failure limit until we have enough historical evidence? If there are other stored benchmark results available for calibration, I'd be happy to investigate those as well.
Known limitations
Related: #1459, #1232
Note
Medium Risk
Changes benchmark verdict semantics and CLI output for all gate consumers; incorrect failure classification could wrongly withhold valid comparisons or still allow biased deltas.
Overview
Adds run-health gating ahead of the shared
paired_gatebootstrap so benchmark A/B comparisons are not published when arms are incomplete or too failure-heavy.paired_gatenow builds an item inventory (optionalexpectedkeys plus label maps and harness failure receipts viabroken_a/broken_b), computes per-armRunHealth, and returns awithheldWithheldResult—with health counts and reasons but nodelta_pp, accuracy, or null-band calibration—when any arm has unfinished items, there are no usable pairs, or an arm’s broken share exceeds--gate-failure-limit(default 5%). Healthy runs still compare majority labels but reportexcludeditems dropped from both denominators inGateResultoutput and gate lines.Each harness wires its own receipts (
ingest_errors,item error:rationales, execution/zero-evidence rows, capture errors, request errors) and strips headline compare output when withheld (e.g. LoCoMo compare JSON collapses topaired_by+ gate, route replay’svalidated_summaryreturns gates only, relied-on sweep skipsvs_baselinemetrics). Methodology docs and unit/harness tests document the policy and boundary cases.Reviewed by Cursor Bugbot for commit af73203. Bugbot is set up for automated code reviews on this repo. Configure here.