fix(strategies): refuse to tighten dynamic bounds on zero-range batch#4
Open
GrigoryEvko wants to merge 1 commit into
Open
Conversation
A single sample (or all-equal batch) has `obs_min == obs_max`, so `_calculate_bounds_for_batch` falls through to the `1e-5` margin fallback and collapses the dimension to a ~2e-5 window. The initial-bounds clamp then prevents re-expansion once samples diversify — MAP-Elites resolution is permanently destroyed on that axis. Return strategy.min_val/max_val unchanged in that case. Two pre-existing tests encoded the collapsed bounds as expected output and are updated.
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.
A zero-range batch (single sample, or all-equal samples) collapses the dimension.
_calculate_margin(0)falls back to1e-5, so for one elite withspeedup=0.964against initial bounds[0, 100], the bins become[0.96399, 0.96401]— a 2×10⁻⁵ window across 10 bins, five orders of magnitude tighter. Subsequentoptimize_spacecalls with still-narrow batches re-collapse on every pass. Matches the[0.000, 100.000] -> [0.964, 0.964]log line in single-elite runs.Reproducer against current main:
Fix: when
value_range == 0, return the strategy's current bounds unchanged. Two pre-existing tests (test_batch_optimize_single_point,test_single_point_batch) encoded the collapsed bounds as expected output and are updated.