Repository navigation
Conversation
A rerun of eval-no-tools-batch on an output dir whose by_model/<model>.csv exists replayed the stored batches from round 0, stopped at the current repair cap and overwrote the CSV, discarding later rounds' repairs (#102). - run_batch_eval returns the persisted CSV when it exists, logs its row and missing-prediction counts, and makes no provider call. A redo uses a new --output-dir. - A new CSV is written to a staging file and hard-linked into place only if the destination is still absent, after the spend ledger is mirrored. - The repair log announces another round only when the cap allows one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Fixes from review round 1: - Publishing a model writes by_model/<model>.batch.json after the spend mirror and the CSV. It records the model id, provider, resolved programs, scenario hash, row count and CSV sha256. - A rerun returns the saved CSV only when that record matches the current evaluation, the CSV checksum matches and the spend mirror exists. Otherwise it refuses (SystemExit from the CLI) and says to use a new --output-dir, or to remove the CSV to resume polling an interrupted run with the original inputs. A legacy CSV without a record is refused, not accepted as complete. - One per-model flock covers the existing-output check, the mirror, the CSV and the record, so a losing writer returns the winner's output without touching the mirror. - Publication stages files in by_model and uses os.replace, so it no longer needs hard links. - The randomized test replays saved rounds with the CSV removed and compares the full reconstructed frame again. - The runbook's batch section describes the verified skip, the refusal and the new-directory redo. 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 #102.
What changes
Rerunning
eval-no-tools-batchon an output directory whoseby_model/<model>.csvalready existed replayed the stored batches from round 0, stopped at the current repair cap and overwrote the CSV. A rerun could leave more missing predictions than the run it replaced. This takes option (a) from the issue: a completed model is a no-op, but only after the run proves the CSV belongs to the same evaluation.by_model/<model>.batch.jsonafter the spend mirror and the CSV. It records the model id, provider, resolved programs, scenario hash (scenario ids and serialized inputs), row count and CSV sha256.run_batch_evalreturns the persisted CSV only when that record matches the current evaluation, the CSV's sha256 matches and the spend mirror exists. It logs the row and missing-prediction counts and makes no provider call.--output-dir, or to remove the CSV to resume polling an interrupted run with the original inputs.flock(by_model/.<model>.lock) covers the existing-output check, the mirror, the CSV and the record. A second writer that finishes later returns the first writer's CSV without touching the mirror.by_model/and usesos.replace, so it needs no hard-link support.docs/runbook.mddescribes the verified skip, the refusal and the new-directory redo.Behaviour to note
POLICYBENCH_MAX_REPAIR_ROUNDSand rerunning on the same directory no longer adds repair rounds; it returns the existing CSV. Option (b) in the issue would continue from the last round, but this PR doesn't implement it.by_model/gains a.batch.jsonrecord and a hidden.lockfile per batch model. Export and reparse read only*.csvthere.fcntl); it coordinates batch writers that use it.Tests
test_completed_batch_keeps_repairs_when_rerun_with_lower_cap: round 0 returns no predictions and round 1 repairs one. A rerun with the cap at 0 leaves the CSV bytes unchanged and makes no status call. On main, the rerun rewrites the CSV with the repair lost.test_batch_cli_refuses_unverified_output: through the CLI, a changed program list, a changed scenario input under the same id, a missing record, an edited CSV and a missing mirror each exit with the mismatch named, leave the CSV bytes unchanged and make no status call.test_batch_publication_keeps_first_writer: publication holds the model lock, writes the mirror, CSV and record in that order withos.replacefromby_model/, and a second publisher with a different frame and a stale ledger changes none of the three files.The patch and its fix commit came from read-only Codex lanes that could not run pytest. CI runs the tests (
-m "not slow").ruff checkandruff format --checkpass on the changed files.🤖 Generated with Claude Code