From 14907502f488e847b525a865fde5844182fe0543 Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Tue, 27 Oct 2026 18:14:13 +0000 Subject: [PATCH 1/2] Add an Aqua job to CI and fix what it flags - Drop exports of names that were never defined (SparseArrayCompat, hvcat!, BinaryOps.BinaryOp, BinaryOps.fmod). - Add compat entries for the stdlib dependencies. - Ambiguities are skipped (many pre-existing) and the two unbound-parameter defaultfill methods are marked broken. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 18 ++++++++++++++++++ Project.toml | 8 +++++++- src/SuiteSparseGraphBLAS.jl | 3 +-- src/operators/binaryops.jl | 4 ++-- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b4af766..6861a4f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,6 +40,24 @@ jobs: files: lcov.info token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: false + aqua: + name: Aqua + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: julia-actions/setup-julia@v3 + with: + version: '1' + - uses: julia-actions/cache@v3 + - run: | + julia --color=yes -e ' + using Pkg + Pkg.activate(temp = true) + Pkg.develop(PackageSpec(path = pwd())) + Pkg.add(name = "Aqua", version = "0.8") + using Aqua, SuiteSparseGraphBLAS + # ambiguities: ~190 pre-existing. unbound_args: defaultfill(::Type{Union{T, Nothing/Missing}}). + Aqua.test_all(SuiteSparseGraphBLAS; ambiguities = false, unbound_args = (; broken = true))' docs: name: Documentation runs-on: ubuntu-latest diff --git a/Project.toml b/Project.toml index 6b8c9ed6..5ee4ab6c 100644 --- a/Project.toml +++ b/Project.toml @@ -23,9 +23,15 @@ SuiteSparse = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" Blobs = "1" ChainRulesCore = "1" KLU = "0.6" +Libdl = "1" +LinearAlgebra = "1" MacroTools = "0.5" Preferences = "1" -SSGraphBLAS_jll = "10.5" +Random = "1" +Serialization = "1" +SparseArrays = "1" SpecialFunctions = "2" +SSGraphBLAS_jll = "10.5" StorageOrders = "0.3.2" +SuiteSparse = "1" julia = "1.10" diff --git a/src/SuiteSparseGraphBLAS.jl b/src/SuiteSparseGraphBLAS.jl index 238d8dd7..4a5f0591 100644 --- a/src/SuiteSparseGraphBLAS.jl +++ b/src/SuiteSparseGraphBLAS.jl @@ -109,7 +109,6 @@ include("solvers/klu.jl") include("solvers/umfpack.jl") include("solvers/cholmod.jl") -export SparseArrayCompat export LibGraphBLAS # export UnaryOps, BinaryOps, Monoids, Semirings #Submodules export unaryop, binaryop, Monoid, semiring #UDFs @@ -131,7 +130,7 @@ export firsti, firstj, secondi, secondj #SelectOps not found in Julia/stdlibs export offdiag -export extract, extract!, subassign!, assign!, hvcat! #array functions +export extract, extract!, subassign!, assign! #array functions #operations export select, select!, eadd, eadd!, emul, emul!, gbtranspose, gbtranspose!, diff --git a/src/operators/binaryops.jl b/src/operators/binaryops.jl index 7ac41ea8..f6677e36 100644 --- a/src/operators/binaryops.jl +++ b/src/operators/binaryops.jl @@ -4,9 +4,9 @@ using ..SuiteSparseGraphBLAS: isGxB, isGrB, TypedBinaryOperator, GBType, valid_vec, juliaop, gbtype, symtotype, Itypes, Ftypes, Ztypes, FZtypes, Rtypes, optype, Ntypes, Ttypes, suffix, valid_union, GBArrayOrTranspose, binaryop using ..LibGraphBLAS -export BinaryOp, binaryop +export binaryop -export second, rminus, iseq, isne, isgt, islt, isge, isle, ∨, ∧, lxor, xnor, fmod, +export second, rminus, iseq, isne, isgt, islt, isge, isle, ∨, ∧, lxor, xnor, bxnor, bget, bset, bclr, firsti0, firsti, firstj0, firstj, secondi0, secondi, secondj0, secondj, pair From dc3133afe164a300c6e10cbf4c81e2627ad6e894 Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Tue, 27 Oct 2026 18:19:55 +0000 Subject: [PATCH 2/2] Fix unbound type parameters in defaultfill defaultfill(::Type{Union{T, Nothing}}) where T (and the Missing variant) left T unbound and returned the type T instead of a value. The generic method now strips Nothing/Missing and returns zero of the remaining type. Aqua's unbound_args check is no longer marked broken. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 4 ++-- src/types.jl | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6861a4f6..f76956d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,8 +56,8 @@ jobs: Pkg.develop(PackageSpec(path = pwd())) Pkg.add(name = "Aqua", version = "0.8") using Aqua, SuiteSparseGraphBLAS - # ambiguities: ~190 pre-existing. unbound_args: defaultfill(::Type{Union{T, Nothing/Missing}}). - Aqua.test_all(SuiteSparseGraphBLAS; ambiguities = false, unbound_args = (; broken = true))' + # ambiguities: ~190 pre-existing. + Aqua.test_all(SuiteSparseGraphBLAS; ambiguities = false)' docs: name: Documentation runs-on: ubuntu-latest diff --git a/src/types.jl b/src/types.jl index 930b84a4..61d64232 100644 --- a/src/types.jl +++ b/src/types.jl @@ -991,13 +991,15 @@ StorageOrders.comptime_storageorder(::AbstractGBArray{<:Any, <:Any, O}) where O defaultfill(::Type{T}) where {Te, T <: GBVecOrMat{Te}} = defaultfill(Te) defaultfill(::Type{T}) where {Te, Tf, T <: GBVecOrMat{Te, Tf}} = defaultfill(Tf) -defaultfill(::Type{T}) where T = zero(T) -defaultfill(::Type{Nothing}) = nothing -defaultfill(::Type{Missing}) = missing +# Union{T, Nothing} and Union{T, Missing} default to zero(T) rather than nothing/missing. # This is bold, I'm not sure if I like it... # It boils down to whether we want numeric sparse arrays to be default # or for graph sparse arrays to be default. # I don't think it is onerous for graph algorithm writers to say `GBMatrix{Int64, Nothing}`, # and provides better defaults for other users. -defaultfill(::Type{Union{T, Nothing}}) where T = T -defaultfill(::Type{Union{T, Missing}}) where T = T +function defaultfill(::Type{T}) where T + S = nonmissingtype(Base.nonnothingtype(T)) + return S === T ? zero(T) : defaultfill(S) +end +defaultfill(::Type{Nothing}) = nothing +defaultfill(::Type{Missing}) = missing