Repository navigation
fix(sleep): report a malformed char bound instead of crashing the judge - #462
Open
Lanre Shittu (Shizoqua) wants to merge 1 commit into
Open
Lanre Shittu (Shizoqua) wants to merge 1 commit into
Lanre Shittu (Shizoqua) wants to merge 1 commit into
Conversation
_check() called int() on max_chars/min_chars arguments. A rule judge imported without validate_checks(), such as a gbrain-style benchmark.jsonl, could carry a bound like "abc" or None, which raised and stopped the replay, or 500.5 and true, which were silently used as 500 and 1. Parse the bound with char_bound(), the parser validate_checks() uses. A bound it rejects, or a negative one, now fails the check and is named as "invalid char bound" in the rationale, so the optimizer feedback says the evaluator configuration is invalid, as for a bad regex.
This branch has not been deployed
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.
Summary
_check()inskillopt_sleep/judges.pycalledint()onmax_chars/min_charsarguments. A rule judge that skippedvalidate_checks(), such as a gbrain-stylebenchmark.jsonl, could carry a bound like"abc"orNone, which raised and stopped the replay, or500.5andtrue, which were silently used as 500 and 1.Changes
_check()parses the bound withchar_bound(), the parservalidate_checks()already uses.invalid char bound (...)in the rationale. The optimizer feedback then says the evaluator configuration is invalid, as it does for a bad regex.500,"500",500.0) score as before.CHANGELOG.md: entry under Fixed.Tests
New
tests/test_judges_char_bound.py:max_charsandmin_chars, the bounds"abc","500 chars",None,True,500.5,infand-1fail closed withinvalid char boundin the rationale and the invalid-configuration feedback, without raisingThe malformed-bound tests fail on main and pass with the fix.
tests/test_judges.pypasses unchanged. Full suite: 2448 passed, 12 skipped, 4 xfailed.ruff checkandruff format --checkpass on the changed files.Fixes #460