Repository navigation
fix: retain restored feature statistics during database construction - #510
Merged
codelion merged 1 commit intoOct 10, 2026
Conversation
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.
Constructing
ProgramDatabasewith a checkpointdb_pathcallsload(), which restores the MAP-Elites feature statistics. Later in the constructor,self.feature_stats = {}discards those restored ranges. The next candidate is consequently binned against a fresh scale: in the regression, a value of 25 in the saved 0–100 range moves from cell 2 to cell 5.Initialize the empty statistics before loading the checkpoint so the restored values survive construction. Existing persistence tests explicitly call
load()a second time, which masks this path; the new tests exercise construction alone.Validation: 9 tests passed across
tests/test_constructor_feature_stats.pyandtests/test_feature_stats_persistence.py. Both new cases fail before the fix. Official isort/Black pre-commit hooks andgit diff --checkpassed.