Skip to content

Conversation

@giordano
Copy link
Contributor

@giordano giordano commented Jan 10, 2026

Using script from JuliaLang/julia#60478
The seven four remaining boxes are

var func sig location
changed #emit_llvm#92 Tuple{GPUCompiler.var"##emit_llvm#92", Base.Pairs{Symbol, V, Nothing, NT} where {V, NT<:NamedTuple}, typeof(GPUCompiler.emit_llvm), CompilerJob} src/driver.jl:182
config #emit_llvm#92 Tuple{GPUCompiler.var"##emit_llvm#92", Base.Pairs{Symbol, V, Nothing, NT} where {V, NT<:NamedTuple}, typeof(GPUCompiler.emit_llvm), CompilerJob} src/driver.jl:182
dyn_entry_fn #emit_llvm#92 Tuple{GPUCompiler.var"##emit_llvm#92", Base.Pairs{Symbol, V, Nothing, NT} where {V, NT<:NamedTuple}, typeof(GPUCompiler.emit_llvm), CompilerJob} src/driver.jl:182
localUnique @device_code Tuple{GPUCompiler.var"#@device_code", LineNumberNode, Module, Vararg{Any}} src/reflection.jl:364

I attempted to fix the first three in src/driver.jl, but it was a mess because changed, config and dyn_entry_fn are captured by a get!() do in

dyn_entry_fn = get!(jobs, dyn_job) do
target = nest_target(dyn_job.config.target, job.config.target)
params = nest_params(dyn_job.config.params, job.config.params)
config = CompilerConfig(dyn_job.config; toplevel=false, target, params)
dyn_ir, dyn_meta = codegen(:llvm, CompilerJob(dyn_job; config))
dyn_entry_fn = LLVM.name(dyn_meta.entry)
merge!(compiled, dyn_meta.compiled)
@assert context(dyn_ir) == context(ir)
link!(ir, dyn_ir)
changed = true
dyn_entry_fn
end
and I couldn't come up with a solution. I don't understand what's wrong with job. runtime_fns and runtime_intrinsics should be fixable [Edit: job, runtime_fns, and runtime_intrinsics are all fixed now], but localUnique in
macro device_code(ex...)
localUnique = 1
function hook(job::CompilerJob; dir::AbstractString)
name = job.source.def.name
fn = "$(name)_$(localUnique)"
mkpath(dir)
open(joinpath(dir, "$fn.lowered.jl"), "w") do io
code = only(code_lowered(job))
println(io, code)
end
open(joinpath(dir, "$fn.typed.jl"), "w") do io
code = only(code_typed(job; debuginfo=:source))
println(io, code)
end
open(joinpath(dir, "$fn.unopt.ll"), "w") do io
code_llvm(io, job; dump_module=true, raw=true, optimize=false)
end
open(joinpath(dir, "$fn.opt.ll"), "w") do io
code_llvm(io, job; dump_module=true, raw=true)
end
open(joinpath(dir, "$fn.asm"), "w") do io
code_native(io, job; dump_module=true, raw=true)
end
localUnique += 1
end
emit_hooked_compilation(hook, ex...)
end
is a bit evil because it's purposefully captured, no clue of what to do with it without invasive changes to the hook business.

Note: most tests pass for me when I run them with Pkg.test, except for native/kwcall inference + overlay method (which fails for me also on main so I don't think it's my fault) and ptx, which crashes the worker without an error message, but when I run the script test/ptx.jl standalone (with the test init code added at the beginning) the test is successful, so I have little clue of what's the issue there:

% julia --startup-file=no --project --check-bounds=yes ptx.jl
Test Summary: | Pass  Total  Time
IR            |   18     18  5.8s

Edit: resolved.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 10, 2026

Your PR no longer requires formatting changes. Thank you for your contribution!

@giordano

This comment was marked as resolved.

@giordano

This comment was marked as resolved.

@codecov
Copy link

codecov bot commented Jan 10, 2026

Codecov Report

❌ Patch coverage is 53.23741% with 65 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.28%. Comparing base (da0be16) to head (32c335b).

Files with missing lines Patch % Lines
src/irgen.jl 52.43% 39 Missing ⚠️
src/mcgen.jl 0.00% 15 Missing ⚠️
src/metal.jl 71.87% 9 Missing ⚠️
src/driver.jl 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #751      +/-   ##
==========================================
- Coverage   74.79%   73.28%   -1.52%     
==========================================
  Files          24       24              
  Lines        3666     3668       +2     
==========================================
- Hits         2742     2688      -54     
- Misses        924      980      +56     

☔ 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.

@maleadt
Copy link
Member

maleadt commented Jan 13, 2026

Do these hurt performance? I intentionally wrote the code as such, e.g., keeping the check_user lambda close to its only relevant use case instead of defining a global function (there's no possibility for reuse). Same with scan_uses! and rewrite_uses!. As much as I appreciate performance work, code maintainability is important as well...

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