From b559ca3e3ac6c1b66d101a7ee0e13a2b0a45d74e Mon Sep 17 00:00:00 2001 From: lkdvos Date: Fri, 9 Oct 2026 15:08:53 -0400 Subject: [PATCH 1/2] Extend GPUArrays compat to 12 and JLArrays compat to 0.4 Co-Authored-By: Claude Opus 5.5 --- Project.toml | 4 ++-- docs/src/changelog.md | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index f82ce567..3f1c6232 100644 --- a/Project.toml +++ b/Project.toml @@ -51,8 +51,8 @@ ChainRulesTestUtils = "1" DynamicPolynomials = "0.5, 0.6" Enzyme = "0.13.183" EnzymeTestUtils = "0.2" -GPUArrays = "11" -JLArrays = "0.3" +GPUArrays = "11, 12" +JLArrays = "0.3, 0.4" LRUCache = "1" LinearAlgebra = "1.6" Logging = "1.6" diff --git a/docs/src/changelog.md b/docs/src/changelog.md index 399232cc..5e5dc88e 100644 --- a/docs/src/changelog.md +++ b/docs/src/changelog.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Compat with GPUArrays is extended to include 12, and with JLArrays to include 0.4. + ### Deprecated ### Removed From 8cf09bc5994c7511d6a59afc2d419bb2a4aa2fbf Mon Sep 17 00:00:00 2001 From: lkdvos Date: Wed, 28 Oct 2026 09:29:05 -0400 Subject: [PATCH 2/2] Only mark the warm-buffer JLArray contraction as broken before JLArrays v0.4.2 JLArrays v0.4.2 implements `GPUArrays.memory_location` (GPUArrays v12.1), so disjoint slices of a `BufferAllocator` buffer are no longer reported as aliases. Co-Authored-By: Claude Opus 5.5 --- test/allocator.jl | 10 ++++++---- test/gpu.jl | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/test/allocator.jl b/test/allocator.jl index 32d9c3f6..030e4dcc 100644 --- a/test/allocator.jl +++ b/test/allocator.jl @@ -361,17 +361,19 @@ end @test buffer.offset == 0 @test buffer.max_offset > 0 - # Disjoint JLArray slices are reported as aliases once the buffer is warm. + # Disjoint JLArray slices are reported as aliases once the buffer is warm, unless + # JLArrays implements `GPUArrays.memory_location` (JLArrays v0.4.2, GPUArrays v12.1). # https://github.com/JuliaGPU/GPUArrays.jl/pull/803 # https://github.com/QuantumKitHub/StridedViews.jl/pull/57 - @test_broken begin + aliasing_fixed = pkgversion(JLArrays) ≥ v"0.4.2" + @test begin @tensor allocator = buffer begin HRAA3[a, s1, s2, c] := ρₗ[a, a'] * A1[a', t1, b] * A2[b, t2, c'] * ρᵣ[c', c] * H[s1, s2, t1, t2] end collect(HRAA3) ≈ collect(HRAA1) - end - continue # Later checks require the warm-buffer contraction to succeed. + end broken = !aliasing_fixed + aliasing_fixed || continue # Later checks require the warm-buffer contraction to succeed. # the first contraction already recorded the full requirement, so it no longer grows max0 = buffer.max_offset diff --git a/test/gpu.jl b/test/gpu.jl index 0a49ebb9..bc5a5e39 100644 --- a/test/gpu.jl +++ b/test/gpu.jl @@ -183,8 +183,9 @@ end @test buffer.offset == 0 @test buffer.max_offset > 0 - if AT === JLArray - # Disjoint JLArray slices are reported as aliases once the buffer is warm. + if AT === JLArray && pkgversion(JLArrays) < v"0.4.2" + # Disjoint JLArray slices are reported as aliases once the buffer is warm, unless + # JLArrays implements `GPUArrays.memory_location` (JLArrays v0.4.2, GPUArrays v12.1). # https://github.com/JuliaGPU/GPUArrays.jl/pull/803 # https://github.com/QuantumKitHub/StridedViews.jl/pull/57 @test_broken begin