skip length-one axes when choosing flat stride in init_iter_all#569
Merged
neutrinoceros merged 5 commits intoJun 3, 2026
Merged
Conversation
Collaborator
|
Nice. Thank you for addressing these. Can you add regression tests too ? The example reproducers from issues you're fixing are probably good enough already. |
This was
linked to
issues
Jun 2, 2026
Contributor
Author
Collaborator
|
Great. Though these are really two different test cases. I suggest splitting them or, if it makes sense, to parametrize the one test function. |
Contributor
Author
|
Parametrized it into the two cases (issue381, issue393). |
| # issue #393 (F-contiguous branch) | ||
| np.arange(1 * 192 * 121, dtype=np.float64).reshape(1, 192, 121).transpose(0, 2, 1), | ||
| ), | ||
| ids=("issue381", "issue393"), |
Collaborator
There was a problem hiding this comment.
Suggested change
| ids=("issue381", "issue393"), | |
| ids=("C-contiguous", "F-contiguous"), |
Contributor
Author
There was a problem hiding this comment.
Done, switched the ids to C-contiguous/F-contiguous.
neutrinoceros
approved these changes
Jun 3, 2026
Collaborator
|
Thanks a lot for triaging and fixing these @sahvx655-wq ! |
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.
When a reduce-all function gets a transposed view whose size-1 axis carries a large stride (
np.zeros((1,500,2)).transpose(1,2,0),np.zeros((1,192,121)).transpose(0,2,1)), the stride-picking loops in init_iter_all skip only zero strides and grab that axis's huge stride, so iteration runs off the buffer (issues #381, #393: garbage from nanmax or a segfault). Skip length-one axes there too, since their stride is never traversed.