Repository navigation
fix: bootstrap corpus until --min-corpus-files is reached, not a fixed count - #886
Merged
Merged
Conversation
…d count run_evolutionary_loop computed `needed = min_corpus_files - current` once and ran `for _ in range(needed): generate_new_seed(...)`. But generate_new_seed only grows the corpus when a seed is interesting AND not a duplicate, so every rejected or duplicate seed was a wasted attempt and the corpus ended up smaller than N. Loop until the corpus actually reaches min_corpus_files (re-checking size each iteration), bounded by MIN_CORPUS_SEED_ATTEMPT_MULTIPLIER * deficit so a pathological duplicate/rejection rate can't spin forever; warn if the cap is hit before reaching N. Writes a heartbeat each attempt so the bootstrap stays observable. Closes #885 Co-Authored-By: Claude Opus 4.8 (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.
Summary
--min-corpus-files Nproduced a corpus with noticeably fewer than N entries.Root cause:
run_evolutionary_loopcomputedneeded = N - currentonce and ranfor _ in range(needed): generate_new_seed(...). Butgenerate_new_seedonly grows the corpus when a seed is interesting AND not a duplicate — every rejected/duplicate seed (theduplicate_rejectedhealth events) was a wasted attempt, so the corpus undershot N.Fix: loop until the corpus actually reaches
min_corpus_files(re-checking each iteration), bounded byMIN_CORPUS_SEED_ATTEMPT_MULTIPLIER × deficitso a pathological duplicate rate can't spin forever; warn if the cap is hit before reaching N. A heartbeat is written each attempt so the bootstrap stays observable.Test plan
test_bootstrap_retries_until_minimum_when_seeds_rejected— 50% accept rate reaches N (10 attempts for 5 files).test_bootstrap_caps_attempts_when_seeds_never_accepted— stops at the cap and warns (no hang).mypy lafleurclean;ruffclean.Closes #885
🤖 Generated with Claude Code