From a92838b0f50f9cef123e7a3c447bb72d01a76aab Mon Sep 17 00:00:00 2001 From: Katharine Hyatt Date: Tue, 17 Nov 2026 15:37:46 -0500 Subject: [PATCH 1/2] Modernize JET --- test/Project.toml | 2 ++ test/jet.jl | 10 ++++++++++ test/jet/Project.toml | 8 -------- test/jet/jet.jl | 15 --------------- test/runtests.jl | 11 ++++++++++- 5 files changed, 22 insertions(+), 24 deletions(-) create mode 100644 test/jet.jl delete mode 100644 test/jet/Project.toml delete mode 100644 test/jet/jet.jl diff --git a/test/Project.toml b/test/Project.toml index da4df73..4414819 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -5,6 +5,7 @@ AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e" Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" CUDACore = "bd0ed864-bdfe-4181-a5ed-ce625a5fdea2" +JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" JLArrays = "27aeb0d3-9eb9-45fb-866b-73c2ecf80fcb" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Metal = "dde4c033-4e86-420c-a63e-0dd931031962" @@ -19,6 +20,7 @@ StridedViews = {path = ".."} [compat] Aqua = "0.8" +JET = "0.9, 0.10, 0.11, 0.12, 0.13" Pkg = "1" Random = "1" Test = "1" diff --git a/test/jet.jl b/test/jet.jl new file mode 100644 index 0000000..8544593 --- /dev/null +++ b/test/jet.jl @@ -0,0 +1,10 @@ +using Test, JET, StridedViews + +@testset "JET" begin + # also gated in runtests.jl; JET < 0.12 does not define `JET_AVAILABLE` + if isdefined(JET, :JET_AVAILABLE) && JET.JET_AVAILABLE + JET.test_package(StridedViews; target_modules = (StridedViews,)) + else + @info "Full JET functionality is unavailable on Julia $VERSION; skipping JET analysis" + end +end diff --git a/test/jet/Project.toml b/test/jet/Project.toml deleted file mode 100644 index 3a602a5..0000000 --- a/test/jet/Project.toml +++ /dev/null @@ -1,8 +0,0 @@ -name = "StridedViewsJETTest" - -[deps] -JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" -StridedViews = "4db3bf67-4bd7-4b4e-b153-31dc3fb37143" - -[compat] -JET = "0.9, 0.10, 0.11, 0.12, 0.13" diff --git a/test/jet/jet.jl b/test/jet/jet.jl deleted file mode 100644 index 4955531..0000000 --- a/test/jet/jet.jl +++ /dev/null @@ -1,15 +0,0 @@ -@testset "JET" begin - import Pkg - try - Pkg.activate(joinpath(@__DIR__); io = devnull) - Pkg.develop(Pkg.PackageSpec(path = joinpath(@__DIR__, "..", "..")); io = devnull) - Pkg.instantiate(; io = devnull) - @eval import JET - JET.test_package(StridedViews; target_modules = (StridedViews,)) - catch e - e isa Pkg.Types.PkgError || rethrow() - @test_broken false - finally - Pkg.activate(@__DIR__; io = devnull) - end -end diff --git a/test/runtests.jl b/test/runtests.jl index 38c1e0c..64c6896 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -393,4 +393,13 @@ if Metal.functional() end end -!is_buildkite && include("jet/jet.jl") +if !is_buildkite + # JET tests: JET ≥ 0.12 (Julia 1.12+) signals through `JET_AVAILABLE` whether it is functional, + # and loads empty stubs when it is not. Older JET versions, still needed on Julia < 1.12, do not + # define it, hence the `isdefined` check instead of `using JET: JET_AVAILABLE`. + using JET: JET + const jet_new_generation = isdefined(JET, :JET_AVAILABLE) + const jet_available = !jet_new_generation || JET.JET_AVAILABLE + # whole-package analysis is pinned to the JET 0.12 generation, so its reports need not be curated for several JET/Julia combinations + (jet_new_generation && jet_available) && include("jet.jl") +end From 0e9c5248b8d4985fca416fa1285a205418dca394 Mon Sep 17 00:00:00 2001 From: Katharine Hyatt Date: Tue, 17 Nov 2026 16:12:20 -0500 Subject: [PATCH 2/2] Formatter --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 64c6896..4ea43c4 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -393,7 +393,7 @@ if Metal.functional() end end -if !is_buildkite +if !is_buildkite # JET tests: JET ≥ 0.12 (Julia 1.12+) signals through `JET_AVAILABLE` whether it is functional, # and loads empty stubs when it is not. Older JET versions, still needed on Julia < 1.12, do not # define it, hence the `isdefined` check instead of `using JET: JET_AVAILABLE`.