Skip to content

fix(reporting): keep benchmark uplift consistent with displayed scores - #269

Merged
rng1995 merged 6 commits into
mainfrom
naren/port-benchmark-uplift-rounding
Nov 3, 2026
Merged

rng1995 merged 6 commits into
mainfrom
naren/port-benchmark-uplift-rounding

Conversation

@rng1995

@rng1995 rng1995 commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

The Results at a Glance table in BENCHMARK.md now shows scores whose uplift always matches the two displayed numbers, and never shows a score in a higher verdict band than the one applied. The public benchmark gate now checks this.

  • Reporter (src/skillevaluator/reporting/benchmark.py):
    • Scores round half-up to one decimal place: 58.4% → 94.8% (+36.4 points).
    • Rounding runs in an isolated decimal context, so the caller's decimal precision or rounding mode cannot change the published numbers. It rounds the score's decimal value, not its binary float value, so 0.5005 shows as 50.1%.
    • A score near a dimension verdict threshold (40% NEUTRAL, 50% PASS) keeps as many extra decimals as it needs to stay in its band. For example, 0.4995 shows as 49.95%, not 50.0%, and 0.49996 shows as 49.996%. Both endpoints of a cell use the same precision.
    • Uplift is the displayed skill score minus the displayed baseline, computed in integer display units. If the two displayed scores are equal, the uplift is ±0.0 points.
    • A score outside 0–1, NaN, infinity or a non-numeric value shows as Not available. A baseline that was recorded but is not a valid score also shows as Not available; before, it was reported as "baseline not run".
    • The existing INCONCLUSIVE: skill never activated; uplift unavailable cell is unchanged, apart from the new score precision.
    • The "How to read this table" text and its example (47.0% → 92.0% (+45.0 points)) describe the new rounding.
  • Gate (scripts/ci/check_public_benchmarks.py):
    • The gate parses the Results at a Glance table with markdown-it, like its other checks. In every body cell, each baseline% → score% (uplift points) transition must have an uplift equal to the exact difference of the displayed scores. A zero uplift must be written as unsigned ±0. Both scores must be within 0–100%.
    • Consistent whole-number cells from earlier releases still pass.
  • Golden cards are regenerated.
  • docs/reports.mdx and docs/benchmark-rollout.mdx describe the precision rule and the new gate check.
  • CHANGELOG entry under Unreleased / Fixed.

Why

The reporter rounded the baseline, the skill score and the raw uplift to whole percent separately. Published cards could therefore contradict themselves:

  • 0.5842 → 0.9479 was shown as 58% → 95% (+36 points).
  • 0.5 → 0.504 was shown as 50% → 50% (+0 points).
  • A NEUTRAL dimension score of 0.4995 was shown as 50%, inside the PASS band. A FAIL score of 0.3995 was shown as 40%, inside the NEUTRAL band.
  • Out-of-range values were published as-is. For example, 0 → 1.5 was shown as 0% → 150%.

Readers check these cards by hand, so a cell that does not add up, or a score shown in the wrong band, makes the whole card look wrong.

Cards rendered by earlier releases may now fail the gate. This happens when their whole-number rounding produced a contradiction or a signed zero such as +0 points. Regenerating those cards fixes them, and the rollout runbook says so.

Kept from public

  • The never-activated cell. Public's skill_never_activated branch keeps its wording. The baseline is still ignored there: it does not set the precision and does not hide the score.
  • The gate's structural parsing. The new check uses public's markdown-it sections and its rendered-text normalization (_section_occurrences, _inline_visible_lines, _semantic_text). So it also catches an ASCII ->, an HTML →, a Unicode minus, or extra-long decimals that could otherwise hide a mismatch.
  • Only reporter-written cells are checked. The check covers Results at a Glance body cells only. Finding messages, agent labels and other untrusted text elsewhere on the card cannot trip it. Public's reporter rewrites untrusted text that could trip other gate rules, and this scoping keeps that guarantee for the new rule.
  • Existing gate rules are unchanged. That includes the legacy ambiguous uplift rule. The new check does not require one exact cell grammar, so other cell forms do not need gate changes.
  • Tier 3-scoped cards. tier3-benchmark.md uses the same Results at a Glance renderer, so its cells get the same rounding. Its completed-agent summary lines (score and same-agent lift) are unchanged.
  • Verdict thresholds come from constants.py. The band check uses DIMENSION_VERDICT_PASS_THRESHOLD and DIMENSION_VERDICT_NEUTRAL_THRESHOLD, the same constants that compute the dimension and overall verdicts.

Not included: the "baseline ran, but no comparable score was available" wording and any plugin-card transitions. Open PR #28 adds its own missing-baseline wording and the plugin card. When PR #28 is rebased, its new f"{score:.0%}" cells and its _format_points(lift) calls need to switch to these helpers. _format_points now takes displayed integer units and a number of decimal places.

Tests

The new tests fail on unmodified main. I ran them against current main code: 45 fail.

  • tests/golden/test_benchmark_card.py:
    • Displayed-endpoint arithmetic: 58.4% → 94.8% (+36.4 points), the reverse case, the rounding carry 50.0% → 70.1% (+20.1 points), and half-up ties (0.5005, 0.1235).
    • Signed and unsigned zero, -0.0, and equal displayed endpoints from different raw values.
    • Threshold-adjacent scores: 49.95%, 49.996%, 39.95%, 39.996%. A score exactly on a threshold keeps one decimal.
    • Invalid raw scores: out of range, NaN, infinity, bool, string.
    • The never-activated cell.
    • An end-to-end card with threshold-adjacent dimensions that passes the gate.
    • Isolation from the ambient decimal context (precision 2, ROUND_DOWN).
    • A property test over 2,144 baseline/score pairs (edge values plus seeded random ones). Every rendered cell passes the gate's arithmetic check, and every displayed score stays in its raw score's verdict band.
  • tests/test_public_benchmark_gate.py:
    • Accepts consistent whole-number, one-decimal, threshold-precision, ±0.0, no-baseline, never-activated and Not available cells.
    • Rejects mismatched uplift, including 58% → 95% (+36 points), the ->, → and Unicode-minus forms, and long-decimal forms.
    • Rejects signed zeros, ±0 between different scores, and negative or over-100% scores.
    • Ignores transitions quoted outside Results at a Glance body cells.
    • A real reporter card with 0.5842 → 0.9479 passes the gate.
  • Updated assertions:
    • The golden Overall row and the no-baseline cells.
    • tests/reporting/test_activation_benchmark_html_regressions.py now looks for one-decimal scores.

Results:

  • pytest -n 8 over tests/golden, tests/reporting, tests/evaluation/test_tier3_benchmark_contract.py, tests/test_benchmark_rollout_docs.py, tests/test_benchmark_source_provenance.py, tests/test_public_benchmark_gate.py, tests/test_publication_evidence.py, tests/test_publication_identity.py, tests/test_cli.py, tests/test_commands.py, tests/test_base_install.py, tests/test_harbor_environment_contract.py, tests/test_harbor_runtime_skill_isolation.py, tests/validators/test_base.py, tests/test_oss_packaging.py, tests/test_ci_change_classifier.py and tests/test_tier3_progress.py: 2990 passed, 5 skipped.
  • scripts/ci/check_public_benchmarks.py --require-files tests/golden --require-source-provenance passes. This is the same command CI runs.
  • ruff check passes on all changed Python files.
  • ruff format --check passes on test_benchmark_card.py and test_activation_benchmark_html_regressions.py. benchmark.py, check_public_benchmarks.py and test_public_benchmark_gate.py already fail it on main at unrelated lines. The lines this PR adds are formatted.
  • scripts/check_oss_boundary.py passes.

🤖 Generated with Claude Code

BENCHMARK.md formatted the baseline, the skill score and the raw uplift
separately at whole-percent precision. Rounding them independently could
publish contradictory cells such as `58% → 95% (+36 points)` for
0.5842 → 0.9479, or `50% → 50% (+0 points)`, and could show a
threshold-adjacent score in a higher verdict band than the one applied
(0.4995 displayed as 50%, although it is NEUTRAL). Scores outside 0-1 were
published as-is, and a recorded but invalid baseline was reported as
"baseline not run".

Score cells now round half-up to one decimal place in an isolated decimal
context, add only as many decimals as needed to keep each score in its
dimension verdict band (49.95%, 49.996%), and derive the uplift from the
displayed integer units, so the visible arithmetic is always exact. Scores
outside 0-1 and invalid recorded baselines render as "Not available". The
skill-never-activated cell keeps its existing wording.

The public benchmark gate now checks every score transition in the Results
at a Glance table cells: the uplift must equal the displayed skill score
minus the displayed baseline (an unsigned ±0 for no change), and both
scores must be within 0-100%. Consistent whole-number cells from earlier
releases still pass. The goldens, the "How to read this table" text, the
reports and rollout docs, and the changelog are updated.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Review summary: no findings (no P1/P2/P3).

Checked: half-up rounding in an isolated decimal context, threshold-adjacent precision (band check against the same constants the verdicts use), uplift computed in integer display units, handling of out-of-range/NaN/bool/string scores and invalid baselines, the never-activated cell, the gate's markdown-it body-cell scoping and exact Decimal comparison (including signed zero and >100%), the regenerated golden cards, docs and CHANGELOG placement. No other reporter output formats a score transition.

Local verification (head 64c4e85): ruff check clean; scripts/ci/check_public_benchmarks.py --require-files tests/golden --require-source-provenance passes; pytest tests/golden tests/reporting tests/test_public_benchmark_gate.py tests/test_benchmark_rollout_docs.py tests/test_publication_evidence.py: 1861 passed.

Reviewed with Claude Code.

@rng1995
rng1995 enabled auto-merge (squash) November 2, 2026 20:25

@chrisknvidia chrisknvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I checked the half-up rounding (isolated decimal context, decimal value rather than the float), the threshold-band precision, the uplift computed in integer display units, and the gate's regex and exact-difference check. I also fuzzed about 58k reporter cells (values around 0.4 and 0.5, ties, zero and -0.0, 0 and 1, out-of-range, NaN, bool, strings, huge ints) against the gate and the band rule and found no mismatch, and the regenerated golden cards pass the gate. Nothing blocking.

CHANGELOG.md: kept main's new Fixed entry for the read-only /etc/passwd bind
mount unchanged and placed this PR's BENCHMARK.md score-transition entry after
it in the same Fixed subsection, separated by a blank line as its neighbours are.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rng1995
rng1995 merged commit 8532d57 into main Nov 3, 2026
20 of 21 checks passed
@rng1995
rng1995 deleted the naren/port-benchmark-uplift-rounding branch November 3, 2026 18:19
rng1995 added a commit that referenced this pull request Nov 3, 2026
Conflicted: CHANGELOG.md (Unreleased > Fixed) - kept main's new BENCHMARK.md score-transition entry (#269) unchanged and placed this PR's custom_only entry after it, separated by a blank line.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
rng1995 added a commit that referenced this pull request Nov 3, 2026
Resolve the CHANGELOG.md conflict with #269: keep main's BENCHMARK.md
score-transition entry, then this PR's two Fixed entries.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
rng1995 added a commit that referenced this pull request Nov 6, 2026
* docs(changelog): move entries released in 0.7.0-0.7.2 out of Unreleased

0.7.0 (#314) and 0.7.1 (#327) never cut their sections on main, and 0.7.2
(#335) added its section below the whole Unreleased block, so Unreleased
still listed work that had already shipped.

Place each Unreleased entry under the release that shipped the PR that
added it:

- 0.7.0: the published section from the 0.7.0 tag, verbatim. It already
  holds the six entries that main had filed under 0.6.0, so 0.6.0 again
  matches the v0.6.0 tag, including the original run_config.json entry.
- 0.7.1: #264 #271 #274 #281 #284 #289 #293 #299 #316 #317 #318 #323
  #324 #326 #327, plus the #320 wording of the Windows Git-root entry,
  since #320 changed that 0.7.0 fix in 0.7.1.
- 0.7.2: #263 #265 #269 #270 #276 #279 #287 #290 #296 #309 #328 #330
  merged with the existing #335 entries.

Only post-v0.7.2 entries stay under Unreleased, with one heading per
subsection. Entry text is unchanged, apart from the published tag wording
in 0.7.0 and 0.6.0.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(release): prepare v0.8.0

Set the package, fallback, lock, citation and developer-guide versions to
0.8.0 and move every entry merged since v0.7.2 under
'## 0.8.0 - 2026-11-05', leaving Unreleased empty.

The refusal-fallback documentation test now reads the release section
that names CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK, requires it to be 0.8.0,
and requires exactly one entry there to name the switch.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(release): pin the verified 0.8.0 Tier 1 image and add its CI bundle

Pin onboarding to the Tier 1 image published by the reviewed main revision
55d2d04 in "Build and publish Tier 1 image" run 42158955180:
ghcr.io/nvidia/skillevaluator-tier1@sha256:9d5483243918937be4f2178f74cf7c622a531dee41e3176906994d52fa14950a
(config sha256:d17d6f5105ec5f1bf0cbe4dff0d693aae4ecf01e9c1c6a6ddb7830518acace33).
The workflow and publisher refs both move to 55d2d04.

ci/bundles/0.8.0 mirrors the 0.7.2 bundle. The templates, README and
release.json are the run's github-actions-onboarding artifact and match
ci/render_templates.py output for these pins byte for byte. The scanner
inventory and verification receipt come from the build's runtime-stage
version step, the five-case smoke receipt, the onboarding job's anonymous
pull, and the public manifest, whose config digest equals the smoke-tested
image ID. The ZIP uses the 0.7.2 layout (sorted members, inner checksums,
1980 timestamps, 0644, deflate level 9) and rebuilds to identical bytes.

Point the current-bundle links at 0.8.0 and list 0.7.2 as historical.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>

---------

Signed-off-by: Narendran Raghavan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

2 participants