Skip to content

fix(examples): reject non-finite values in first_autocorr_ineq evaluator - #552

Open
fixfon wants to merge 1 commit into
algorithmicsuperintelligence:mainfrom
fixfon:fix/549-first-autocorr-nan
Open

fixfon wants to merge 1 commit into
algorithmicsuperintelligence:mainfrom
fixfon:fix/549-first-autocorr-nan

Conversation

@fixfon

@fixfon fixfon commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Summary

examples/alphaevolve_math_problems/first_autocorr_ineq/evaluator.py did not check that f_values is finite. With NaN (or +inf) values computed_c1 is NaN, so the consistency check abs(computed_c1 - c1_achieved) > 1e-6 is always False and the candidate's claimed c1 is scored as is (run() returning np.full(10, np.nan), 0.5, 0.0, 10 scored combined_score 3.01).

This adds np.isfinite(f_values).all() right after the shape check and before the non-negativity check. -inf was already rejected by the non-negativity check and now reports the finite error instead.

Tests

New tests/test_first_autocorr_ineq_evaluator.py (same layout as tests/test_example_evaluator_integrity.py): all-NaN values (the repro from the issue), +inf, a single NaN entry, -inf still rejected, and a valid finite function that still scores.

Fixes #549

A NaN or +inf entry in f_values made computed_c1 NaN, so the C1
consistency check (a NaN comparison, always False) never fired and
the candidate's claimed c1 was scored as is.

Reject non-finite values before the non-negativity check. -inf was
already rejected there and now reports the finite error instead.

Fixes algorithmicsuperintelligence#549
@CLAassistant

CLAassistant commented Oct 26, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

first_autocorr_ineq evaluator accepts NaN/inf in f_values

2 participants