Skip to content

Name the quality-gate policies and show a 0.07 drop fail - #3

Merged
Shuvam1024 merged 5 commits into
mainfrom
shuvam1024/gate-demo-non-inferiority-4e64
Oct 7, 2026
Merged

Shuvam1024 merged 5 commits into
mainfrom
shuvam1024/gate-demo-non-inferiority-4e64

Conversation

@Shuvam1024

@Shuvam1024 Shuvam1024 commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Depends on #2. This branch starts at 3053ee5. The gate work is 3279686 and 258ee23. Until #2 merges, the diff against main also contains that SciFact work.

What changed

CI still uses point-drop thresholds. configs/thresholds.yaml and configs/scifact-thresholds.yaml keep gate_on_ci: false. A drop larger than max_drop fails. The support fixture allows 0.02 on MRR, Recall@1, and Recall@3.

gate_mode names two different interval policies. They are not the CI rule.

Mode Decision
point_drop Fail when the point estimate drops by more than max_drop. This is CI.
proven_regression Fail only when the upper confidence bound of (candidate - baseline) is below -max_drop. gate_on_ci: true is the older spelling of this mode.
non_inferior Fail unless the lower confidence bound of (candidate - baseline) is at least -max_drop.

scripts/demonstrate_gate_failure.py lowers the committed support-fixture baseline by 0.07 on those three metrics. ragbench compare against configs/thresholds.yaml exits 2. The script exits 0 when that rejection happens, and writes the metric table to GITHUB_STEP_SUMMARY when that variable is set.

The Actions job Negative control gate runs that script. The happy-path support-fixture and SciFact compares are unchanged and still fail the workflow on exit 2. The negative-control job stays green only because the gate rejected the degraded report.

How to verify

uv sync --frozen --python 3.12 --extra dev --extra api
uv run pytest -q tests/test_comparison.py tests/test_gate_demo.py
uv run python scripts/demonstrate_gate_failure.py results/degraded-baseline.json
uv run ragbench compare --baseline benchmarks/baseline.json \
  --candidate results/degraded-baseline.json \
  --thresholds configs/thresholds.yaml

The script exits 0. The compare command exits 2 and prints FAIL for MRR, Recall@1, and Recall@3.

In Actions, open the Negative control gate job. The step summary has the metric table. The Result column is FAIL under point_drop.

Behavior worth knowing

On this 27-question fixture the 0.07 mean drop is carried by a few questions. The MRR interval is about [-0.177, 0.000]. point_drop fails. proven_regression would pass, because the upper bound is not below -0.02. non_inferior would fail. That is why CI stays on the point estimate: the upper-bound rule does not reject this regression. A 300-query set narrows the same kind of interval. Details are in docs/regression.md.

Shuvam1024 and others added 5 commits October 7, 2026 02:31
The whitespace tokenizer scores SciFact nDCG@10 at 0.643. An optional
stem tokenizer drops a vendored English stopword list and applies the
Snowball English stemmer; on the unchanged test split that reaches
0.683. The default stays whitespace so existing configs and the support
fixture keep their scores.

ragbench dataset --split writes a non-default qrels split beside
benchmark.json instead of replacing it. SciFact train has 809 queries,
so hybrid dense_weight can be chosen there and reported on the 300-query
test set.

pytrec_eval now checks Recall, Precision, MAP, MRR, and binary nDCG on
a fixed fixture. Graded nDCG stays on exponential gain, which matches
pytrec_eval only when every grade is 1.

Co-authored-by: Shuvam Mukherjee <[email protected]>
Chunk size, stemming, and hybrid weight are chosen on the 809-query train
split and committed before the test split is scored again. Document-level
BM25 is the named comparison baseline, not a Pyserini run. NFCorpus is
registered only for a later confirmation. Earlier test-split runs stay
labeled as exploratory, and metric checks now include a pytrec_eval fixture.

Co-authored-by: Shuvam Mukherjee <[email protected]>
The train-selected chunked BM25, document-level BM25, and hybrid systems
were scored once on the SciFact test split and repeated on NFCorpus.
Paired intervals are included. The chunked BM25 edge over document-level
BM25 is small and does not repeat across metrics on NFCorpus. The hybrid
interval stays above zero on both corpora.

Co-authored-by: Shuvam Mukherjee <[email protected]>
point_drop stays the CI rule. proven_regression fails only when the upper
confidence bound shows a drop past the margin. non_inferior fails unless
the lower bound stays inside that margin.
The negative-control script and Actions job expect compare to exit 2 and
write the metric table to the job summary. The workflow stays green when
that rejection happens.
@Shuvam1024
Shuvam1024 marked this pull request as ready for review October 7, 2026 04:48
@Shuvam1024
Shuvam1024 merged commit 04aee2a into main Oct 7, 2026
5 checks passed
@cursor
cursor Bot deleted the shuvam1024/gate-demo-non-inferiority-4e64 branch October 7, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant