Skip to content

Avoid MArrays with FiniteDiff backend#1019

Draft
dingraha wants to merge 1 commit into
JuliaDiff:mainfrom
dingraha:avoid_marrays
Draft

Avoid MArrays with FiniteDiff backend#1019
dingraha wants to merge 1 commit into
JuliaDiff:mainfrom
dingraha:avoid_marrays

Conversation

@dingraha
Copy link
Copy Markdown

I noticed some allocations when using FiniteDiff with StaticArrays that I eventually traced to calls to similar in the FiniteDiff extension. Adding the check for immutable input or output arrays seemed to fix this. Haven't attempted to add tests for this—wanted to get some feedback before diving in. What do you think?

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.60%. Comparing base (cbfeb7c) to head (5c8e123).

❗ There is a different number of reports uploaded between BASE (cbfeb7c) and HEAD (5c8e123). Click for more details.

HEAD has 118 uploads less than BASE
Flag BASE (cbfeb7c) HEAD (5c8e123)
DIT 25 4
DI 116 19
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1019       +/-   ##
===========================================
- Coverage   98.14%   87.60%   -10.54%     
===========================================
  Files         138      135        -3     
  Lines        8131     8078       -53     
===========================================
- Hits         7980     7077      -903     
- Misses        151     1001      +850     
Flag Coverage Δ
DI 86.77% <100.00%> (-12.10%) ⬇️
DIT 89.83% <ø> (-6.40%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gdalle
Copy link
Copy Markdown
Member

gdalle commented May 21, 2026

Nice catch! The alternative would be replacing similar with copy, does that work on SArrays too?

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