Skip to content

Keep inferred sources on Julia < 1.12 - #947

Merged
maleadt merged 1 commit into
mainfrom
tb/keep-inferred-sources
Oct 2, 2026
Merged

maleadt merged 1 commit into
mainfrom
tb/keep-inferred-sources

Conversation

@maleadt

@maleadt maleadt commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Before Julia 1.12, codegen itself looks up callees in our cache. If Julia discarded a callee's inferred source (for example, a non-inlineable @nospecialize helper with a non-compileable signature), jl_compile_workqueue re-inferred it with the native interpreter, bypassing our method tables. This PR keeps inferred sources on those versions by setting may_discard_trees to false before 1.12.0-DEV.1823. Later versions already recover discarded sources with our interpreter.

As a result, Julia 1.10 now compiles @nospecialize calls without a dynamic jl_invoke, as 1.11 and later already do. The test that expected a dynamic invoke on 1.10 now checks the same behavior on all versions.

Split from #940. Before Julia 1.12, the Julia IR passes added there (#948) don't see callees re-inferred by the native interpreter. Without this PR, such callees stay dynamic calls on 1.10, as on main, so the stack doesn't depend on it.

GPUCompiler's native tests pass on Julia 1.10 and 1.11. The full suite passes on 1.10 and 1.11 together with the #940 stack.

Before Julia 1.12, codegen itself looks up callees in our cache. If Julia discarded a
callee's inferred source (for example, a non-inlineable `@nospecialize` helper with a
non-compileable signature), `jl_compile_workqueue` re-inferred it with Julia's native
interpreter, bypassing our method tables. Keep inferred sources on those versions. This
also lets Julia 1.10 compile `@nospecialize` calls without a dynamic `jl_invoke`, as 1.11
and later already do.
@codecov

codecov Bot commented Sep 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.39%. Comparing base (70ad652) to head (81d46eb).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #947      +/-   ##
==========================================
+ Coverage   86.32%   86.39%   +0.06%     
==========================================
  Files          29       29              
  Lines        5756     5756              
==========================================
+ Hits         4969     4973       +4     
+ Misses        787      783       -4     

☔ View full report in Codecov by Harness.
📢 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.

@maleadt
maleadt merged commit cbf0609 into main Oct 2, 2026
31 of 33 checks passed
@maleadt
maleadt deleted the tb/keep-inferred-sources branch October 2, 2026 10:23
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