Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Fix alignment errors due to relaxed stride checking #14893

Merged
merged 1 commit into from
Oct 20, 2021

Conversation

peterbell10
Copy link
Member

Reference issue

Fixes errors in MacPython/scipy-wheels#132

What does this implement/fix?

NumPy's relaxed stride checking explicitly ignores length-1 dimensions, so if we don't as well then there will be false-positives as we were seeing in the windows build with python 3.10.
https://github.com/numpy/numpy/blob/5cb560616abe44774d897a80970775d2a26bb03b/numpy/core/src/common/array_assign.c#L114-L118

@peterbell10 peterbell10 added defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.spatial labels Oct 20, 2021
@github-actions github-actions bot added the C/C++ Items related to the internal C/C++ code base label Oct 20, 2021
Copy link
Member

@tupui tupui left a comment

Choose a reason for hiding this comment

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

Thanks @peterbell10! I will wait for the CI and merge. Why this is only happening on windows?

@peterbell10
Copy link
Member Author

peterbell10 commented Oct 20, 2021

Well it's strange that the non-aligned strides even exist. It looks as though NumPy is not writing to the stride of the length-1 dimension at all. Is it possible this is a fixed bug and the windows build is just using an older NumPy version?

@tupui
Copy link
Member

tupui commented Oct 20, 2021

Well it's strange that the non-aligned strides even exist. It looks as though NumPy is not writing to the stride of the length-1 dimension at all. Is it possible this is a fixed bug and the windows build is just using an older NumPy version?

Maybe it's fixed on main, but not in the latest release at least since I am using oldest-supported-numpy which in this case points to 1.21.2 (I just checked the logs).

@peterbell10
Copy link
Member Author

Oh well, in that case I have no idea why the strides are different on windows.

@tupui
Copy link
Member

tupui commented Oct 20, 2021

CI failures are not related, merging and 🤞 for windows.

@tupui tupui merged commit cd1c680 into scipy:master Oct 20, 2021
@peterbell10 peterbell10 deleted the cdist-relaxed-strides branch October 20, 2021 23:13
@tylerjereddy tylerjereddy added the backport-candidate This fix should be ported by a maintainer to previous SciPy versions. label Oct 25, 2021
@tylerjereddy tylerjereddy added this to the 1.8.0 milestone Oct 25, 2021
rgommers pushed a commit to rgommers/scipy that referenced this pull request Oct 29, 2021
@tylerjereddy tylerjereddy modified the milestones: 1.8.0, 1.7.2 Oct 29, 2021
@tylerjereddy tylerjereddy removed the backport-candidate This fix should be ported by a maintainer to previous SciPy versions. label Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C/C++ Items related to the internal C/C++ code base defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.spatial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants