Skip to content

Fix differential evolution, brute force, and out-of-range steps - #18

Merged
barrybecker4 merged 1 commit into
masterfrom
cursor/eval-optimizer-fixes-0734
Oct 17, 2026
Merged

barrybecker4 merged 1 commit into
masterfrom
cursor/eval-optimizer-fixes-0734

Conversation

@barrybecker4

Copy link
Copy Markdown
Member

Summary

Evaluation of every OptimizationStrategyType on the eight OptimizerEvalApp problems (seeds 1, 42, 99) found several strategies that do not search. This draft fixes the clear, low-risk defects and leaves the write-up in EVALUATION.md (before/after numbers included).

  • Differential evolution called setValue and discarded the new Parameter, so every trial was the target. Sphere fitness stayed around 4.6–18 after 40,041 evaluations (~22 unique). It now builds a real trial vector, samples uniformly, and reaches ~1e-158 on the sphere and 0 on Rastrigin and Rosenbrock.
  • Brute force requested findGlobalSamples(Long.MaxValue). The 32-bit grid product wraps to one sample in 2D (sphere fitness 52.4, worse than the start) and to 2.1e9 points in 1D (does not finish). Integer lattices are enumerated directly; continuous spaces throw.
  • Integer sampling and epsilon steps could leave [min, max] or assert. That made global hill climbing and global simulated annealing throw on the discrete grid and the 1D line. Both now finish at fitness 0.
  • Hill-climbing cache retries grew the neighbor radius past the |r| <= 1.5 assert.
  • Genetic duplicate checks compared toCSVString under a global format lock, so DominatingSetProblemSuite did not finish. Value equality brings that suite down to about 4s.
  • Optimizer ignored the caller Random for differential evolution, particle swarm, and iterated local search.
  • A cancelled SwingWorker could overwrite a finished viewer run with "Cancelled."

./gradlew test: 288 tests, 0 failures. ./gradlew slowTest was still running at 90s and is not part of that count.

Test plan

  • ./gradlew test (288 tests, 0 failures), including DominatingSetProblemSuite
  • Headless strategy × problem × seed table, before and after (EVALUATION.md)
  • OptimizerEvalApp screenshots for all 13 strategies × 8 problems, plus after-fix frames for the repaired cases
  • ./gradlew slowTest (did not finish within 90s)
Open in Web Open in Cursor 

…ped out of bounds.

Differential evolution discarded immutable setValue results, so the population never changed. Brute force asked for a Long.MaxValue sample grid that wrapped to one point or billions. Integer sampling and epsilon steps could leave the legal range, and a stale viewer worker overwrote a finished run with "Cancelled."

Co-authored-by: Barry G Becker <barrybecker4@yahoo.com>
@barrybecker4
barrybecker4 marked this pull request as ready for review October 17, 2026 15:24
@barrybecker4
barrybecker4 merged commit 8259bda into master Oct 17, 2026
1 check passed
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.

2 participants