openevolve
openevolve copied to clipboard
first_autocorr_ineq evaluator accepts NaN/inf in f_values
Affected (at 8c65f74): examples/alphaevolve_math_problems/first_autocorr_ineq/evaluator.py:32 (np.any(f_values < 0.0)), :45 (integral test), :53 (delta > 1e-6).
Reproducer:
printf 'import numpy as np\ndef run():\n return np.full(10, np.nan), 0.5, 0.0, 10\n' > /tmp/p.py
cd examples/alphaevolve_math_problems/first_autocorr_ineq && python -c "import evaluator;print(evaluator.evaluate('/tmp/p.py'))"
Result: {'c1': 0.5, 'combined_score': 3.01...}; the claimed c1 is scored.
Why invalid: computed_c1 is NaN, so abs(computed_c1 - c1) > 1e-6 is False and the consistency check never fires.
Suggested fix:
+ if not np.isfinite(f_values).all():
+ raise ValueError("Function values must be finite")
if np.any(f_values < 0.0):