Repository navigation
feat: mix full rewrites into diff-based evolution, plus trace fixes (v0.4.1) - #580
Merged
codelion merged 6 commits intoNov 2, 2026
Conversation
…telligence#116) Add full_rewrite_probability: with diff_based_evolution on, each iteration asks for a full rewrite instead of SEARCH/REPLACE diffs with this probability. The default 0.0 keeps today's behaviour. - The worker picks the mode per iteration from a generator seeded with (random_seed, iteration), so runs stay reproducible whichever worker runs an iteration, and the ensemble's model picks (algorithmicsuperintelligence#559) are untouched. - The chosen mode drives both prompt building and response parsing, and is recorded on the result (failures included), in program metadata ("evolution_mode"), in the evolution trace, and as the template key passed to log_prompt. - Config validation (from_dict and the controller, for configs built in code): the probability must be in [0, 1], needs diff_based_evolution, and cannot be combined with prompt.programs_as_changes_description. Also add evolution_trace.include_failures (off by default): iterations that fail before producing a child are written to <trace>_failures.jsonl with their error and mode, plus the prompt and LLM response when include_prompts is on. Worker errors after the LLM call now carry the prompt, response, parent and island, so parse failures can be inspected.
This was referenced Nov 1, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The exporter JSON-encodes non-scalar metadata but the loader only decoded
strings starting with "{", so lists came back as strings. Decoding every
"["-prefixed string instead would corrupt real strings that look like JSON.
The exporter now records which attributes it encoded in
__json_encoded_keys__, and the loader decodes exactly those. Files without
the list load as before, since their values can't be told apart.
Closes algorithmicsuperintelligence#574
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review fixes for evolution_trace.include_failures: - Timed-out and crashed iterations now reach the failures file; they were the failures with the least other evidence and were missing from it. - Failed LLM calls keep the prompt, parent and island like later failures. - failures_path now matches the file written when compress is on (it lacked .gz). Dotted trace names no longer share one failures file: run.v2 and run.v3 both wrote to run_failures.jsonl. Each child now stores the sampled model as metadata["llm_model"], also in the trace, so ensemble models can be compared. token_usage only names the model when the provider returns usage data. Closes algorithmicsuperintelligence#381 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cut the README from 1,074 to about 200 lines. It now opens with adoption and a list of papers using OpenEvolve, then results, quick start and an overview. Emojis are gone, which also fixes the Quick Start and Installation anchors they were breaking, and the dead example output link is removed. The quick start now clones the repo, since the examples are not part of the pip package. Detailed material moves to docs/: LLM providers, configuration, system messages, showcase, how it works, FAQ and roadmap. Co-Authored-By: Claude Opus 5.5 <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.
Closes #116
Summary
Adds
full_rewrite_probability. Whendiff_based_evolution: true, each iteration asks for a full rewrite instead of SEARCH/REPLACE diffs with probability p. The default0.0keeps current behaviour.Changes
(random_seed, iteration). Runs stay reproducible whichever worker handles an iteration, and the ensemble's model sampling (Seed ensemble model sampling per iteration in worker processes #559) is untouched.metadata["evolution_mode"]), in the evolution trace, and as the template key passed tolog_prompt.Config.from_dictand in the controller, so configs built in code are covered too. The probability must be in [0, 1], it requiresdiff_based_evolution: true, and it can't be combined withprompt.programs_as_changes_description.evolution_trace.include_failures(off by default): iterations that fail before producing a child are written to<trace>_failures.jsonlwith their error and mode. Withinclude_prompts, the prompt and LLM response are included too. Worker errors raised after the LLM call now carry the prompt, response, parent and island, so parse failures can be inspected.Tests
tests/test_full_rewrite_probability.py: mode selection and reproducibility, prompt and parse routing, metadata and trace recording, config validation.tests/test_controller_trace_failures.py: runs the controller loop and checks that failed iterations land in the failures file.tests/test_evolution_trace.py: tracer support forinclude_failures.test_diff_format_validation_worker.pyandtest_worker_config_serialization.pyfor the new field.python -m unittest discover tests: 1035 tests, OK.Experiment results
The script and config are on
exp/full-rewrite-116, kept out of this PR.Setup: qwen3:8b (16k context, thinking off) on Ollama, Kaggle 2×T4 ·
circle_packing(phase 1 config) andfunction_minimization· p ∈ {0, 0.2, 0.5} · 3 seeds · 50 iterations · 18 runs. The trace was complete: no mode mismatches and no untraced iterations.Final best score (mean ± SD over 3 seeds)
These final scores overstate the effect:
function_minimizationis at its ceiling (~1.5), so differences there are within noise. AUC does rise with p (1.467 / 1.481 / 1.491), and the spread across seeds shrinks.Per-attempt comparison (circle_packing, first improvement attempts on the initial program)
Within mixed runs, a full rewrite produced a new best 8% of the time vs 3% for a diff (95% Wilson intervals [4%, 14%] and [1%, 7%]). On function_minimization the two rates were equal (8% vs 7%).
Failure modes
Takeaway
Full rewrites help mostly by escaping a weak starting program. A nonzero p looks worthwhile and 0.2 is a reasonable value to suggest. This data can't tell 0.2 from 0.5. A follow-up on circle_packing with 5–6 seeds and p ∈ {0.1, 0.2, 0.5} would settle it. The default stays at 0.0 so existing behaviour doesn't change.
Related
Two bugs found while running the experiment are fixed in separate PRs: #582 (per-iteration LLM request seed, a follow-up to #554/#559) and #581 (children dropped from the trace when their parent left the archive). This PR doesn't depend on either one, and all three merge cleanly in any order.
Added for the v0.4.1 release
Main is merged in, and these are on top of the original commit.
Review fixes for
include_failuresfailures_pathnow matches the file written whencompressis on.run.v2andrun.v3both wrote torun_failures.jsonl.Issues folded in
metadata["llm_model"], also in the trace.__json_encoded_keys__; files without that list load as before.README: cut from 1,074 to about 200 lines, leading with research adoption and without emojis. Detailed material moved to
docs/.Version: bumped to 0.4.1.
Verification
h5py; they pass locally withh5pyinstalled.Closes #116
Closes #381
Closes #574
🤖 Generated with Claude Code