Skip to content

Preserve Species-GA population under clone backfill#47

Merged
isty2e merged 1 commit into
mainfrom
fix/species-ga-clone-backfill
Jul 2, 2026
Merged

Preserve Species-GA population under clone backfill#47
isty2e merged 1 commit into
mainfrom
fix/species-ga-clone-backfill

Conversation

@isty2e

@isty2e isty2e commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #27.

Species-GA survival now tracks protected members by their pool index instead of dataclass value equality. Clone-heavy pools can therefore backfill with distinct pool entries even when candidates, values, and scores are equal. The same survival pass also prioritizes species seeds before same-species crowd members when protected entries exceed population_size.

Root cause

The backfill path used member not in protected_population, which calls dataclass equality. In clone-heavy generations, every value-equal clone was excluded from backfill, so the population could shrink below population_size and later fail tournament selection. The truncation path also sliced protected entries in flatten order, which could drop a later species seed behind an earlier species crowd member.

Validation

  • uv run --python 3.11 --extra test pytest tests -q
  • uv run --python 3.11 --extra test ruff check pyproject.toml src tests
  • uv run --python 3.11 --extra test basedpyright src tests
  • uv run --python 3.11 --extra test mypy src/variopt still reports the existing scipy/joblib missing-stub errors only.

@isty2e isty2e merged commit 69fb8ae into main Jul 2, 2026
3 checks passed
@isty2e isty2e deleted the fix/species-ga-clone-backfill branch July 2, 2026 13:41
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.

[High] Species-GA backfill can shrink the population below population_size and crash

1 participant