Skip to content

fix: fix reference used for inline linear SCC diffcache#54

Merged
AayushSabharwal merged 1 commit into
mainfrom
as/fix-diffcache-reference
Mar 26, 2026
Merged

fix: fix reference used for inline linear SCC diffcache#54
AayushSabharwal merged 1 commit into
mainfrom
as/fix-diffcache-reference

Conversation

@AayushSabharwal
Copy link
Copy Markdown
Member

@AayushSabharwal AayushSabharwal commented Mar 26, 2026

PreallocationTools.get_tmp needs a value passed to it to know whether to return a dual buffer or not. Previously, findfirst(!SU.isconst, A) ignored the fact that A isa Matrix{Num} and needs unwrap. However, !isconst will still find parameters, which won't be duals even if unknowns are. iscall suffers from the same problem. Using search_variables! and/or query to find entries of A/b with unknowns is expensive. This approach prefers to find a differential variable and use that. The downside is that this may use a dual buffer even if A or b don't have duals, but shouldn't be too bad.

@AayushSabharwal AayushSabharwal merged commit 0848284 into main Mar 26, 2026
11 of 23 checks passed
@AayushSabharwal AayushSabharwal deleted the as/fix-diffcache-reference branch March 26, 2026 09:14
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