From b803bb6c887f56941d6524ce05230dd6887d81d0 Mon Sep 17 00:00:00 2001 From: CompatHelper Julia Date: Wed, 8 Oct 2025 01:55:05 +0000 Subject: [PATCH 1/6] CompatHelper: bump compat for JLArrays to 0.3 for package test, (keep existing compat) --- test/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Project.toml b/test/Project.toml index ba11df9..2a8bc6e 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -29,7 +29,7 @@ BlockSparseArrays = "0.10" DerivableInterfaces = "0.5" DiagonalArrays = "0.3" GPUArraysCore = "0.2" -JLArrays = "0.2" +JLArrays = "0.2, 0.3" LinearAlgebra = "1" MatrixAlgebraKit = "0.5" Random = "1" From eda378594a005fc572289fd3746267950e0e0658 Mon Sep 17 00:00:00 2001 From: Matt Fishman Date: Thu, 9 Oct 2025 13:50:20 -0400 Subject: [PATCH 2/6] Bump version from 0.10.8 to 0.10.9 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index acc4379..6b886cd 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "BlockSparseArrays" uuid = "2c9a651f-6452-4ace-a6ac-809f4280fbb4" authors = ["ITensor developers and contributors"] -version = "0.10.8" +version = "0.10.9" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" From f1ebd214df0e682bbba6452e218770f530b0952d Mon Sep 17 00:00:00 2001 From: Matt Fishman Date: Thu, 9 Oct 2025 14:12:57 -0400 Subject: [PATCH 3/6] Adjust tr test for GPU arrays with @allowscalar Use @allowscalar for tr function on GPU arrays. --- test/test_basics.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test_basics.jl b/test/test_basics.jl index 7e897a0..9fd4720 100644 --- a/test/test_basics.jl +++ b/test/test_basics.jl @@ -286,7 +286,9 @@ arrayts = (Array, JLArray) for p in 1:3 @test norm(a, p) ≈ norm(Array(a), p) end - @test tr(a) ≈ tr(Array(a)) + # We use `@allowscalar` here since there seems to be a regression + # in `tr` of GPU arrays for that operation. + @test @allowscalar(tr(a)) ≈ tr(Array(a)) # Empty constructor for a in (dev(BlockSparseArray{elt}(undef)),) From f7ebf6780038a8e70c5ea31b175406fe7860eb61 Mon Sep 17 00:00:00 2001 From: mtfishman Date: Thu, 9 Oct 2025 15:31:08 -0400 Subject: [PATCH 4/6] Skip acosh in tests of missing blocks --- test/test_factorizations.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test_factorizations.jl b/test/test_factorizations.jl index 9446bf5..5e80cf8 100644 --- a/test/test_factorizations.jl +++ b/test/test_factorizations.jl @@ -86,7 +86,8 @@ using Test: @inferred, @test, @test_throws, @testset MATRIX_FUNCTIONS = BlockSparseArrays.MATRIX_FUNCTIONS # These functions involve inverses so they break when there are zeros on the diagonal. MATRIX_FUNCTIONS_SINGULAR = [ - :log, :acsc, :asec, :acot, :acsch, :asech, :acoth, :csc, :cot, :csch, :coth, + :log, :acsc, :asec, :acosh, :acot, :acsch, :asech, :acoth, :csc, :cot, :csch, + :coth, ] MATRIX_FUNCTIONS = setdiff(MATRIX_FUNCTIONS, MATRIX_FUNCTIONS_SINGULAR) # Dense version is broken for some reason, investigate. From 14ac6601d99d5d1f9255e56036e07906583a26e6 Mon Sep 17 00:00:00 2001 From: mtfishman Date: Thu, 9 Oct 2025 16:09:36 -0400 Subject: [PATCH 5/6] Try fixing tests --- test/test_factorizations.jl | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/test/test_factorizations.jl b/test/test_factorizations.jl index 5e80cf8..3bc6c69 100644 --- a/test/test_factorizations.jl +++ b/test/test_factorizations.jl @@ -101,15 +101,13 @@ using Test: @inferred, @test, @test_throws, @testset end end - SINGULAR_EXCEPTION = if VERSION < v"1.11-" - # A different exception is thrown in older versions of Julia. - LinearAlgebra.LAPACKException - else - LinearAlgebra.SingularException - end for f in setdiff(MATRIX_FUNCTIONS_SINGULAR, [:log]) + if VERSION ≥ v"1.12-" && f == :acosh + # Fixed in Julia 1.12. + continue + end @eval begin - @test_throws $SINGULAR_EXCEPTION $f($a) + @test_throws Exception $f($a) end end end From bdeca281d7fcd16fa0c9b96338d222f80737b8b6 Mon Sep 17 00:00:00 2001 From: mtfishman Date: Thu, 9 Oct 2025 16:17:25 -0400 Subject: [PATCH 6/6] Fix tests --- test/test_factorizations.jl | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/test_factorizations.jl b/test/test_factorizations.jl index 3bc6c69..a9188c2 100644 --- a/test/test_factorizations.jl +++ b/test/test_factorizations.jl @@ -101,11 +101,7 @@ using Test: @inferred, @test, @test_throws, @testset end end - for f in setdiff(MATRIX_FUNCTIONS_SINGULAR, [:log]) - if VERSION ≥ v"1.12-" && f == :acosh - # Fixed in Julia 1.12. - continue - end + for f in setdiff(MATRIX_FUNCTIONS_SINGULAR, [:acosh, :log]) @eval begin @test_throws Exception $f($a) end