Skip to content

Avoid specializing drop_expr on concrete RGF types - #144

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:agent/rebase-pr-123
Aug 20, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:agent/rebase-pr-123

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

What changed and why

This supersedes #123, whose contributor-fork head cannot be updated by the currently authenticated account. The commit retains Kristoffer Carlsson as author.

drop_expr previously specialized on every concrete RuntimeGeneratedFunction type, including its expression ID, compiling a new method instance for each generated function. This adds a specialization barrier, extracts the required type parameters through small helpers, and preserves the current thread-safe _BodyCache accessors.

Regression evidence

Unfixed master, with the new test applied:

env GROUP=Core timeout 3600 julia +1.10 --startup-file=no --project=. -e "using Pkg; Pkg.test()"
Test Failed at test/core_tests.jl:147
  Expression: specializations == 0
   Evaluated: 20 == 0

The same command with this fix:

Testing RuntimeGeneratedFunctions tests passed

Verification

GROUP=Core julia +1.10 --project=. -e "using Pkg; Pkg.test()"
Testing RuntimeGeneratedFunctions tests passed

GROUP=Core julia +release --project=. -e "using Pkg; Pkg.test()"
Testing RuntimeGeneratedFunctions tests passed

GROUP=Core julia +1.13 --project=. -e "using Pkg; Pkg.test()"
Testing RuntimeGeneratedFunctions tests passed

GROUP=QA julia +1.10 --project=. -e "using Pkg; Pkg.test()"
QA | 18 passed / 18 total

GROUP=QA julia +release --project=. -e "using Pkg; Pkg.test()"
QA | 20 passed / 20 total

julia +release --project=docs docs/make.jl
Documenter completed doctests, document checks, link checks, and HTML rendering successfully.

julia +release --project=<Runic package> -m Runic --check --diff .
No output; exit status 0.

typos src/RuntimeGeneratedFunctions.jl test/core_tests.jl test/shared/drop_expr_specializations.jl
No output; exit status 0.

Not verified locally

  • macOS and Windows runners
  • 32-bit Julia

Reviewer judgment call

The regression test uses Julias documented --trace-compile CLI output in a fresh subprocess and asserts that calls over 20 distinct RGF types emit no concrete drop_expr precompile statements. This directly detects the compilation blow-up without relying on private compiler-introspection APIs.

Ignore this PR until it has been reviewed by @ChrisRackauckas.

Extract the type parameters behind a specialization barrier and retain the current thread-safe cache accessors. Add a trace-compile regression test covering many distinct RGF types.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review August 20, 2026 10:07
@ChrisRackauckas
ChrisRackauckas merged commit 7a5642a into SciML:master Aug 20, 2026
6 checks passed
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.

3 participants