Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

Extend the wrong-kind mask guard to dup and whole-object update - #614

Open
eriknw wants to merge 1 commit into
49-masked-literal-assignfrom
34-mask-guard-dup-update
Open

eriknw wants to merge 1 commit into
49-masked-literal-assignfrom
34-mask-guard-dup-update

Conversation

@eriknw

@eriknw eriknw commented Aug 4, 2026

Copy link
Copy Markdown
Member

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:, : << 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 💬

@eriknw
eriknw marked this pull request as ready for review August 4, 2026 16:07
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch 2 times, most recently from 5e95d6b to 53549cd Compare August 5, 2026 00:06
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch from 53549cd to 4f02903 Compare August 5, 2026 03:18
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch from 4f02903 to 16184fb Compare August 5, 2026 17:44
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch from 16184fb to 7231bc7 Compare August 5, 2026 18:03
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch from 7231bc7 to be3ba76 Compare August 5, 2026 18:05
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch from be3ba76 to 9a88a91 Compare August 6, 2026 07:59
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch from 9a88a91 to e92ec62 Compare August 6, 2026 15:39
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch from e92ec62 to ca732f2 Compare August 6, 2026 15:41
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch 2 times, most recently from 7817be7 to d90065c Compare August 6, 2026 20:41
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch from d90065c to 6303f42 Compare August 7, 2026 02:49
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch from 6303f42 to 587692a Compare August 7, 2026 05:09
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch from 587692a to 13b1b1d Compare August 26, 2026 17:30
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch from 13b1b1d to da8e30c Compare September 18, 2026 03:09
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch 2 times, most recently from 0d96d02 to fedf9d1 Compare September 25, 2026 06:10
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch from fedf9d1 to 35ae7e6 Compare September 26, 2026 05:23
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch 2 times, most recently from 3238f33 to 5f9bb0e Compare September 27, 2026 15:40
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch 2 times, most recently from 35df8dd to 86f8da7 Compare October 1, 2026 17:11
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch 2 times, most recently from 648226c to 70fc1b4 Compare October 3, 2026 04:57
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch 2 times, most recently from c9677cc to 426735f Compare October 4, 2026 06:21
@eriknw
eriknw removed this pull request from stack #634 October 8, 2026 21:02
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch from 426735f to 7d6d830 Compare October 8, 2026 21:40
@eriknw
eriknw added this pull request to stack #635 October 8, 2026 21:46
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch from 7d6d830 to 4542378 Compare October 9, 2026 03:06
@eriknw
eriknw force-pushed the 34-mask-guard-dup-update branch 2 times, most recently from 58a1a9c to 7b22012 Compare October 14, 2026 18:45
@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.71%. Comparing base (df34b4c) to head (4e58c06).

Additional details and impacted files
@@                     Coverage Diff                      @@
##           49-masked-literal-assign     #614      +/-   ##
============================================================
+ Coverage                     98.63%   98.71%   +0.08%     
============================================================
  Files                           106      106              
  Lines                         31397    31443      +46     
  Branches                       3636     3637       +1     
============================================================
+ Hits                          30968    31040      +72     
+ Misses                          278      265      -13     
+ Partials                        151      138      -13     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant