Skip to content

Conversation

topolarity
Copy link
Contributor

Required for --trim compatibility (similar to SciML/NonlinearSolve.jl#684).

I believe these are the only two cases with f in this file.

Required for `--trim` compatibility.
@ChrisRackauckas ChrisRackauckas merged commit a4ad621 into SciML:master Aug 20, 2025
1 check was pending
ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/OrdinaryDiffEq.jl that referenced this pull request Aug 21, 2025
Similar to SciML#2854, this PR adds type specialization for the f parameter in several functions across OrdinaryDiffEq.jl to improve compatibility with --trim and reduce dynamic dispatch.

Functions specialized:
- jacobian scalar fallback in derivative_wrappers.jl
- sparsity_colorvec in derivative_wrappers.jl
- WOperator constructor in derivative_utils.jl
- islinearfunction in derivative_utils.jl
- _compute_rhs in newton.jl
- DAEResidualJacobianWrapper constructor in utils.jl
- Interpolation functions in generic_dense.jl
- verify_f2 functions in symplectic_perform_step.jl

These functions all either call f directly, access fields of f, pass f to other functions, or perform type checks on f, so specialization enables better compiler optimizations.
ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/NonlinearSolve.jl that referenced this pull request Aug 21, 2025
Similar to SciML#684 and SciML/OrdinaryDiffEq.jl#2854, this PR adds type specialization for the f parameter in several functions across NonlinearSolve.jl to improve compatibility with --trim and reduce dynamic dispatch.

Functions specialized:
- _make_py_residual in NonlinearSolveSciPy.jl
- _make_py_scalar in NonlinearSolveSciPy.jl
- dogleg_method!! in trust_region.jl
- construct_jacobian in jacobian_handling.jl (both general and AutoEnzyme versions)

These functions either call f directly, pass f to other functions, or work with f in ways that benefit from type specialization for better compiler optimizations.
ChrisRackauckas pushed a commit to SciML/NonlinearSolve.jl that referenced this pull request Aug 21, 2025
Similar to #684 and SciML/OrdinaryDiffEq.jl#2854, this PR adds type specialization for the f parameter in several functions across NonlinearSolve.jl to improve compatibility with --trim and reduce dynamic dispatch.

Functions specialized:
- _make_py_residual in NonlinearSolveSciPy.jl
- _make_py_scalar in NonlinearSolveSciPy.jl
- dogleg_method!! in trust_region.jl
- construct_jacobian in jacobian_handling.jl (both general and AutoEnzyme versions)

These functions either call f directly, pass f to other functions, or work with f in ways that benefit from type specialization for better compiler optimizations.
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