Repository navigation
Conversation
…ator The evaluator only checked radii for NaN. With NaN centres every overlap and containment comparison is False, so 21 circles of radius 1 at NaN centres scored radii_sum 21 although a rectangle of perimeter 4 cannot hold them. Centres at infinity pass the same way (inf - inf is NaN), and a NaN centre next to an infinite radius scored inf. Reject any non-finite entry right after the radius check, so the existing negative and nan radius messages are unchanged. Fixes algorithmicsuperintelligence#548
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.
Summary
examples/alphaevolve_math_problems/circle_packing_rect/evaluator.pyonly checked radii for negative/NaN values, so a candidate with NaN circle centres passed every constraint:dist < r1 + r2 - tolandwidth + height > 2 + tolare both False for NaN. 21 circles of radius 1 at NaN centres scoredradii_sum = 21.0although a rectangle of perimeter 4 cannot hold them. Centres at infinity pass the same way (inf - infis NaN), and a NaN centre next to an infinite radius scoredinf.This rejects any non-finite entry in
circlesright after the existing radius check, so the existing negative/NaN radius messages are unchanged.Tests
New
tests/test_circle_packing_rect_evaluator.py(same layout astests/test_example_evaluator_integrity.py): NaN centres (the repro from the issue), infinite centres, infinite radius next to a NaN centre, an unchanged "nan radius" message, and a valid finite packing that still scores.Fixes #548