fix(acceptor): reject NaN and +inf is_valid#3
Open
GrigoryEvko wants to merge 1 commit into
Open
Conversation
`is_valid <= 0` is False for both NaN and +inf, so a crashed validity stage emitting NaN or an unbounded-sentinel +inf was silently accepted as an elite. Add an isfinite() guard.
GrigoryEvko
added a commit
to GrigoryEvko/gigaevo-core
that referenced
this pull request
May 15, 2026
If ``_bandit.select()`` raises before ``record_pull`` runs, no pull is
recorded and the try/except inside ``invoke``/``ainvoke`` never engages
to inject a zero reward — the ledger invariant ("pulls and rewards
stay in step") therefore holds vacuously. Codify this so a future
refactor that moves ``record_pull`` outside ``_select`` (or hoists the
try/except above ``_select``) doesn't break the invariant silently.
Audit item FusionBrainLab#3 from the PR FusionBrainLab#13 bug hunt — verification, no code change.
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.
ValidityMetricAcceptorrejected zero and negativeis_validviais_valid <= 0, but NaN comparisons all return False and so doesinf <= 0. A crashed validity stage emitting NaN, or an unbounded-objective sentinel of +inf, was therefore silently accepted as an elite.Fix: add an
isfinite()guard before the<= 0check. Tests: finite small positive (0.5) accepted, NaN rejected, +inf rejected.