Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: OneSparse/OneSparse
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: OneSparse/OneSparse
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: matrix-sum
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 4 commits
  • 21 files changed
  • 2 contributors

Commits on Jun 18, 2026

  1. Add experimental matrix_sum aggregate using LAGraph_Matrix_Sum

    Adds a matrix_sum aggregate that collects per-row matrix handles and
    performs a single LAGraph_Matrix_Sum (extract-tuples + one GrB_Matrix_build)
    at finalize, as an alternative to matrix_agg's serial pairwise eWiseAdd.
    
    Gated behind WITH_MATRIX_SUM=1 / -DONESPARSE_HAVE_LAGRAPH_MATRIX_SUM since it
    requires the LAGraph matrix-sum branch (GraphBLAS/LAGraph#407); default
    builds against stock LAGraph are unaffected. Dockerfile-debug/test.sh take
    LAGRAPH_REPO/LAGRAPH_REF build args to build against the PR branch.
    
    Includes plus_binaryop() helper and benchmark scripts under bench/.
    
    On a zero-overlap .grb corpus, matrix_sum scales O(N) vs matrix_agg's O(N^2)
    (6.8x at 64 matrices, 39x at 512).
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    michelp and claude committed Jun 18, 2026
    Configuration menu
    Copy the full SHA
    c60c52a View commit details
    Browse the repository at this point in the history

Commits on Jun 25, 2026

  1. Add matrix_binary_sum aggregate using LAGraph_Matrix_Binary_Sum

    Add a third matrix-summing aggregate alongside matrix_agg (serial pairwise
    eWiseAdd) and matrix_sum (single concat + GrB_Matrix_build). matrix_binary_sum
    has the same interface and produces identical results to matrix_sum, but uses
    LAGraph_Matrix_Binary_Sum (a binary reduction tree of eWiseAdds) for a
    different parallel/time/space tradeoff.
    
    - src/matrix/matrix_binary_sum.c: gated behind ONESPARSE_HAVE_LAGRAPH_MATRIX_SUM
      (same LAGraph PR #407 branch as matrix_sum). internal-state sfunc collects
      dup'd handles with a reset-callback for cleanup; finalfunc calls
      LAGraph_Matrix_Binary_Sum. Default dup PLUS, optional binaryop arg.
    - bench/matrix_sum.sql: register 1-arg and 2-arg matrix_binary_sum aggregates.
    - bench/matrix_sum_bench.sql, bench/matrix_sum_grb_bench.sql: assert all three
      engines agree and compare their timings.
    - Dockerfile-debug, test.sh: add LAGRAPH_CACHE_BUST build arg to force a fresh
      LAGraph clone when a branch gains new commits under an unchanged ref (the
      cached clone otherwise lacked the new symbol).
    
    Verified: builds with no warnings, all 33 regression tests pass, and
    matrix_agg = matrix_sum = matrix_binary_sum exactly (default PLUS and MAX dup).
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    michelp and claude committed Jun 25, 2026
    Configuration menu
    Copy the full SHA
    dd25a11 View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2026

  1. Replace matrix_agg(a matrix) with an O(N log N) binary-counter merge

    The matrix-combining matrix_agg(a matrix) folded each row into a running
    accumulator with a single serial GrB_eWiseAdd, which is ~O(N^2) on
    low-overlap data (it re-touches the whole growing accumulator on every
    row). On the graphchallenge corpus it took 477s at K=512 vs 12s for
    matrix_sum, so it occupied no useful corner of the time/space curve.
    
    Reimplement it as a streaming binary-counter merge: a carry array levels[r]
    holds the sum of exactly 2^r already-seen matrices; each input enters at
    rank 0 and is carried up, summing-and-freeing occupied levels, until it
    lands in an empty slot. The occupied levels are folded at finalize. This is
    O(N log N) and frees each input the moment it is absorbed, so it never holds
    all N inputs at once.
    
    The aggregate moves from STYPE=matrix to STYPE=internal with a dedicated
    finalfunc (matrix_agg_combine_final). The per-type element builder
    matrix_agg(i, j, v) and its matrix_agg_final are unchanged. The default dup
    operator changes from TIMES to PLUS, matching matrix_sum and
    matrix_binary_sum, so matrix_agg(a) == matrix_sum(a) == matrix_binary_sum(a).
    It is pure GrB_eWiseAdd, so it ships ungated in the stock extension.
    
    Benchmark (graphchallenge low-overlap corpus): matrix_agg is now ~15x faster
    at K=512 and is the only one of the three engines to reach K=4096 (it is the
    most memory-frugal); matrix_sum OOMs at 4096 and matrix_binary_sum at 1024.
    Results are bit-identical where the engines overlap.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    michelp and claude committed Jun 26, 2026
    Configuration menu
    Copy the full SHA
    982a70a View commit details
    Browse the repository at this point in the history

Commits on Jun 30, 2026

  1. Expose GrB_GLOBAL fields as PostgreSQL GUC parameters

    Adds onesparse.nthreads (GxB_GLOBAL_NTHREADS), onesparse.chunk
    (GxB_GLOBAL_CHUNK), onesparse.print_1based (GxB_PRINT_1BASED), and
    onesparse.hyper_switch (GxB_HYPER_SWITCH) as PGC_USERSET GUCs so users
    can tune SuiteSparse parallelism and format thresholds per-session.
    
    Also adds PGC_POSTMASTER GUCs for all writable JIT fields:
    onesparse.jit_cache_path, onesparse.jit_c_compiler_name,
    onesparse.jit_c_compiler_flags, onesparse.jit_c_linker_flags,
    onesparse.jit_c_libraries, onesparse.jit_c_preface,
    onesparse.jit_error_log, onesparse.jit_use_cmake.
    
    Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
    michelp and claude committed Jun 30, 2026
    Configuration menu
    Copy the full SHA
    d61e821 View commit details
    Browse the repository at this point in the history
Loading