Skip to content

Conversation

RomeoV
Copy link
Contributor

@RomeoV RomeoV commented Aug 20, 2025

This would perhaps have been caught by SciML#665 but we're waiting on
1.12-rc2 and SciML/SciMLBase.jl#1074 to land
before this would be automatically checked.
@ChrisRackauckas
Copy link
Member

we should probably do this everywehere then

@RomeoV
Copy link
Contributor Author

RomeoV commented Aug 20, 2025

Actually it looks like most cases of internalnorm already have the type parameter, see here. I can go through later and see where it's missing still.

Apply consistent `internalnorm::IN` templating to PolyAlgorithm and
GeneralizedFirstOrder __init functions to prevent trimming errors.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@RomeoV
Copy link
Contributor Author

RomeoV commented Aug 20, 2025

Looks like it's just one other location. Fixed now.

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 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.
@RomeoV RomeoV changed the title Fix minor trimming error Specialize on internalnorm function. Aug 25, 2025
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