Optimize-the-optimizer: evolve search controllers - #89
Conversation
Evolve parent selection / mutation policies scored on held-out black-box problems under a fixed eval budget (EvoX²-style wedge). Co-authored-by: Cursor <cursoragent@cursor.com>
Register the dynamically loaded module in sys.modules before exec so @dataclasses Candidate works on Python 3.14+. Co-authored-by: Cursor <cursoragent@cursor.com>
shubham3-ucb
left a comment
There was a problem hiding this comment.
Thanks @ShauryaVM, strong benchmark idea. Two blockers before merge, both harness integrity (both reproduced live):
-
evaluator.py:36—run_fn = getattr(module, "run_controller", run_controller). Every candidate is a copy ofinitial_program.py, which definesrun_controlleroutside the EVOLVE-BLOCK (line 70; block ends line 67), so the candidate always supplies its own scoring harness. A candidate that returns the per-problem ceiling (0.0) scores 1.0 with no search. PoC: a program whoserun_controllerreturns0.0gives{combined_score: 1.0, test_score: 1.0, train_score: 1.0}in 0.001s. Fix: keeprun_controllerin a non-evolvable module (orevaluator.py) and nevergetattrit off the candidate; the candidate should only supplySearchController. -
initial_program.py:94—while remaining > 0decrements only insidefor x in proposals, so a controller whoseask()returns[]loops forever. It is a hang not an exception, soevaluate()try/except does not catch it and the frameworkrun_in_executorfuture cannot kill the thread. PoC: a candidate whoseask()returns[]times out the evaluator (exit 124). Fix:if not proposals: break(or inject a random point).
Minor: config.yaml:40 sets cascade_evaluation: true with no evaluate_stage1/stage2, so cascade_thresholds are dead config and a warning fires every run. Set false or implement the stages.
Happy to re-review once these are in.
…eak on empty ask Keep the evaluation loop in the evaluator so a copied run_controller stub cannot return the per-problem ceiling, and stop the budget loop when ask() returns no proposals so empty-ask candidates cannot hang. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed the harness-integrity issues from the review:
Regression: |
|
@ShauryaVM Thanks, both blockers are genuinely fixed and I confirmed it: a candidate-supplied One separate benchmark-design issue: every objective has its optimum at the origin (sphere, rastrigin, ackley all minimize at 0, and rosenbrock at the origin still scores ~0.995), so a do-nothing controller whose |
Small EvoX² wedge: the candidate is a search controller (selection + mutation / `ask`), not a solution to one math task. The evaluator runs it on a black-box portfolio under a fixed budget and weights held-out Ackley / Rosenbrock most heavily.
What lands
How I tested
Made with Cursor