Skip to content

judging: filter stale/excess checkpoint rows on resume instead of merging them into the statistics - #32

Open
ChrisW09 wants to merge 1 commit into
mainfrom
fix/judging-checkpoint-stale
Open

judging: filter stale/excess checkpoint rows on resume instead of merging them into the statistics#32
ChrisW09 wants to merge 1 commit into
mainfrom
fix/judging-checkpoint-stale

Conversation

@ChrisW09

Copy link
Copy Markdown
Collaborator

Fixes #11.

judge_results resumed a ratings checkpoint with ratings = list(prior.values()) — every stored row, unconditionally. Two verified consequences:

  • re-running with repetitions=1 against a checkpoint written with repetitions=2 returned 6 ratings instead of 3;
  • judging a different Results (changed study) against the same checkpoint merged the old configs' verdicts with the new ones, so ghost configs flowed into attribute() marginals, best-config, and Evaluation.records() (rows with answer=None), and the progress counter started at done > total.

The answer phase already guards against exactly this (run_study filters to valid_keys and warns, pinned by test_resume_drops_stale_checkpoint_rows), and the judging docstring promises "the same guarantee". This PR delivers it: prior rows are filtered to the current targets × repetitions key set, a warning reports how many stale verdicts were dropped, and done/todo derive 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

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>
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.

judging: checkpoint resume merges stale/excess ratings into results (no filtering against current targets/repetitions)

1 participant