Skip to content

fix: pass the right input type to awkward_NumpyArray_subrange_equal* kernels#3818

Merged
ikrommyd merged 3 commits intoscikit-hep:mainfrom
ikrommyd:correct-subrange-equal-bool-call
Jan 28, 2026
Merged

fix: pass the right input type to awkward_NumpyArray_subrange_equal* kernels#3818
ikrommyd merged 3 commits intoscikit-hep:mainfrom
ikrommyd:correct-subrange-equal-bool-call

Conversation

@ikrommyd
Copy link
Copy Markdown
Collaborator

@ikrommyd ikrommyd commented Jan 24, 2026

awkward_NumpyArray_subrange_equal and awkward_NumpyArray_subrange_equal_bool expect a boolean as their last argument (see their signature). However here we pass in an int64 zero which the kernel will cast to bool, the kernel will change the first byte of this (leaving the other 7 bytes untouched) and then numpy will interpret the result as int64 (as the is_equal array's dtype does not change). This does not generally work on all systems.
We here pass the correct (expected) dtype to the kernel.

@ikrommyd ikrommyd requested a review from pfackeldey January 24, 2026 23:18
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.65%. Comparing base (53744b2) to head (e5275b6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
Files with missing lines Coverage Δ
src/awkward/contents/numpyarray.py 91.32% <100.00%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Copy Markdown

The documentation preview is ready to be viewed at http://preview.awkward-array.org.s3-website.us-east-1.amazonaws.com/PR3818

@ikrommyd ikrommyd requested a review from ariostas January 26, 2026 10:30
Copy link
Copy Markdown
Member

@ianna ianna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ikrommyd - Thanks for catching this! The awkward_NumpyArray_subrange_equal kernel is already taking a bool pointer. Please go ahead and merge it if you’re finished with it. Thanks.

@ikrommyd ikrommyd merged commit 5f98c8d into scikit-hep:main Jan 28, 2026
40 checks passed
@ikrommyd ikrommyd deleted the correct-subrange-equal-bool-call branch February 3, 2026 17:53
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.

2 participants