Skip to content

scripts/musebench/compare.py compares a candidate report with a baseline report built on the same cohort sha256 and seen - #16

Open
unohee wants to merge 1 commit into
mainfrom
goal/21-scripts-musebench-compare-py-c
Open

unohee wants to merge 1 commit into
mainfrom
goal/21-scripts-musebench-compare-py-c

Conversation

@unohee

@unohee unohee commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Milestone of an auto-claude run.

Check: export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}" && systemd-run --user --scope -q -p MemoryMax=6G ~/RTX_ENV/bin/python -m pytest -m "not slow" -q -p no:cacheprovider && ~/RTX_ENV/bin/python scripts/check_docs.py && ~/RTX_ENV/bin/python scripts/musebench/compare.py --help >/dev/null && test -f docs/examples/musebench_gates.example.json && ls tests/test_musebench_compare*.py && grep -q "compare.py" docs/MUSEBENCH.md && ! grep -rniE "jupiter|h5_soup|codec4" docs/examples scripts/musebench/compare.py

Plan: .claude/auto-plan.md (local to the run).

…luates gates

scripts/musebench/compare.py takes --baseline and --candidate musebench_report.json files and
refuses (exit 2) unless both describe the same cohort and the same seen/unseen field. It writes
comparison.json and comparison.md with baseline, candidate, delta and Wilson 95 % intervals for
every headline metric and every generator's clean FNR / AUROC, for the all/seen/unseen splits
(rate deltas also carry Newcombe's hybrid-score interval). --gates evaluates a spec of rules
(max, min, max_increase, min_decrease; optional per generator): exit 0 pass, 3 gate failure,
2 invalid input.

docs/MUSEBENCH.md gains "Cohorts, comparison and gates"; docs/examples/musebench_gates.example.json
is a placeholder spec. tests/test_musebench_compare.py (17 tests) covers pass, gate failure,
cohort mismatch (manifest sha and sample-vs-full), seen-field mismatch, missing/unknown metrics
and generators, malformed rules, section selection and Newcombe's published example.

Assumptions:
- The cohort-file milestone (report.py --cohort) has not landed on this branch, so cohort identity
  is read from run.cohort.sha256 (or run.cohort_sha256) when a report records one, and otherwise
  from run.input_manifest_sha256 + coverage.eval_rows for a full-cohort report. A sample-cohort
  report is therefore never comparable with a full-cohort one.
- A report without run.seen_field (built before --seen-field existed) uses report.py's default
  seen_in_training.
- A rule whose metric has no rows (n = 0) in a report it needs is invalid input (exit 2), not a
  pass or fail, so a gate cannot pass vacuously.
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