Skip to content

Commit 8cf09bc

Browse files
lkdvosclaude
andcommitted
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 <noreply@anthropic.com>
1 parent b559ca3 commit 8cf09bc

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

‎test/allocator.jl‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,17 +361,19 @@ end
361361
@test buffer.offset == 0
362362
@test buffer.max_offset > 0
363363

364-
# Disjoint JLArray slices are reported as aliases once the buffer is warm.
364+
# Disjoint JLArray slices are reported as aliases once the buffer is warm, unless
365+
# JLArrays implements `GPUArrays.memory_location` (JLArrays v0.4.2, GPUArrays v12.1).
365366
# https://github.com/JuliaGPU/GPUArrays.jl/pull/803
366367
# https://github.com/QuantumKitHub/StridedViews.jl/pull/57
367-
@test_broken begin
368+
aliasing_fixed = pkgversion(JLArrays) ≥ v"0.4.2"
369+
@test begin
368370
@tensor allocator = buffer begin
369371
HRAA3[a, s1, s2, c] := ρₗ[a, a'] * A1[a', t1, b] * A2[b, t2, c'] *
370372
ρᵣ[c', c] * H[s1, s2, t1, t2]
371373
end
372374
collect(HRAA3) ≈ collect(HRAA1)
373-
end
374-
continue # Later checks require the warm-buffer contraction to succeed.
375+
end broken = !aliasing_fixed
376+
aliasing_fixed || continue # Later checks require the warm-buffer contraction to succeed.
375377

376378
# the first contraction already recorded the full requirement, so it no longer grows
377379
max0 = buffer.max_offset

‎test/gpu.jl‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,9 @@ end
183183
@test buffer.offset == 0
184184
@test buffer.max_offset > 0
185185

186-
if AT === JLArray
187-
# Disjoint JLArray slices are reported as aliases once the buffer is warm.
186+
if AT === JLArray && pkgversion(JLArrays) < v"0.4.2"
187+
# Disjoint JLArray slices are reported as aliases once the buffer is warm, unless
188+
# JLArrays implements `GPUArrays.memory_location` (JLArrays v0.4.2, GPUArrays v12.1).
188189
# https://github.com/JuliaGPU/GPUArrays.jl/pull/803
189190
# https://github.com/QuantumKitHub/StridedViews.jl/pull/57
190191
@test_broken begin

0 commit comments

Comments
 (0)