Skip to content

fix: count unscored reward components as zero in rollout metrics - #3182

Merged
mikasenghaas merged 5 commits into
mainfrom
fix/unscored-rewards-aggregation
Aug 3, 2026
Merged

fix: count unscored reward components as zero in rollout metrics#3182
mikasenghaas merged 5 commits into
mainfrom
fix/unscored-rewards-aggregation

Conversation

@mikasenghaas

@mikasenghaas mikasenghaas commented Aug 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Companion to feat: seed unscored rewards/metrics as None placeholders verifiers#2235: scoring now seeds every expected reward/metric name with None before invoking it, so a scoring failure leaves seeded-unscored entries ({"solved": null}) instead of an empty dict.
  • CustomMetrics counts unscored (None) reward and metric entries as 0.0. Previously scoring-failed traces silently dropped out of all/rewards/<name>/mean and all/metrics/<name>/mean, making the all subset collapse onto effective — while all/reward/mean counted the same traces as 0, so the views couldn't be reconciled. Now all is the raw view including failures as zeros, and effective (which excludes errored rollouts) is the clean view.
  • Cross-env agg pools need no special handling: another env's unscored traces carry their own env's keys, so they can't dilute a different env's means.
  • Bumps deps/verifiers to the seeding commit.

Uncovered on scaleswe_v1 SWE-bench Verified evals. Linear: RES-1210

Breaking

  • {train,eval}/*/all/{rewards,metrics}/<name>/* wandb series change meaning: traces whose scoring failed after seeding now count as 0.0 for each expected key (previously they were silently excluded, so all matched effective). effective subsets are unchanged.

Verification

uv run pytest tests/unit passes against the bumped submodule; test_nested_metrics_and_rewards covers the new semantics (unscored entries → 0.0 in all, dropped from effective; cross-env isolation).

🤖 Generated with Claude Code


Note

Medium Risk
Changes the meaning of existing all/{metrics,rewards}/<name> wandb series (breaking for dashboards); logic is localized to aggregation but affects how eval/train metrics are interpreted.

Overview
CustomMetrics now treats seeded-but-unscored entries (None in per-rollout metrics / rewards dicts) as 0.0 when building per-key means, instead of skipping those rollouts for that key.

That makes the all wandb slice include scoring-failed traces as zeros for each expected component, aligning with scalar all/reward/mean behavior. The effective subset is unchanged (errored rollouts are still excluded there).

Unit tests in test_nested_metrics_and_rewards were extended for errored rollouts with None seeds, effective means, and cross-env aggregation so unrelated env keys do not dilute another env’s component means.

Reviewed by Cursor Bugbot for commit bc41c58. Bugbot is set up for automated code reviews on this repo. Configure here.

mikasenghaas and others added 4 commits August 3, 2026 21:39
Verifiers now seeds expected reward/metric names with None when scoring
starts, so a scoring failure leaves seeded-unscored entries instead of an
empty dict. CustomMetrics counts unscored rewards as 0.0 (matching the
scalar reward, which sums them as 0) and keeps averaging metrics over the
rollouts that scored them, so all-subset per-key reward means no longer
collapse onto effective when scoring errors occur.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mikasenghaas
mikasenghaas requested a review from hallerite August 3, 2026 22:03
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mikasenghaas
mikasenghaas marked this pull request as ready for review August 3, 2026 22:23
@mikasenghaas
mikasenghaas merged commit ed05a14 into main Aug 3, 2026
22 checks passed
mikasenghaas added a commit that referenced this pull request Aug 3, 2026
Keeps #3182's unscored-as-zero coverage, rekeyed onto the agent subtree.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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