judging: filter stale/excess checkpoint rows on resume instead of merging them into the statistics - #32
Open
ChrisW09 wants to merge 1 commit into
Open
judging: filter stale/excess checkpoint rows on resume instead of merging them into the statistics#32ChrisW09 wants to merge 1 commit into
ChrisW09 wants to merge 1 commit into
Conversation
judge_results merged every row in the ratings checkpoint into the output unconditionally, so resuming after the study changed (or with a lower repetitions than previously checkpointed) silently carried ghost verdicts — from removed configs or excess judge reps — into the ratings and every downstream statistic. It also started the progress counter at done > total. Now checkpoint rows are filtered to the current targets x repetitions, with a warning when stale rows are dropped — mirroring the guarantee run_study already gives the answer phase (and which this function's docstring promises). Fixes #11 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Fixes #11.
judge_resultsresumed a ratings checkpoint withratings = list(prior.values())— every stored row, unconditionally. Two verified consequences:repetitions=1against a checkpoint written withrepetitions=2returned 6 ratings instead of 3;Results(changed study) against the same checkpoint merged the old configs' verdicts with the new ones, so ghost configs flowed intoattribute()marginals, best-config, andEvaluation.records()(rows withanswer=None), and the progress counter started atdone > total.The answer phase already guards against exactly this (
run_studyfilters tovalid_keysand warns, pinned bytest_resume_drops_stale_checkpoint_rows), and the judging docstring promises "the same guarantee". This PR delivers it: prior rows are filtered to the currenttargets × repetitionskey set, a warning reports how many stale verdicts were dropped, anddone/tododerive from the filtered set. Regression test covers both the excess-repetitions and changed-study cases.Test:
pytest packages/cafe-core/tests/test_review_fixes.py— 9 passed.🤖 Generated with Claude Code