Extend the wrong-kind mask guard to dup and whole-object update - #614
Open
eriknw wants to merge 1 commit into
Open
Extend the wrong-kind mask guard to dup and whole-object update#614eriknw wants to merge 1 commit into
eriknw wants to merge 1 commit into
Conversation
eriknw
marked this pull request as ready for review
August 4, 2026 16:07
eriknw
force-pushed
the
34-mask-guard-dup-update
branch
2 times, most recently
from
August 5, 2026 00:06
5e95d6b to
53549cd
Compare
eriknw
force-pushed
the
34-mask-guard-dup-update
branch
from
August 5, 2026 03:18
53549cd to
4f02903
Compare
eriknw
force-pushed
the
34-mask-guard-dup-update
branch
from
August 5, 2026 17:44
4f02903 to
16184fb
Compare
eriknw
force-pushed
the
34-mask-guard-dup-update
branch
from
August 5, 2026 18:03
16184fb to
7231bc7
Compare
eriknw
force-pushed
the
34-mask-guard-dup-update
branch
from
August 5, 2026 18:05
7231bc7 to
be3ba76
Compare
eriknw
force-pushed
the
34-mask-guard-dup-update
branch
from
August 6, 2026 07:59
be3ba76 to
9a88a91
Compare
eriknw
force-pushed
the
34-mask-guard-dup-update
branch
from
August 6, 2026 15:39
9a88a91 to
e92ec62
Compare
eriknw
force-pushed
the
34-mask-guard-dup-update
branch
from
August 6, 2026 15:41
e92ec62 to
ca732f2
Compare
eriknw
force-pushed
the
34-mask-guard-dup-update
branch
2 times, most recently
from
August 6, 2026 20:41
7817be7 to
d90065c
Compare
eriknw
force-pushed
the
34-mask-guard-dup-update
branch
from
August 7, 2026 02:49
d90065c to
6303f42
Compare
A.dup(mask=v.S) and C(mask=v.S) << A assign with C(mask)[...] = A,
which builds a __setitem__ expression, so the strict mask-kind check
in BaseType._update did not apply and a Vector mask on a Matrix
output reached GrB_Matrix_assign, leaking a raw cffi error:
TypeError: Error calling GrB_Matrix_assign: ... initializer for
ctype 'struct GB_Matrix_opaque *' must be a pointer to same type,
not cdata 'struct GB_Vector_opaque *'
Validate the mask kind in the Matrix-valued branch of
Matrix._prep_for_assign, mirroring the guard the Vector-valued
branch already has. This also covers C(v.S)[:, :] << A and the
submask form C[:, :](v.S) << A. Row and column assignment with a
Vector mask (C(v.S)[0, :] << w and friends) is handled in earlier
branches and remains valid.
The guard keys on mask.parent.ndim rather than exact type, the same
idiom _check_mask uses, so a Vector subclass's mask is caught too. Two
pre-existing guards in the Vector-valued branch and one more in the
scalar path still use exact-type checks and carry the same subclass
hole; they predate this commit and are left for their own change.
eriknw
force-pushed
the
34-mask-guard-dup-update
branch
from
August 7, 2026 05:09
6303f42 to
587692a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A.dup(mask=v.S) and C(mask=v.S) << A assign with C(mask)[...] = A,
which builds a setitem expression, so the strict mask-kind check
in BaseType._update did not apply and a Vector mask on a Matrix
output reached GrB_Matrix_assign, leaking a raw cffi error:
Validate the mask kind in the Matrix-valued branch of
Matrix._prep_for_assign, mirroring the guard the Vector-valued
branch already has. This also covers C(v.S)[:, :] << A and the
submask form C:, : << A. Row and column assignment with a
Vector mask (C(v.S)[0, :] << w and friends) is handled in earlier
branches and remains valid.
The guard keys on mask.parent.ndim rather than exact type, the same
idiom _check_mask uses, so a Vector subclass's mask is caught too. Two
pre-existing guards in the Vector-valued branch and one more in the
scalar path still use exact-type checks and carry the same subclass
hole; they predate this commit and are left for their own change.
Stack created with GitHub Stacks CLI • Give Feedback 💬