Skip to content

fix(reproduce): check task count and compare only requested rubrics - #376

Open
plox-sumit wants to merge 1 commit into
TIGER-AI-Lab:mainfrom
plox-sumit:fix/reproduce-verdict-coverage
Open

plox-sumit wants to merge 1 commit into
TIGER-AI-Lab:mainfrom
plox-sumit:fix/reproduce-verdict-coverage

Conversation

@plox-sumit

Copy link
Copy Markdown

Fixes #362.

What was wrong

clawbench-reproduce could say PASS for a run on the wrong number of tasks, and could say FAIL for a correct single-rubric run.

  • verdict() only looked at the three percentages. It never looked at the task count. So 5 tasks with the same percentages passed against a published row of 130 tasks.
  • With --rubric lenient or --rubric strict, the rubric that was not run was read as 0% and still compared. A correct lenient-only run failed on the strict column, which nobody asked for.

What changed

  • The task count is checked first. Zero tasks, or a count different from the published n, gives INVALID.
  • Only the rubric columns you asked for are compared. The other one prints not evaluated instead of 0.0%.
  • If a rubric you asked for is missing from the rescore summary, the result is INVALID, not 0%.
  • If the judge gave no verdict for some runs of a rubric you asked for (n_judge_err_<rubric> above zero), the result is INVALID. Those runs were counted as misses even though the judge never answered.
  • verdict() now returns "pass", "fail" or "invalid". If a run is both incomplete and off by more than the tolerance, it is reported as INVALID, because numbers from an incomplete run can't be trusted either way.
  • The CLI exits with 0, 1 and 3. I used 3 because clawbench-run already exits 3 when the judge gives no verdict, and 2 is already used for an unknown model.

Example output for a lenient-only run:

  metric                 observed  published      delta
  Intercepted%              54.6%      54.6%     +0.0pp [OK]
  Reward(lenient)%          44.6%      44.6%     +0.0pp [OK]
  Reward(strict)%                  not evaluated

Left for you to decide

  • The issue also asks to compare task ids or the dataset revision when available. The rescore summary has every task_id, but the published table only has n, so there is nothing to compare the ids with. This PR checks the count only. If you add a task list or a dataset revision to the published rows, I can add that check in a follow-up.
  • Treating any judge-inconclusive run as INVALID is the strict choice. If you want a softer rule, tell me and I'll change it.
  • I did not change the "Pass criterion" text in the README. The issue asks @Perry2004 to confirm what counts as a valid reproduction, so I'd rather update the docs after that is settled.

Tests

New file tests/test_reproduce_verdict.py. It covers both examples from the issue, lenient-only and strict-only runs, full mode (a pass and a real mismatch), a missing rubric, judge-inconclusive runs, empty input, and the three CLI exit codes. 13 of its 15 cases fail on main, and all 15 pass with this change.

  • uv run --frozen pytest: 301 passed, 10 skipped, 1 failed (see below)
  • uv run --frozen ruff check and ruff format --check: clean
  • pyright: no errors in the files I touched

The one failing test is test_checked_task_json_files_parse_and_validate[v1-lite]. It fails the same way on main on my Windows machine, because test-cases/v1-lite is made of symlinks and Windows checks them out as text files. It has nothing to do with this change, and I expect it to pass in CI.

CHANGELOG: added one line under Unreleased / Fixed.

🤖 Generated with Claude Code

This branch has not been deployed

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

[P1] reproduce: validate sample coverage and selected rubrics before reporting PASS/FAIL

1 participant