Skip to content

fix: reject null or non-numeric gated accuracy metrics - #184

Open
anandhu-eng wants to merge 1 commit into
fix/accuracy-non-finite-scorefrom
fix/accuracy-null-named-metric
Open

anandhu-eng wants to merge 1 commit into
fix/accuracy-non-finite-scorefrom
fix/accuracy-null-named-metric

Conversation

@anandhu-eng

Copy link
Copy Markdown
Collaborator

Fixes #178. Stacked on #183.

metric_scores() skips any metric it cannot convert to a number. So "score": {"exact_match": null}, a null metric on a legacy entry with no score key, or a scalar like "N/A" dropped that dataset out of the mean with no error. Only a top-level score: null was reported.

_gate_accuracy now reports each such metric (accuracy-gate / unreadable-metrics, e.g. livecodebench::gptoss (exact_match=null)) and does not compute the aggregate.

Tests:

  • A null named metric (both report formats), a null metric on a legacy entry, and a non-numeric scalar each give one error naming the metric.
  • A null ungated metric and a null legacy bookkeeping field are ignored.
  • A null named inline metric does not block the gate.
  • A unit test for unreadable_metrics().

The four rejection tests fail without the gate change. Full suite: 1,848 passed. Ruff and mypy pass.

🤖 Generated with Claude Code

metric_scores() skips a metric it cannot convert to a number, so
"score": {"exact_match": null}, a null metric on a legacy entry, or a
scalar like "N/A" dropped the dataset out of the mean with no error.
The single-turn gate now reports each such metric when it is gated (a
threshold metric, or the scalar score) and does not compute the
aggregate. Other fields are ignored, since a legacy entry's extra
fields may be bookkeeping. AccuracyResult.unreadable_metrics() shares
the metric lookup with metric_scores().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the change to reject unreadable gated accuracy metrics before aggregation.

No open issues 🎉

What changed in this PR

Addresses #178 by rejecting null or non-numeric gated accuracy metrics before computing an aggregate, preventing datasets with unreadable scores from silently dropping out of the mean.

Changes:

  • Shares metric lookup between numeric score extraction and unreadable-metric detection.
  • Adds an accuracy-gate error for unreadable gated metrics while preserving exclusions for inline entries and ungated fields.
  • Adds regression tests for named, scalar, and legacy metric formats and the intended exclusions.
File Description
tests/​submission_checker/​test_checks_file.py Tests unreadable-metric detection alongside numeric score extraction.
tests/​submission_checker/​test_checks_aggregate.py Tests gate rejection and exclusions across supported report formats.
src/​submission_checker/​models/​file/​accuracy.py Adds unreadable-metric detection using shared metric lookup.
src/​submission_checker/​models/​aggregate/​context.py Blocks aggregation when gated metrics are unreadable.
src/​submission_checker/​data/​messages.yaml Adds the unreadable-metric error and remediation guidance.

Review effort: Balanced

This branch has not been deployed

No deployments
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.

3 participants