Repository navigation
Conversation
…mpts - policybench analyze applies the exporter's (model, scenario_id, variable) uniqueness check to its predictions before scoring, so a duplicated row can no longer count twice in the aggregates (#287). - load_predictions checks the combined per-model rows before writing predictions.csv, so a refused export no longer replaces a valid file (#288). - analyze builds its prompt map from the reference's variables before exclusions are split out, in reference order, as export_country does (#285). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
analyze --runs-dir now rejects a duplicate (run_id, model, scenario_id, variable) row before scoring, so a repeated prediction can no longer inflate within10pct_run_mean. The repeat loader is imported only when --runs-dir is given. export-full-run reads model, scenario_id and variable as strings in every prediction shard and in the reference, scenario and annotation CSVs they join against. A scenario id parsed as 1 in one shard and "1" in another can no longer slip past the duplicate check. The export duplicate test clears the reasoning-effort override so it does not depend on the caller's environment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round 2 found that analyze could still score duplicate predictions when CSV type inference gave one key two types: a run file named 1.csv with no run_id column got the string "1", while a file declaring run_id=1 got the integer 1, so the per-run guard saw two runs. analyze now reads predictions, the reference and the scenario manifest with the shared string key dtypes, and load_repeated_predictions reads run_id, explicit or taken from the file name, as a string. run_id stays in the repeat key, so distinct runs can still score the same target. Padded numeric scenario ids such as 001 now survive the bound prediction readers in finish_terra.py and finish_fable52.py and the audit's manifest read, so a correct prediction is no longer marked missing and a genuine miss keeps its question. Tests: the repeat test covers a duplicate within one file, the same run split across a file name and a run_id column (refused), and two distinct runs (accepted, run count 2). A new analyze test keeps 001 and 1 apart. A new audit test covers padded ids with the default and both bound readers. The primary duplicate test now uses an importable stub for the repeat loader and asserts the scorer never runs, and the prompt test clears the reasoning-effort override. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully 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.
Fixes #287, #288 and #285, three follow-ups from the reviews of #280 and #281.
policybench analyzenow runs the exporter's(model, scenario_id, variable)uniqueness check (moved intovalidate_unique_prediction_rowsinfull_run_export.py) on its predictions before scoring. A duplicated row used to count twice in the aggregates.load_predictionschecks the concatenatedby_model/*.csvrows before it writespredictions.csv. A refused export used to overwrite a valid combined file first. The check covers every combined row, socase_annotationsandannotation_validation, which callload_predictions, now also refuse duplicated per-model rows.analyzetakes the prompt map's variable list from the whole reference, in reference order, before exclusions are split out, asexport_countrydoes. An output excluded everywhere used to drop out of every prompt.Tests:
test_analyze_rejects_duplicate_prediction_rows: refuses before any output is written.test_export_preserves_combined_predictions_when_by_model_rows_repeat: the earlierpredictions.csvis left byte for byte.test_analyze_prompts_keep_fully_excluded_outputs_in_reference_order: checks both prompt contracts.A Codex lane (GPT-6.2 Sol) wrote the patch, and Claude read it against main before applying it. The tests were not run locally; CI runs
pytest -m "not slow".ruff checkandruff format --checkpass on the changed files.🤖 Generated with Claude Code