Repository navigation
Conversation
This branch has not been deployed
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.
Fixes #294.
MAP-Elites currently admits non-finite fitness into its archive. With evaluator scores
[NaN, 1.0]in one cell, the real optimization loop returns best fitnessNaNand acceptance history[True, False]: the finite improvement cannot replace the invalid elite. Infinite feature descriptors are also silently clipped into boundary cells.Extend the existing numeric validation to reject non-finite fitness and descriptors with field-specific
ValueErrors before archive admission or binning. NaN descriptors already fail inside integer conversion; they now receive the same clear field-specific validation error. The existing selection, mutation, finite signed fitness, and finite out-of-range descriptor clipping behavior is preserved.Validation on Windows / Python 3.11.7:
python -m pytest tests/src/optimizers --ignore=tests/src/optimizers/test_sew_workflow_scheme.py -q: 30 passed. The new file directly runs the actual optimizer, without model calls, network services, or mocked optimizer methods. It covers scalar/dictionary non-finite fitness, non-finite descriptors, signed finite scores, finite clipping boundaries, ties, and subsequent improvements. On unchanged main (f3d1ea5), the targeted MAP-Elites command yields 9 failed, 17 passed; patched yields 26 passed. Eight cases previously admitted invalid values; the NaN-descriptor case checks the clearer diagnostic.git diff --checkpasses. The edited production file has the same 29 pre-existing Ruff diagnostics on base and patched code, with no added diagnostics; these concern existing imports/type annotations and are not reformatted in this bug fix.test_sew_workflow_scheme.pyis one of those collection failures, which is why the affected optimizer group above excludes it.Setup: isolated virtual environment with
uv pip install -e '.[dev,tools,optimizers]' 'mcp<2'. The local MCP compatibility constraint is needed for FastMCP 2'sMcpErrorimport with the currently resolved packages; no dependency files are changed by this PR. No GPU runs, live LLM calls, or optimization-quality gains are claimed.This patch, issue, and verification were prepared with AI assistance. No independent human review is asserted.