Skip to content

fix: respect per-dimension bins when sampling inspiration neighbors - #509

Merged
codelion merged 1 commit into
algorithmicsuperintelligence:mainfrom
liuzhengyang699:fix/inspiration-dimension-bounds
Oct 11, 2026
Merged

codelion merged 1 commit into
algorithmicsuperintelligence:mainfrom
liuzhengyang699:fix/inspiration-dimension-bounds

Conversation

@liuzhengyang699

Copy link
Copy Markdown
Contributor

With dictionary-valued feature_bins, feature coordinates use each dimension’s configured size, but inspiration-neighborhood perturbations still clamp every coordinate to self.feature_bins - 1 (the fallback size of 10). A parent at cell [18, 1] in a 20×2 grid therefore cannot reach its nearby [19, 1] candidate and falls back to random sampling. Narrow dimensions can also generate out-of-range coordinates.

Clamp each perturbed coordinate using the same per-dimension bin count as feature placement.

Validation: 15 tests passed across tests/test_inspiration_feature_bounds.py, tests/test_map_elites_features.py, and tests/test_sample_from_island_inspirations.py. The new test uses real feature coordinates and verifies that the nearby candidate is selected before random fallback; it fails before the fix. Official isort/Black pre-commit hooks and git diff --check passed.

@CLAassistant

CLAassistant commented Oct 10, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@codelion
codelion merged commit 3eec85d into algorithmicsuperintelligence:main Oct 11, 2026
4 checks passed
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.

3 participants