Skip to content

Finish pending work before ss.sort - #720

Open
eriknw wants to merge 1 commit into
python-graphblas:mainfrom
eriknw:fix-sort-pending
Open

eriknw wants to merge 1 commit into
python-graphblas:mainfrom
eriknw:fix-sort-pending

Conversation

@eriknw

@eriknw eriknw commented Nov 30, 2026

Copy link
Copy Markdown
Member

In non-blocking mode, Matrix.ss.sort and Vector.ss.sort of an object built only by setting
elements returned its values unsorted and an empty permutation:

A = Matrix(int, 2, 3)
A[0, 1] = 3
A[1, 2] = 1
A[1, 0] = 2
values, perm = A.ss.sort()
# values [[0, 3, 0], [2, 0, 1]] as dense; perm has no entries
# expected [[3, 0, 0], [1, 2, 0]] and perm [[1, -, -], [2, 0, -]]

Setting elements leaves them as pending tuples, and SuiteSparse:GraphBLAS (10.5.3) sorts such an
object as if it had no entries yet. A Vector with both zombies and pending tuples sorted wrong
too; a Matrix that already had entries, or one with only zombies or unsorted indices, sorted
correctly. Both sorts now wait on the input first. That changes no
values and costs about 0.4 us when there is nothing to finish.

🤖 Generated with Claude Code

Matrix.ss.sort and Vector.ss.sort of an object made only of pending tuples, as
setting elements leaves it in non-blocking mode, returned its values unsorted and
an empty permutation: SuiteSparse:GraphBLAS 10.5.3 sorts the object as if it had
no entries yet. Both now wait on the input first, which changes no values and
costs about 0.4 us when there is nothing to finish.
@codecov

codecov Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.35%. Comparing base (c23dc85) to head (8703873).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #720      +/-   ##
==========================================
+ Coverage   99.32%   99.35%   +0.03%     
==========================================
  Files         106      106              
  Lines       33169    33205      +36     
  Branches     3843     3844       +1     
==========================================
+ Hits        32945    32992      +47     
+ Misses        148      142       -6     
+ Partials       76       71       -5     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant