Skip to content

Add static StrongWolfe path for OptimizationProblem - #85

Open
AdityaPandeyCN wants to merge 3 commits into
SciML:mainfrom
AdityaPandeyCN:aditya/patch
Open

Add static StrongWolfe path for OptimizationProblem#85
AdityaPandeyCN wants to merge 3 commits into
SciML:mainfrom
AdityaPandeyCN:aditya/patch

Conversation

@AdityaPandeyCN

@AdityaPandeyCN AdityaPandeyCN commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

StrongWolfeLineSearch's static (GPU/SArray/Number) path hardcoded the residual merit ½‖f(u)‖². That is correct for NonlinearProblem, but wrong for minimization: an objective line search needs to test decrease of f itself.
Passing an OptimizationProblem objective through the existing path would silently evaluate ½‖f‖² instead.
This selects the merit by problem type on the static path:

  • AbstractNonlinearProblem --½‖f(u)‖² (unchanged)
  • OptimizationProblem -- f(u) (static-only; non-static u/fu raise ArgumentError)
    Dispatch uses zero-sized mode structs in the cache so the search loop stays branch-free / warp-uniform. grad_f must match the merit: J'f for residual mode, ∇f for scalar mode. Static solve! also accepts a per-call α_max (clamped by the cache); on failure it still returns α_init.

Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
@AdityaPandeyCN
AdityaPandeyCN marked this pull request as draft July 23, 2026 11:38
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
@AdityaPandeyCN
AdityaPandeyCN marked this pull request as ready for review July 23, 2026 11:58
@AdityaPandeyCN

Copy link
Copy Markdown
Contributor Author

@ChrisRackauckas Can you take a look?

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.

1 participant