Repository navigation
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 56-udt-jit-edge-cases #665 +/- ##
=========================================================
+ Coverage 98.66% 99.28% +0.62%
=========================================================
Files 109 109
Lines 35869 35852 -17
Branches 4100 4087 -13
=========================================================
+ Hits 35390 35597 +207
+ Misses 254 144 -110
+ Partials 225 111 -114 🚀 New features to boost your workflow:
|
eriknw
force-pushed
the
57-udt-cleanups
branch
from
November 8, 2026 04:51
b85d9a4 to
20ce9b8
Compare
eriknw
force-pushed
the
57-udt-cleanups
branch
3 times, most recently
from
November 9, 2026 15:51
f666203 to
080a941
Compare
eriknw
force-pushed
the
57-udt-cleanups
branch
2 times, most recently
from
November 10, 2026 17:12
5ec2d02 to
427a2fa
Compare
eriknw
force-pushed
the
57-udt-cleanups
branch
14 times, most recently
from
November 11, 2026 05:42
b9fbfa3 to
8387a9e
Compare
eriknw
force-pushed
the
57-udt-cleanups
branch
from
November 12, 2026 06:15
8387a9e to
bc9c687
Compare
eriknw
force-pushed
the
57-udt-cleanups
branch
10 times, most recently
from
November 13, 2026 04:37
5dc0cba to
957e2be
Compare
unify has ignored is_left_scalar and is_right_scalar since a literal is typed before it gets there, so the fill-value and ewise_union calls in Vector, Matrix and Scalar stop passing them.
get_typed_op took is_left_scalar and is_right_scalar only to hand them to unify, which ignores them. Drop them from get_typed_op and from every caller in Vector, Matrix, Scalar and _get_typed_op_from_exprs.
_has_half_leaf, _has_narrow_float_leaf, _has_duration_leaf, _numba_untyped_array_element and _raw_bytes_element each walked records, nested records, arrays of records and arrays of arrays to test each leaf. They now test the leaves dtypes._iter_leaves yields, which walks them the same way. A test checks that a field holding an array of arrays of bool, which numpy keeps unflattened, still gets the message for an array Numba cannot type.
The inner leaves() of _check_leaves_compare was _leaf_dtypes again.
_int_beyond_leaf and _beyond_as_infinity read a literal's parts by the same rules, and the comparison path called the first only to decide whether to call the second. _beyond_as_infinity now returns None when there is no such int, and _int_beyond_leaf goes.
_check_udt_pair and _corresponding_leaves each compared the leaf paths and then the field shapes of two records, one to raise KeyError and one to return a reason. _record_leaf_mismatch now says where they differ, and each caller words it as before. The rules for array UDTs stay apart: operands broadcast, a stored element does not.
eriknw
force-pushed
the
57-udt-cleanups
branch
from
November 13, 2026 04:40
957e2be to
8c960f6
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.
Stacked on #663. Follow-ups to #591 from review. This is a refactor with no change in behavior. Every existing
test passes unchanged, and one test is added.
unify's scalar flags.
dtypes.unifyhas ignoredis_left_scalarandis_right_scalarsince #591, which types a literal before it reaches
unify. The library no longer passesthem:
ewise_unioncalls in Vector, Matrix and Scalar;get_typed_op(ingraphblas.core), which took them only to pass them on and no longertakes them.
unifykeeps both keywords, and its docstring now says it accepts and ignores them.Walkers.
_has_half_leaf,_has_narrow_float_leaf,_has_duration_leaf,_numba_untyped_array_elementand_raw_bytes_elementnow test the leaves of one walker,dtypes._iter_leaves. It walks records, nested records, arrays of records and arrays ofarrays, as each of them did.
_check_leaves_compareuses_leaf_dtypes, which its inner function repeated._int_beyond_leafis gone._beyond_as_infinityread a literal by the same rules. It nowreturns
Nonewhen no int is beyond its leaf's range, so a comparison walks the literalonce.
_check_udt_pairand_corresponding_leavesask_record_leaf_mismatchwhether two recordspair: the same nesting, the same names in the same order, and the same shape for each field.
Each words its reason as before. Array UDTs keep their own rules, which differ on purpose:
operands broadcast, but a stored element does not.
Some walkers stay separate. Each reads a literal by its own rules, and merging them would
change a result:
_refuse_misfit_fields: a non-sequence has no parts._weak_literal_udt's record reader: only a number fills a record, and a wrong lengthrefuses the whole literal.
_nats_in_leaf_units: a list is a sequence of elements._as_record_parts: it turns a dict into a tuple, and keeps a scalar as it is._leaf_dtypes: it treats an array of records as one leaf.Tests. A new row in
test_jit_udt_np_type_numba_cannot_typechecks a field that is anarray of arrays of bool, which numpy keeps unflattened. It still gets the message for an array
Numba cannot type.
A differential check compared the old and new walkers on 362 dtypes:
It also covered 8,014 literal values and 131,044 dtype pairs. All 665,406 results matched on
numpy 1.24.4, 2.1.3, 2.4.6 and 2.5.4. The full suite passes with
--runslowon both backends,without Numba, and with the CI's C-scalar substitution.
Questions for Erik
unify'sis_left_scalarandis_right_scalar(aDeprecationWarningwhen given), or keep accepting them silently?get_typed_opno longer takes the two keywords. It is ingraphblas.core, and nothing in the stack, graphblas-algorithms or nx-graphblas passes them. Accept them again for other callers?graphblas.coreis private._record_leaf_mismatchis the one walker change that adds lines (+21), to put the record pairing rule in one place. Keep it?🤖 Generated with Claude Code