Repository navigation
Make circle packing TARGET_VALUE configurable via environment variable - #501
Merged
codelion merged 1 commit intoOct 10, 2026
Conversation
…lgorithmicsuperintelligence#117 - Hoist the evaluator's target from two hardcoded 2.635 literals to a single module-level TARGET_VALUE = float(os.environ.get("CIRCLE_PACKING_TARGET_VALUE", "2.635")), shared by evaluate() and evaluate_stage1() - The target only scales target_ratio/combined_score (evolutionary pressure); the default keeps results comparable with existing runs - Add "Reproducibility & the target value" section to the example README - Add regression tests: default target, env override (ratio rescaled, validity unchanged), and evaluate()/evaluate_stage1() target consistency
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.
Fixes #117
Problem
examples/circle_packing/evaluator.pyhardcodesTARGET_VALUE = 2.635(the AlphaEvolve result) in two places: locally insideevaluate()and again astarget = 2.635insideevaluate_stage1(). Since the repo's own docs treat 2.635 as "the goal", readers interpreted this as feeding the answer to the model ("cheating"), which is what issue #117 reports.What
examples/circle_packing/evaluator.py: hoisted the target to a single module-level constant, read once from the environment with the historical default preserved:Both
evaluate()andevaluate_stage1()now reference the shared constant, so the double-hardcoding drift risk is gone. Keeping2.635as the default preserves comparability with existing runs'target_ratio/combined_scorevalues. This is the natural config entry point because openevolve loads custom evaluators viaimportliband callsevaluate(program_path)without passing config (openevolve/evaluator.py), so only module-level/environment configuration can reach it.examples/circle_packing/README.md: new "Reproducibility & the target value" section explaining that the target only scalestarget_ratio/combined_scoreto create evolutionary pressure and does not leak a solution (quoting codelion: "You can put any other value for the target like 3.0 and it will still work..."), how to override it (export CIRCLE_PACKING_TARGET_VALUE=3.0), the empirical no-prior reference points (default config reached 2.634 in ~800 generations per Reproducing circle packing without providingTARGET_VALUE = 2.635from AlphaEvolve paper #117; issue Seems a new circle packing result (2.635977) when reproducing your example 🎉 #156 reports 2.635977394746595 at iteration 206), and pointing out where theconfig_phase_*.yamlsystem messages mention 2.635 (with line numbers) for users who want a fully prior-free run.tests/test_circle_packing_target_value.py: new unittest module (no LLM, no scipy needed; runs in ~0.5s). It evaluates a tiny deterministic program (26 fixed grid circles,run_packing()returns directly) through the evaluator loaded by path:TARGET_VALUE == 2.635andtarget_ratio == sum_radii / 2.635;patch.dict(os.environ, {"CIRCLE_PACKING_TARGET_VALUE": "3.0"})and a fresh module load:TARGET_VALUE == 3.0,target_ratio == sum_radii / 3.0, andvalidityunchanged at 1.0 — proving the target only rescales fitness and does not affect validity;evaluate()andevaluate_stage1()report the sametarget_ratiounder the override (guards against the two call sites drifting apart again).Red -> green evidence
test_default_target_valueandtest_target_value_from_environmentfail withAttributeError: module 'circle_packing_evaluator' has no attribute 'TARGET_VALUE'(Ran 3 tests ... FAILED (errors=2)).Ran 3 tests in 0.437s ... OK, with the evaluator loggingtarget=2.635, ratio=0.740038vstarget=3.0, ratio=0.650000(validity 1.0 in both cases).Full suite:
OPENAI_API_KEY=test-key-for-unit-tests python -m unittest discover tests->Ran 577 tests in 33.729s ... OK.Notes
TARGET_VALUE = 2.635from AlphaEvolve paper #117 stands as the existing evidence that the result is reachable without the 2.635 prior.best_program.py/best_program_info.jsonand the README## Resultsnumbers; this one only adds a README subsection after Results, so any textual conflict on rebase is trivial).