Repository navigation
Move every checker message into a catalog, and clean up the review output - #111
Merged
Merged
Conversation
…tput The wording of every check result now lives in submission_checker/data/messages.yaml: per rule, a title, the spec section and each message as a template, with an optional fix. Code names a rule and a message key and passes the values (err(rule, key, path, **values)). Severity stays in code, beside the rule, so wording can never change a verdict. The catalog ships with the package and changes only with a release. All 196 result sites move over (167 by an AST converter, the rest by hand), plus the sub-problems the power, nodes-used and steady-state rules assemble, via fragment(). Existing wording is kept, so 1 of 1214 existing tests needed updating (band names now read "High Concurrency"). tests/submission_checker/test_messages.py holds code and catalog together: every key used exists, every call passes exactly its template's placeholders, no message is unused, every template renders. The suite runs the catalog in strict mode, so a message that cannot render fails a test; outside tests it degrades to a generic message rather than stopping a check. Review output: - Annotations are titled with the rule's title and section, not the rule id twice; the body adds a Fix: line where the catalog has one. - Tables and the job summary show a Check column (title + rule id) and the fix under the message; identical findings collapse into one row (×N). - Section references use one notation (§5.4, §§3–6). - Accuracy-gate's "no thresholds" warning is reported once per curve, not once per point carrying accuracy (all of which named the first point). - Pydantic field errors read runtime_settings.min_duration_ms, not a tuple. - 29 fixes written for the errors submitters hit most. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The review output for a failing submission looked off: one warning repeated ten times against the wrong file, the rule ID printed twice in every annotation, three notations for spec sections, no guidance on how to fix anything, and wording that drifted because every message was an inline f-string next to its check. This PR moves all wording into a data file and cleans up the output on top of it.
The catalog
src/submission_checker/data/messages.yamlholds, per rule, a title, the spec section, and each message as a template with an optional fix:err("accuracy-coverage", "missing-bands", path, bands=...). Theok/warn/errhelpers render throughsubmission_checker/messages.py.CheckResultgainskey,titleandfix; the JSON report only gains fields.--messagesflag or environment-variable override.str.formatrestricted to plain names.{name!r}and{x:.4f}work;{a.b}and{a[0]}are rejected when the catalog loads._sharedholds the messages several rules emit: file not found, parse errors, Pydantic field errors (nowruntime_settings.min_duration_ms, not a tuple).fragment(rule, key, ...)renders sub-problems for rules that collect several before reporting (power descriptor, nodes used, steady state), so those words live in the catalog too.Migration
All 196 result sites moved over: 167 by an AST converter, the rest by hand, plus 35 sub-problem strings. Existing wording is kept, so wording changes can be reviewed on their own in the YAML. Of 1214 existing tests, one needed updating, because band names now read "High Concurrency".
Keeping code and catalog together
tests/submission_checker/test_messages.pyreads the checker's source and asserts:§section.tests/conftest.pyruns the suite with the catalog in strict mode, so a message that can't render fails the test that produced it. Outside tests it degrades to a generic message rather than stopping a check.Review output
Before → after, on
test_submissions/sub_g:title=submission-checker: model-name-valid::[model-name-valid] … (#3.2)title=Benchmark model name (§3.2)::…plusFix: …r64/results.json(×N),+N morepaths#5.4,#3–6, inline§5.3§5.4,§§3–6Fix hints are written for the 29 failures submitters hit most: directory layout, missing files, model name, region and accuracy coverage,
tps_utilization, shared paths, system-description consistency, the Offline point. The rest can be added in the YAML.Checks
Full suite: 1466 passed (non-integration). ruff and mypy are clean. A wheel built from this branch includes
data/messages.yaml, and the installed CLI renders titles for every result.🤖 Generated with Claude Code