Remove deepcopy operations from __init path (fixes #747) #763
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.
Summary
deepcopy
withcopy
for matrix A and vector b in the initialization pathdeepcopy
from__init
path. #747 where deepcopy operations prevented trimming from working properlyProblem
The issue reported that there were two uses of
deepcopy
on the main__init
path (lines 324 and 337 insrc/common.jl
), which caused trimming to fail for many LinearSolve cases that are not moved toconst
. This was blocking Julia compilation optimizations.Solution
Recent releases of SciMLOperators.jl now define proper copy operations for SciMLOperators, making it safe to replace
deepcopy
withcopy
. The changes:deepcopy(A)
tocopy(A)
for matrix copyingdeepcopy(b)
tocopy(b)
for vector copyingThis follows the dispatch-based approach suggested in the issue, where
copy
will:Test plan
The failing test is unrelated to these changes and appears to be due to a missing test dependency (
MultiFloats
).🤖 Generated with Claude Code