Skip to content

Fix receipt digest crash when a sample has no grade - #54

Merged
dylanuys merged 1 commit into
mainfrom
fix/receipt-digest-unscored-nan
Nov 12, 2026
Merged

dylanuys merged 1 commit into
mainfrom
fix/receipt-digest-unscored-nan

Conversation

@dylanuys

Copy link
Copy Markdown
Contributor

Summary

Inspect's Score.unscored(...) stores value = NaN, and yugos-evals returns it for every unsettled outcome. One example is a needs_review completion gate when a sample hits its time limit while the model's last turn is a tool call. inspect_engine.digest._sample_record copied that NaN into the canonical receipt unchanged. competition.rules.digest encodes with allow_nan=False, so receipt_digest raised ValueError: Out of range float values are not JSON compliant: nan after all of the run's inference had already finished.

The canonical receipt now records an unscored value as null, including NaN nested inside dict or list score values, and keeps the score's code. Receipts with no unscored scores serialize exactly as before, so their digests do not change.

Validation

  • New test_receipt_digest_commits_unscored_samples_as_null digests a log with a Score.unscored sample. It checks that the digest is computed and is the same after writing and re-reading the log, that it differs from the graded run's digest, and that the receipt records {value: null, code: needs_review}. Before the fix, it fails with the ValueError above.
  • A fully scored run's digest is identical before and after the change.
  • packages/yugos/tests: 571 passed. The 5 failures (test_chat, test_inspect_providers saygm cases) also fail on main.

🤖 Generated with Claude Code

Inspect's Score.unscored stores value NaN, and every unsettled
yugos-evals outcome (for example a needs_review completion gate when a
sample hits its time limit mid tool call) returns it. The canonical
receipt copied that NaN as-is, so the strict-JSON digest raised
"Out of range float values are not JSON compliant" after the run's
inference had finished.

The receipt now records an unscored value as null, keeping its code.
Receipts with no unscored scores are unchanged, so their digests are
stable.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T18:05:58.938780Z 00b496a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dylanuys dylanuys changed the title Commit unscored scores to the receipt digest as null Fix receipt digest crash when a sample has no grade Nov 12, 2026
@dylanuys
dylanuys merged commit d13bb67 into main Nov 12, 2026
2 checks passed
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