Fix runner resume behaviour, --clean flag, and add --seed - #14
Open
dan-s-w wants to merge 1 commit into
Open
Conversation
Three independent problems in eval_runner, all reachable from a normal resumed run. 1. Per-sampler filtering narrowed the shared dataset run_evals reassigned dataset.df to the current sampler's remaining problems, so the next sampler computed its own remaining set from the already-narrowed frame. On a resumed run, samplers after the first silently received fewer problems than the dataset contains. Filtering now reads from a per-dataset snapshot and leaves dataset.df alone. 2. FAILED rows were treated as completed get_remaining_problems matched on the query column regardless of outcome, so a row written as FAILED was never retried. A transient timeout or rate limit became a permanent hole in that sampler's results. FAILED rows are now considered outstanding and retried. 3. --clean took a string The flag was type=str guarded by a bare truthiness check, so "--clean False" passed a non-empty string and wiped the results folder -- the opposite of what it reads like. It is now store_true. Also adds --seed, applied to the --limit sample, so two limited runs can be made comparable. Default is unchanged (unseeded). Tests use a stub sampler and no network. All three regressions fail against the previous implementation. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Three independent problems in
eval_runner.py, all reachable from a normal resumed run. Split into one PR because they're the same file and one reviewer will read them together.1. Per-sampler filtering narrowed the shared dataset
run_evalsreassigneddataset.dfto the current sampler's remaining problems ([old line 129]). The next sampler then computed its remaining set from that already-narrowed frame.On a resumed run, every sampler after the first silently received fewer problems than the dataset contains — so accuracy was computed over a smaller, arbitrarily chosen subset with nothing in the output indicating it. Filtering now reads from a per-dataset snapshot and leaves
dataset.dfuntouched.Worth noting
DATASETSholds mutable dataclass instances at module scope, so the narrowing persisted for the life of the process.2. FAILED rows were treated as completed
get_remaining_problemsmatched on thequerycolumn regardless of outcome, so a row written asFAILEDwas never retried. A transient timeout or rate limit became a permanent hole in that sampler's results — and sincewrite_metricsdrops FAILED rows from both numerator and denominator, that hole is invisible in the scorecard.FAILED rows are now considered outstanding and retried on the next run.
A retried-and-succeeded query leaves both the old FAILED row and the new successful row in the CSV. That's harmless for the current metrics (FAILED rows are excluded), but flagging it in case you'd prefer a dedupe on write.
3.
--cleantook a string--clean Falsepasses the non-empty string"False", which is truthy — so it wiped the results folder, the exact opposite of what it reads like. Nowaction="store_true".Also:
--seedApplied to the
--limitsample so two limited runs can use the same subset. Default unchanged (unseeded), so existing behaviour is untouched.Tests
New
tests/test_eval_runner.py— stub sampler, no network, runs without API keys.All three regressions were confirmed to fail against the previous implementation:
and pass after the change.
🤖 Generated with Claude Code