Skip to content

Conversation

@codelion
Copy link
Member

@codelion codelion commented Feb 4, 2026

Summary

Fixes issue #391 where all evolved programs were placed in Island 0 instead of being distributed across configured islands.

Root Cause

When sampling from an empty island, sample_from_island() falls back to sampling from any available program (typically from Island 0). Children then inherited their parent's island via database.add(), creating a feedback loop where all programs ended up in Island 0.

Fix

  1. Added target_island field to SerializableResult
  2. Worker now returns sampling_island from the snapshot in the result
  3. ProcessParallelController passes target_island to database.add() when processing results

This ensures children are placed in the intended target island, not the parent's island.

Changes

  • openevolve/process_parallel.py: Added target_island to result and pass it to database.add()
  • tests/test_island_child_placement.py: Comprehensive tests for island placement behavior

Test Plan

  • All 354 tests pass
  • New tests verify:
    • Child placement with explicit target_island
    • Empty island fallback behavior
    • Island population growth simulation
    • Regression tests for old buggy behavior

Closes #391

🤖 Generated with Claude Code

Fix issue #391 by ensuring children are placed in the intended target island instead of inheriting the parent's island. Add target_island to SerializableResult, capture sampling_island in the worker, and pass result.target_island into database.add when inserting child programs. Update tests to reflect the fixed behavior (children go to the target island) and add regression tests that demonstrate the old buggy behavior when target_island is not provided and the correct behavior when it is.
@codelion codelion merged commit 65cbbe8 into main Feb 4, 2026
5 checks passed
@codelion codelion deleted the fix-island-placement branch February 4, 2026 04:01
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.

Bug: Island-based evolution not distributing programs across islands

1 participant