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

Regression on i686: testI64Cast fails (mypy v1.0.0) #14633

Closed
mr-c opened this issue Feb 7, 2023 · 1 comment · Fixed by #14691
Closed

Regression on i686: testI64Cast fails (mypy v1.0.0) #14633

mr-c opened this issue Feb 7, 2023 · 1 comment · Fixed by #14691
Labels
bug mypy got something wrong topic-mypyc mypyc bugs topic-tests

Comments

@mr-c
Copy link
Contributor

mr-c commented Feb 7, 2023

Bug Report

Hello, while preparing the Debian package for mypy 1.0 (:tada: congratulations!), we are getting a testI64Cast failure on i686

To Reproduce

FROM --platform=linux/i386 debian:unstable-slim
RUN apt-get update && apt-get install -y python3-pip python3-lxml wget make
WORKDIR /tmp
RUN wget https://github.com/python/mypy/archive/refs/tags/v1.0.0.tar.gz && \
	tar xzf v*tar.gz && \
	rm *.tar.gz
WORKDIR /tmp/mypy-1.0.0
RUN python3 -m pip install -r test-requirements.txt
RUN python3 -m pytest -v -n 0 -k testI64Cast

Expected Behavior

mypyc/test/test_irbuild.py::TestGenOps::irbuild-i64.test::testI64Cast PASSED [100%]

Actual Behavior

mypyc/test/test_irbuild.py::TestGenOps::irbuild-i64.test::testI64Cast FAILED [100%]

=================================== FAILURES ===================================
_________________________________ testI64Cast __________________________________
data: /tmp/mypy-1.0.0/mypyc/test-data/irbuild-i64.test:1734:
../mypy-1.0.0/mypyc/test/test_irbuild.py:83: in run_case
    assert_test_output(testcase, actual, "Invalid source code output", expected_output)
E   AssertionError: Invalid source code output (/tmp/mypy-1.0.0/mypyc/test-data/irbuild-i64.test, line 1734)
----------------------------- Captured stderr call -----------------------------
Expected:
  ...
  def cast_int(x):
      x :: int
      r0 :: native_int
      r1 :: bit
      r2, r3 :: int64                           (diff)
      r4 :: ptr                                 (diff)
      r5 :: c_ptr                               (diff)
      r6 :: int64                               (diff)
  L0:
      r0 = x & 1
      r1 = r0 == 0
      if r1 goto L1 else goto L2 :: bool
  L1:
      r2 = x >> 1                               (diff)
      r3 = r2                                   (diff)
      goto L3                                   (diff)
  L2:                                           (diff)
      r4 = x ^ 1                                (diff)
      r5 = r4                                   (diff)
      r6 = CPyLong_AsInt64(r5)                  (diff)
      r3 = r6                                   (diff)
      keep_alive x                              (diff)
  L3:                                           (diff)
      return r3                                 (diff)
Actual:
  ...
  def cast_int(x):
      x :: int
      r0 :: native_int
      r1 :: bit
      r2, r3, r4 :: int64                       (diff)
      r5 :: ptr                                 (diff)
      r6 :: c_ptr                               (diff)
      r7 :: int64                               (diff)
  L0:
      r0 = x & 1
      r1 = r0 == 0
      if r1 goto L1 else goto L2 :: bool
  L1:
      r2 = extend signed x: builtins.int to int64 (diff)
      r3 = r2 >> 1                              (diff)
      r4 = r3                                   (diff)
      goto L3                                   (diff)
  L2:                                           (diff)
      r5 = x ^ 1                                (diff)
      r6 = r5                                   (diff)
      r7 = CPyLong_AsInt64(r6)                  (diff)
      r4 = r7                                   (diff)
      keep_alive x                              (diff)
  L3:                                           (diff)
      return r4                                 (diff)

Alignment of first line difference:
  E:     r2, r3 :: int64
  A:     r2, r3, r4 :: int64
               ^

Your Environment

  • Mypy version used: v1.0.0
  • Mypy command-line flags:
  • Mypy configuration options from mypy.ini (and other config files):
  • Python version used: 3.11.1
@mr-c mr-c added the bug mypy got something wrong label Feb 7, 2023
@mcepl
Copy link

mcepl commented Feb 7, 2023

/me too (packaging on openSUSE)

@hauntsaninja hauntsaninja mentioned this issue Feb 7, 2023
17 tasks
JukkaL added a commit that referenced this issue Feb 13, 2023
Add 64-bit and 32-bit variants of the test.

Fixes #14633.
JukkaL added a commit that referenced this issue Feb 13, 2023
Add 64-bit and 32-bit variants of the test.

Fixes #14633.
ilinum pushed a commit to ilinum/mypy that referenced this issue Feb 14, 2023
ilinum pushed a commit to ilinum/mypy that referenced this issue Feb 14, 2023
hauntsaninja pushed a commit that referenced this issue Feb 15, 2023
Debian does build 32bit (on Linux), and there was a recent regression

This PR would have caught #14633 earlier

No change in total CI time [(32
minutes)](https://github.com/python/mypy/actions/runs/4174210017) versus
the baseline [(33
minutes)](https://github.com/python/mypy/actions/runs/4166467338)

Confirmation that the new CI test catches the previous error is at
https://github.com/python/mypy/actions/runs/4174055572/jobs/7227150570#step:7:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-mypyc mypyc bugs topic-tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants