Skip to content

fix: warn on oversized seeds vs max_code_length and handle inner fences in parse_full_rewrite - #626

Open
peterzhang987723 wants to merge 1 commit into
algorithmicsuperintelligence:mainfrom
peterzhang987723:fix/max-code-length-guard-and-fence-parsing
Open

peterzhang987723 wants to merge 1 commit into
algorithmicsuperintelligence:mainfrom
peterzhang987723:fix/max-code-length-guard-and-fence-parsing

Conversation

@peterzhang987723

Copy link
Copy Markdown

Summary

  • Startup & starvation diagnostics for config.max_code_length:
    • In openevolve/controller.py, emit clear warnings at initialization if initial or island-seeded programs already exceed config.max_code_length (where the default 10000 can cause near-100% rejection of evolved multi-helper rewrites before evaluation).
    • In openevolve/process_parallel.py, count iterations rejected specifically due to max_code_length (length_rejected_iterations) and surface a diagnostic summary warning so silent length-cliff starvation is immediately actionable.
  • Inner code-fence robustness in openevolve/utils/code_utils.py:
    • Update parse_full_rewrite to try matching a standalone closing fence (\r?\n[ \t]*```[ \t]*(?:\r?\n|$)) before falling back to lazy fence matching, preventing truncated extraction when the rewritten Python code embeds triple-backtick examples inside docstrings or string literals.

Testing

  • Added unit tests in tests/test_max_code_length_and_fence_parsing.py.
  • Verified pytest tests/test_max_code_length_and_fence_parsing.py tests/test_all_iterations_failed.py tests/test_diff_format_validation_worker.py -q (38 passed in 2.69s).
  • Verified non-slow/non-integration suite excluding loopback-socket coevolution test (1168 passed, 13 skipped, 18 deselected, 769 subtests passed).

@CLAassistant

CLAassistant commented Nov 27, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants