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

i386 test failure in test_scipy: TestScikitImage.test__greyreconstruct: different signedness: ‘long unsigned int’ and ‘long int’ #1993

Closed
drew-parsons opened this issue May 30, 2022 · 2 comments

Comments

@drew-parsons
Copy link

Pythran 0.10.0 tests fail on 32-bit i386 (i686), in test_scipy: TestScikitImage.test__greyreconstruct.
A test log can be found at https://ci.debian.net/data/autopkgtest/testing/i386/p/pythran/20587303/log.gz

The toplevel error is

test_scipy.py .................F..............                           [100%]

=================================== FAILURES ===================================
_________________ TestScikitImage.test__greyreconstruct_norun0 _________________

attrs = {'cmdclass': {'bdist_rpm': <class 'numpy.distutils.command.bdist_rpm.bdist_rpm'>, 'build': <class 'numpy.distutils.com...t.PythranExtension('_greyreconstruct_norun00') at 0xf11943a0>], 'headers': [], 'name': '_greyreconstruct_norun00', ...}
klass = <class 'numpy.distutils.numpy_distribution.NumpyDistribution'>
dist = <numpy.distutils.numpy_distribution.NumpyDistribution object at 0xf11947d8>
ok = True

    def setup (**attrs):
        """The gateway to the Distutils: do everything your setup script needs
        to do, in a highly flexible and user-driven way....

The underlying error message seems to be:

----------------------------- Captured stderr call -----------------------------
In file included from /usr/lib/python3/dist-packages/pythran/pythonic/types/numpy_operators.hpp:12,
                 from /usr/lib/python3/dist-packages/pythran/pythonic/types/ndarray.hpp:1303,
                 from /usr/lib/python3/dist-packages/pythran/pythonic/types/tuple.hpp:13,
                 from /usr/lib/python3/dist-packages/pythran/pythonic/builtins/bool_.hpp:7,
                 from /usr/lib/python3/dist-packages/pythran/pythonic/types/NoneType.hpp:8,
                 from /usr/lib/python3/dist-packages/pythran/pythonic/types/slice.hpp:5,
                 from /usr/lib/python3/dist-packages/pythran/pythonic/core.hpp:36,
                 from /tmp/tmp5yei6hk8.cpp:1:
/usr/lib/python3/dist-packages/pythran/pythonic/operator_/eq.hpp: In instantiation of ‘decltype ((forward<A>(a) == forward<B>(b))) {anonymous}::pythonic::operator_::eq(A&&, B&&) [with A = long unsigned int&; B = long int; decltype ((forward<A>(a) == forward<B>(b))) = bool]’:
/tmp/tmp5yei6hk8.cpp:156:36:   required from ‘typename __pythran__greyreconstruct_norun00::reconstruction_loop::type<argument_type0, argument_type1, argument_type2, argument_type3, argument_type4, argument_type5>::result_type __pythran__greyreconstruct_norun00::reconstruction_loop::operator()(argument_type0&&, argument_type1&&, argument_type2&&, argument_type3&&, argument_type4&&, argument_type5&&) const [with argument_type0 = {anonymous}::pythonic::types::ndarray<long unsigned int, {anonymous}::pythonic::types::pshape<long int> >&; argument_type1 = {anonymous}::pythonic::types::ndarray<long int, {anonymous}::pythonic::types::pshape<long int> >&; argument_type2 = {anonymous}::pythonic::types::ndarray<long int, {anonymous}::pythonic::types::pshape<long int> >&; argument_type3 = {anonymous}::pythonic::types::ndarray<long int, {anonymous}::pythonic::types::pshape<long int> >&; argument_type4 = int&; argument_type5 = int&; typename __pythran__greyreconstruct_norun00::reconstruction_loop::type<argument_type0, argument_type1, argument_type2, argument_type3, argument_type4, argument_type5>::result_type = {anonymous}::pythonic::types::none_type]’
/tmp/tmp5yei6hk8.cpp:220:101:   required from here
/usr/lib/python3/dist-packages/pythran/pythonic/operator_/eq.hpp:15:31: error: comparison of integer expressions of different signedness: ‘long unsigned int’ and ‘long int’ [-Werror=sign-compare]
   15 |     return std::forward<A>(a) == std::forward<B>(b);
      |            ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
cc1plus: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
cc1plus: all warnings being treated as errors
WARNING: Compilation error, trying hard to find its origin...
WARNING: Nop, I'm going to flood you with C++ errors!

pythran appears to be trying to compare a ‘long unsigned int’ against a ‘long int’ . It's not obvious to me which line in pythran/tests/scikit-image/_greyreconstruct.py (or elsewhere) is triggering it.

@serge-sans-paille
Copy link
Owner

Can you confirm the following fixes the warning:

diff --git a/pythran/tests/scikit-image/_greyreconstruct.py b/pythran/tests/scikit-image/_greyreconstruct.py
index 5ac48f0..56ab6c3 100644
--- a/pythran/tests/scikit-image/_greyreconstruct.py
+++ b/pythran/tests/scikit-image/_greyreconstruct.py
@@ -45,7 +45,7 @@ def reconstruction_loop(ranks, prev, next, strides, current_idx, image_stride):
     while current_idx != -1:
         if current_idx < image_stride:
             current_rank = ranks[current_idx]
-            if current_rank == 0:
+            if not current_rank:
                 break
             for i in range(nstrides):
                 neighbor_idx = current_idx + strides[i]

@drew-parsons
Copy link
Author

i386 seems to pass fine with the patch, thanks @serge-sans-paille

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

No branches or pull requests

2 participants