From c96e87f758ffade02287a6aa25397b5893f6fd29 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Wed, 18 Nov 2026 11:13:17 +0100 Subject: [PATCH] Only count compiled specializations in the launch specialization test On Julia 1.15, calls to `@nospecialize` methods also create method instances for the concrete argument types, without inferring or compiling them. The launch specialization test counted those, so it failed on nightly for every new kernel type although nothing is compiled for it: with_ownership is inlined and the remaining call to with_managed_locks is not specialized. Count only method instances that have code. --- test/execution.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/execution.jl b/test/execution.jl index 0f3888ce..8747869a 100644 --- a/test/execution.jl +++ b/test/execution.jl @@ -112,8 +112,11 @@ end shared = (oneAPI.zefunction_link, oneAPI.launch_kernel, oneL0.set_argument_value!, oneAPI.KernelLinker(Nothing, Tuple{}, (;)), oneAPI.with_managed_locks, oneAPI.with_ownership) + # only count compiled specializations: Julia 1.15 also creates method instances, + # without code, for the argument types of calls to `@nospecialize` methods nspecializations() = - sum(f -> sum(m -> length(collect(Base.specializations(m))), methods(f)), shared) + sum(f -> sum(m -> count(mi -> isdefined(mi, :cache), Base.specializations(m)), + methods(f)), shared) before = nspecializations() for T in (Int32, Int16, UInt8) b = oneArray(zeros(T, 1))