Skip to content

Commit 9b78546

Browse files
codelionclaude
andcommitted
Address program-sampling confusion (#452)
- Remove dead code openevolve/iteration.py (the single-process sample() path). It was never imported or executed (the live path is ProcessParallelController -> process_parallel.py), and it carried the hardcoded get_top_programs(5)/(3) counts and the divergent sampling logic the issue flagged (#452 points 2 & 4). - Size inspirations by num_diverse_programs instead of num_top_programs so that config parameter actually controls the inspiration count (#452 point 1). - Deduplicate inspirations against the top/diverse programs already shown in the prompt so a program is not listed twice (#452 point 3); add tests. - Rename secret_patterns -> redaction_patterns in the artifact security filter so SAST tools do not misread the redaction table as a hardcoded secret. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ccaf034 commit 9b78546

4 files changed

Lines changed: 171 additions & 245 deletions

File tree

openevolve/iteration.py

Lines changed: 0 additions & 211 deletions
This file was deleted.

openevolve/process_parallel.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,8 +803,12 @@ def _submit_iteration(
803803

804804
# Use thread-safe sampling that doesn't modify shared state
805805
# This fixes the race condition from GitHub issue #246
806+
# Inspirations are the diverse/creative examples; size them by
807+
# num_diverse_programs (not num_top_programs) so the config parameter
808+
# actually controls the inspiration count (GitHub issue #452).
806809
parent, inspirations = self.database.sample_from_island(
807-
island_id=target_island, num_inspirations=self.config.prompt.num_top_programs
810+
island_id=target_island,
811+
num_inspirations=self.config.prompt.num_diverse_programs,
808812
)
809813

810814
# Create database snapshot

0 commit comments

Comments
 (0)