fix: fitness_flags not propagated to manifest entries for newly admitted candidates (#990)
Two changes in evolve.sh pool-admission code: 1. Include `fitness_flags` from evaluator JSONL in the manifest entry dict for newly admitted candidates (~line 866-874). Previously the field was omitted, so downstream `effective_fitness()` could never zero-rate a new candidate. 2. Use `effective_fitness(entry)` when appending new candidates to the evolved ranking list (~line 907), so ZERO_RATED_FLAGS defence applies at first admission — not only when re-ranking existing entries. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5f01d55cc7
commit
e2963cbcba
1 changed files with 12 additions and 10 deletions
|
|
@ -834,7 +834,8 @@ for fname in sorted(os.listdir(output_dir)):
|
|||
f'candidate_{int(cand_str):03d}.push3'
|
||||
)
|
||||
if os.path.exists(push3_path):
|
||||
qualifying.append((fitness, push3_path, gen_idx, cand_str))
|
||||
flags = d.get('fitness_flags', '')
|
||||
qualifying.append((fitness, push3_path, gen_idx, cand_str, flags))
|
||||
except (json.JSONDecodeError, ValueError, TypeError, AttributeError):
|
||||
pass
|
||||
|
||||
|
|
@ -844,7 +845,7 @@ qualifying.sort(key=lambda x: x[0], reverse=True)
|
|||
new_items = [] # (fitness, push3_path, manifest_entry)
|
||||
seen = set(existing_hashes)
|
||||
|
||||
for fitness, push3_path, gen_idx, cand_str in qualifying:
|
||||
for fitness, push3_path, gen_idx, cand_str, flags in qualifying:
|
||||
h = file_hash(push3_path)
|
||||
if h in seen:
|
||||
continue
|
||||
|
|
@ -866,6 +867,7 @@ for fitness, push3_path, gen_idx, cand_str in qualifying:
|
|||
entry = {
|
||||
'file': filename,
|
||||
'fitness': fitness,
|
||||
'fitness_flags': flags,
|
||||
'origin': 'evolved',
|
||||
'run': run_id,
|
||||
'generation': gen_idx,
|
||||
|
|
@ -903,7 +905,7 @@ pinned = [(effective_fitness(e), e, None) for e in existing
|
|||
evolved = [(effective_fitness(e), e, None) for e in existing
|
||||
if e.get('origin') == 'evolved']
|
||||
for fitness, push3_path, entry in new_items:
|
||||
evolved.append((fitness, entry, push3_path))
|
||||
evolved.append((effective_fitness(entry), entry, push3_path))
|
||||
|
||||
evolved.sort(key=lambda x: x[0], reverse=True)
|
||||
admitted_evolved = evolved[:MAX_EVOLVED]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue