Forward solver kwargs to CMAEvolutionStrategy#1227
Merged
ChrisRackauckas merged 2 commits intoJun 16, 2026
Conversation
`__map_optimizer_args` for `OptimizationCMAEvolutionStrategy` dropped any extra solver kwargs, so options like `popsize`, `noise_handling`, etc. were unreachable through Optimization.jl (issue SciML#1226). Add a `kwargs...` capture and forward it to `CMAEvolutionStrategy.minimize`, matching the pattern used by OptimizationBBO/OptimizationEvolutionary. `sigma0` is the positional `s0` (initial step size) of `minimize`, so it is pulled from `solver_args` in `__solve` and passed positionally (default 0.1), while being captured in `__map_optimizer_args` to keep it out of the forwarded kwargs. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
ChrisRackauckas
approved these changes
Jun 15, 2026
Aqua's deps/compat check (check_extras) requires a [compat] entry for every package in [extras]. Test was listed in [extras] but had no compat bound, so the sublibrary QA group failed on the deps_compat assertion. Add Test = "1" to fix it. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 #1226.
Problem
__map_optimizer_argsforOptimizationCMAEvolutionStrategydid not forward extra solver kwargs toCMAEvolutionStrategy.minimize, so options likepopsize,sigma0(#1074),noise_handling,seed, etc. were unreachable through Optimization.jl. The equivalent methods forOptimizationBBOandOptimizationEvolutionarydo forward kwargs.Fix
kwargs...capture to__map_optimizer_argsand splat it into the mapped args, matching the OptimizationBBO/OptimizationEvolutionary pattern. Explicitly-mapped args (lower,upper,logger,maxiter,maxtime,ftol) are applied after the user kwargs so they still take precedence.sigma0is the positionals0argument ofminimize(the initial step size, previously hardcoded to0.1), so it cannot ride along in the kwargs. It is now pulled fromsolver_argsin__solveand passed positionally (default0.1), and is captured (but unused) in__map_optimizer_argsso it doesn't leak into the forwarded kwargs.Tests
Added a
solver kwargs are forwardedtestset verifying:popsize = 20is reflected insol.original.p.λ,sigma0 = 0.5runs and returns a valid retcode.Full package test suite passes locally (16/16).
QA group
Also declares a
Test = "1"[compat]entry in this sublibrary'sProject.toml.Testwas already listed in[extras]but had no compat bound, so Aqua'sdeps_compat(check_extras) assertion failed the sublibrary QA group. This fixes the extras-compat finding. Verified locally (CI-equivalent develop +Pkg.test,OPTIMIZATION_TEST_GROUP=QA):Pre-existing QA-lts failure NOT addressed here (out of scope)
On Julia < 1.11, the QA-lts job still reports two Aqua findings —
Stale dependenciesanddeps-compat forOptimizationLBFGSB/OptimizationManopt. These are not introduced by this PR and reproduce identically onmaster. Root cause:lib/OptimizationBase/Project.tomldeclares a[sources]table for its test-only depsOptimizationLBFGSB/OptimizationManopt, and the centralizedSciML/.githubtests.yml"develop in-repo [sources]" helper walks the[sources]graph transitively on Julia < 1.11 — so when any sublibrary developsOptimizationBase, those two test-only path-deps getPkg.developed into the sublibrary's environment as phantom direct deps, which Aqua then flags. On Julia ≥ 1.11 the helper is a no-op, which is why QA / Julia 1 is green. The proper fix belongs inOptimizationBase(don't expose test-only[sources]) or in the.githubdevelop helper (don't transitively develop a dep's test[sources]), and affects every OptimizationBase-dependent sublibrary — out of scope for a CMAES-kwargs PR.Please ignore until reviewed by @ChrisRackauckas.
Co-Authored-By: Chris Rackauckas accounts@chrisrackauckas.com