Skip to content

fix: infer the inline linear SCC cache type so the solve is a static call - #176

Open
AJ0070 wants to merge 1 commit into
JuliaComputing:mainfrom
AJ0070:fix/inline-scc-cache-inferred
Open

AJ0070 wants to merge 1 commit into
JuliaComputing:mainfrom
AJ0070:fix/inline-scc-cache-inferred

Conversation

@AJ0070

@AJ0070 AJ0070 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

The cache lookup in numeric_ldiv! returns Any, so the solve_into! after it dispatched at runtime, the dynamic call #175 found. The cache type is now inferred from init_inline_linsolve_cache! with Base.promote_op and asserted on the lookup, so the call is static for Float64 and Duals, and the cache stays.

With the call static, a juliac --trim=safe build of the solve reaches LinearSolve's default algorithm, which has two unresolved calls of its own, fixed in SciML/LinearSolve.jl#1408. With both PRs the solve path has no verifier errors; the ones left come from loading ModelingToolkitTearing and are there on main too. JET's report_opt also flags LinearSolve branches that aren't compiled for this solve, such as the adjoint solve, so it overstates what's left.

The new test checks that numeric_ldiv! makes no dynamic calls; it fails on main. StateSelection and ModelingToolkitTearing tests pass on 1.12 and 1.13.

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