Repository navigation
Use DEFAULT_CALLBACK const in SciPy/Sophia/NLopt/Metaheuristics __init - #1412
ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
Anonymous (args...) -> (false) defaults get a new type through the kwarg sorter, so init with/without kwargs disagree and a second solve recompiles. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Cursor Agent <noreply@cursor.com> Agent-Harness: Cursor Agent 2026.10.01-14929f9 Agent-Model: unknown (Cursor auto) Agent-Session: local session, transcript /home/crackauc/sandbox/goals/performance/jobs/opt/opt-defcb2/log.txt on amdci2
Independent review (Devin CLI 3000.11.3, model fusion-claude-opus-5-5-high-sidekick-swe-2-medium): MERGE, risk low. Full reviewVERDICT: MERGE PR: #1412 (head e266d06). This PR changes the default Blocking findingsNone. Non-blocking findings
What I ranAll runs used Julia 1.11.8 on macOS arm64. I wrote
Probe results:
Real test suites, with
I also read the PR's CI with Afterwards I deleted the What I did not verify
🤖 Posted by an AI agent — harness: Devin CLI 3000.11.3 (review), Claude Code 2.1.285 (posting) · model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium |
Summary
Follow-up to #1407 for the remaining four wrappers that still defaulted
callbackto a fresh anonymous(args...) -> (false)in__init. Through Julia's keyword sorter that default is re-evaluated with a different type, sotypeof(init(prob, alg)) != typeof(init(prob, alg; maxiters=100))and a secondsolvethat adds a kwarg recompiles the chain. Point each default at the exported publicOptimizationBase.DEFAULT_CALLBACK(NullCallback; same form as MadNLP/ODE/PRIMA and #1407). Callback call sites already usecallback(opt_state, x...), whichNullCallbackaccepts.Measurements (amdci2, process CPU via
/proc/self/statutime+stime,OPENBLAS_NUM_THREADS=1,JULIA_NUM_THREADS=1,taskset -c 2, 5 alternating master/PR fresh processes)OptimizationNLopt Rosenbrock +
NLopt.LN_NELDERMEAD+ ForwardDiff:maxiters=100OptimizationMetaheuristics Rosenbrock +
Metaheuristics.ECA:maxiters=100First-solve: no clear regression. Second-solve with kwargs: clear win for both (~0.43→0.14 s NLopt; ~0.53→0.14 s Metaheuristics).
OptimizationSophia / OptimizationSciPy: same source change; SciPy could not be loaded locally (PythonCall/CondaPkg
pixi installfailed in the test temp env despite systemscipy1.15.3). Sophiainittype-stability regression test passes inside its Core suite.Regression test
typeof(init(...)) == typeof(init(...; maxiters=100))in each sublib'stest/core_tests.jl.var"#…#…"callback types (before.txtfor NLopt + Metaheuristics)after.txt); also PASS on Julia 1.10.12 for NLopt + MetaheuristicsTest-group tails
Core | 43 Pass; tests passedCore | 51 Pass; tests passedQuality Assurance | 27 Pass; tests passedQuality Assurance | 68 Pass, 1 Broken; tests passedQuality Assurance | 20 Pass, 1 Broken; tests passedtest/qa):Quality Assurance | 21 Pass3 Pass, 1 Fail— failure is pre-existing neural-ODE10 * res1.objective < l1atcore_tests.jl:72, not the new DEFAULT_CALLBACK test (which Passes). Not attributed to this change.Not verified
pixi installfailed)@benchmark(compile-time / type-stability fix; numbers are process CPU)Reviewer pushback
allowscallback = false— is fixing its anonymous default still worth it forinitcache type stability alone? (measured second-solve win says yes)Please ignore until reviewed by @ChrisRackauckas.
Risk assessment
Independent review: pending
🤖 Generated with Cursor Agent 2026.10.01-14929f9 (model: unknown (Cursor auto)), transcript /home/crackauc/sandbox/goals/performance/jobs/opt/opt-defcb2/log.txt on amdci2; orchestrated by Claude Code (claude-opus-5-5[1m]) https://claude.ai/code/session_01LPHREnnonfLg1VcE1EJovv
Made with Cursor
Independent review: Devin Fusion (fusion-claude-opus-5-5-high-sidekick-swe-2-medium) rated it low, verdict MERGE: #1412 (comment)