From b5772ea21209490257eb7043d3963a0e2824cb22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20M=C3=BCller-Widmann?= Date: Fri, 16 Oct 2026 16:29:37 +0200 Subject: [PATCH] Mark JLArray `reverse` tests broken with JLArrays 0.4.2 and GPUArrays 12.1.1 GPUArrays 12.1.1 implements `reverse` of GPU vectors with AcceleratedKernels, whose kernels are unavailable on the JLArrays backend ("This kernel is unavailable for backend CPU"). The JLArrays methods that avoid this path are not released yet: the registered JLArrays 0.4.2 lacks them (JuliaGPU/GPUArrays.jl#817). Check whether `reverse(::JLArray)` actually works instead of where the method is defined, which also covers JLArrays < 0.4. Co-Authored-By: Claude Opus 5.5 --- test/rulesets/Base/array.jl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/rulesets/Base/array.jl b/test/rulesets/Base/array.jl index acb207b08..5120b2677 100644 --- a/test/rulesets/Base/array.jl +++ b/test/rulesets/Base/array.jl @@ -276,8 +276,14 @@ end @test_skip test_rrule(reverse, Tuple(rand(10))) # Ambiguity in isapprox, https://github.com/JuliaDiff/ChainRulesTestUtils.jl/issues/229 end @testset "Array" begin - # JLArrays ≥ 0.4 implements `reverse` without scalar indexing - jl_has_reverse = parentmodule(reverse, Tuple{JLArray{Float32,1}}) !== Base + # `reverse(::JLArray)` fails with JLArrays < 0.4 (scalar indexing) and with + # JLArrays 0.4.2 and GPUArrays 12.1.1, which calls AcceleratedKernels whose kernels + # are unavailable on JLArrays' backend (JuliaGPU/GPUArrays.jl#817) + jl_has_reverse = try + reverse(JLArray([1.0f0, 2.0f0])) isa JLArray + catch + false + end # Forward if jl_has_reverse