Replace the node score sentinel with an explicit valid flag - #99
Merged
Conversation
rasros
force-pushed
the
node-valid-flag
branch
from
August 18, 2026 05:20
31e3740 to
113d596
Compare
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.
SearchNode.scorewas a float holding one of two sentinel values. Nothing read it as a quantity — every one of its 47 references was a< INVALID_SCOREvalidity check — but it read as a quality anyone could sort by, and three separate defects this week came from something sorting by it after it had stopped meaning anything:epoch_parentssorted its Pareto front by it, a no-op orderingselect_survivorspicked the elite bymin(key=n.score), which would have raised at runtimeWhat it becomes
SearchNode.valid: bool— the candidate's markup parsed, it rasterized, and the measures computed. Not a quality judgement and not orderable:order=Trueis gone, because ordering by a constant is what caused the above. Candidates are ranked by dominance over their measures, which needs a population, so a single node has no position of its own.Result.scorebecomesResult.measured: bool— whether the measures have been taken yet. That is all it encoded: a result crosses the queue once before anything is known about it, andResult.validalready existed alongside it.ChainState.scoreis gone; it duplicated the node's.What went with it
INVALID_SCORE,VALID_SCORE,valid_scores()andscore_std(), plus the statistics derived from them —pool_score_stdin stats.csv and the spread readout in the dashboard. A spread of a constant measures nothing. Crowding distance keeps an infinity sentinel, nowmath.inf, which is a genuine infinite distance rather than a disguised boolean.Elitism is redefined. It reserved a slot for the best score; with no single best it now guarantees a member of the top Copeland tier survives, which is the same intent — the majority relation cycles and crowding distance sorts for spread, so a generation can otherwise evict everything unbeaten.
--resume-topandclean_runs.pyread the older filename shapes, andplot_run.py's front plot now draws two objectives against each other rather than a metric against a score, since there is no score axis to draw.Scale
28 files, 428 insertions, 544 deletions. The test migration was the bulk of it: roughly 200 call sites constructed nodes or results with a score. I first tried it as a bulk regex, which produced more failures than it fixed and mangled several lines outright; that was reverted and the files were migrated one at a time, running each before moving on.