-
Notifications
You must be signed in to change notification settings - Fork 86
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
test failures with mpfr 4.2.1 (change in MPFR formatted functions) #418
Comments
I suppose that the bug is in
With the fix of the formatted output functions in GNU MPFR 4.2.1, the insertion of the Note also that the sign that appears before "nan" is indeterminate in general (just like in C), unless the sign bit is fixed by MPC. |
And to support both fixed and unfixed versions of MPFR, you could check whether the first character of But for the tests, note the indeterminate sign for "nan". |
Co-authored-by: Vincent Lefevre <[email protected]> Closes aleaxit#418
`dpkg-buildpackage: info: source package python-gmpy2 looking for now-outdated files... none found The manual pages are in _build/man. Build finished. The manual pages are in _build/man. generating indices... genindex done The HTML pages are in _build/html. Build finished. The HTML pages are in _build/html. Unit tests for gmpy2 2.1.2 with Python 3.11.5 Results for: test_context Attempted: 38 Failed: 0 File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_gmpy2_math.txt", line 35, in test_gmpy2_math.txt 1 items had failures: File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_gmpy2_mpfr_misc.txt", line 118, in test_gmpy2_mpfr_misc.txt 1 items had failures: File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpc.txt", line 151, in test_mpc.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpc.txt", line 159, in test_mpc.txt 1 items had failures: File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 293, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 295, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 307, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 329, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 353, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 357, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 370, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 382, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 402, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 430, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 434, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 447, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 449, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 457, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 461, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 463, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 465, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 467, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 469, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 473, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 484, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 486, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 492, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 494, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 496, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 498, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 500, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 502, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 504, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 506, in test_mpfr.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr.txt", line 510, in test_mpfr.txt 1 items had failures: File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr_create.txt", line 47, in test_mpfr_create.txt 1 items had failures: File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpfr_min_max.txt", line 55, in test_mpfr_min_max.txt 1 items had failures: File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 218, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 220, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 232, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 278, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 282, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 295, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 307, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 327, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 335, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 355, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 372, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 374, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 382, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 386, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 390, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 394, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 398, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 409, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 411, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 417, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 419, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 423, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 427, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 431, in test_mpq.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpq.txt", line 435, in test_mpq.txt 1 items had failures: File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 316, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 318, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 331, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 378, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 382, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 395, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 415, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 423, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 443, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 460, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 462, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 468, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 470, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 474, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 478, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 482, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 486, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 497, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 499, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 505, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 507, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 511, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 515, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 519, in test_mpz.txt File "/home/packages/tmp/python-gmpy2-2.1.2/test/test_mpz.txt", line 523, in test_mpz.txt 1 items had failures:
Running external test programs. |
the proposed patch fixes the double '++', there are unexpected results regarding nan/-nan |
This was found recently in Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050797. Looks like the patch from @doko42 should address it. If the patch looks good, please let me know if you plan to release a bugfix version soon; if not, we can include this in packaging to fix this up for Debian until the next gmpy release. |
there is no patch from me, the nan/+nan issues are still present |
In addition to the correction I mentioned above, which fixes the double "+" sign, you should ignore the sign bit of nan since it is not used in these tests. I think that the easiest solution would be to check whether the real or imaginary part of the result is nan, and force the sign bit to positive before converting the value to a string. Perhaps I could provide a patch later. |
Actually this is not possible because the conversion to a string is the gmpy code, which is correct with #422. So, concerning the sign before nan differences, these are the only tests that should be modified. A solution could be to postprocess the result file to replace |
please reopen. the patch in #422 only fixes the issue with the double plus sign |
My apologies for the confusion. The test suite for the next version 2.2.0a1 passes on my machine. When I try one of the failures listed above, I believe I am getting the expected result.
I will test with gmpy2 2.1.5 tomorrow and try to reproduce the issue. I am trying to release gmpy2 2.2.0 as soon as I can since it required for Python 3.12. But it already doesn't work with 3.13(dev). |
MPFR sets a positive sign by default to initialized variables ( |
no, just this patch on top of the 2.1.5 release. are there any patches in the trunk to get 2.1.5 working with mpfr 4.2.1? |
From #422, correct? Then, there should be no test failures with our tests, e.g.: |
yes, from #422 |
I see my builds use mpclib 1.3.1, your's are using 1.2.1 |
Yeah, I'm trying to do an update: |
also gmp 6.3.0 vs. 6.2.1 |
No. MPC version is irrelevant: |
yes, that's what I said in #418 (comment) also asking in #418 (comment) |
https://launchpad.net/~doko/+archive/ubuntu/ppa/+sourcepub/15141484/+listing-archive-extra |
On Tue, Sep 05, 2023 at 05:44:29AM -0700, Matthias Klose wrote:
[1]https://launchpad.net/~doko/+archive/ubuntu/ppa/+sourcepub/15141484/+listing-archive-extra
for a trunk build. already stops in the doctests
You should use test/runtests.py as before to run tests. The test suite
only partially was ported to the pytest framework, see #420.
|
https://launchpad.net/~doko/+archive/ubuntu/ppa/+sourcepub/15141533/+listing-archive-extra that seems to work, although I patched out the call to pytest at the end of the script, which causes a failure code. just running the pytest on it's own anyway, please could you point out the relevant change which could be used for backporting? |
On Tue, Sep 05, 2023 at 06:22:48AM -0700, Matthias Klose wrote:
[1]https://launchpad.net/~doko/+archive/ubuntu/ppa/+sourcepub/15141533/+listing-archive-extra
that seems to work, although I patched out the call to pytest at the end
of the script, which causes a failure code.
What kind of failure?
(BTW, as you run sphinx-build without the gmpy2 package being installed,
probably you shold set PYTHONPATH to ".")
anyway, please could you point out the relevant change which could be used
for backporting?
Hmm, git bisect shows it's 7351e2e, probably it's the change in
GMPy_MPFR_New().
|
Ok, after some cleanup of the 7351e2e, I got this: With this additional patch - the test suite pass for gmpy2-2.1.5: |
thanks, that looks good: https://launchpad.net/ubuntu/+source/python-gmpy2/2.1.5-1ubuntu2
|
On Tue, Sep 05, 2023 at 07:40:49AM -0700, Matthias Klose wrote:
thanks, that looks good:
[1]https://launchpad.net/ubuntu/+source/python-gmpy2/2.1.5-1ubuntu2
Great. @casevh, probably we can close this issue as fixed in the
master, unless you want to do a bugfix release, which will include
this stuff.
What kind of failure?
the script doesn't show any error output ;)
Hmm. Could you point me to a relevant build log?
Here is an example, where the pytest package wasn't installed:
(debian-test) ***@***.***:~/src/gmpy $ rm build/* -rf && \
CFLAGS=-I/usr/local/include/ LDFLAGS=-L/usr/local/lib/ pip install . --verbose && \
LD_LIBRARY_PATH=/usr/local/lib/ python test/runtests.py
[...]
Results for: test_mpz_io Attempted: 60 Failed: 0
Summary - Attempted: 3303 Failed: 0
Running external test programs.
/home/sk/src/gmpy/debian-test/bin/python: No module named pytest
Running pytest failed
So, I would guess you did redirection of the stderr somewhere.
|
I have published release 2.2.0a1 on PyPi. Unfortunately, I forgot to include the source distribution. For reference, the source code is available at: https://github.com/aleaxit/gmpy/archive/refs/tags/gmpy2-2.2.0a1.tar.gz I will publish a2 soon. |
Source for 2.2.0a1 has been uploaded. |
Co-authored-by: Vincent Lefevre <[email protected]> Closes aleaxit#418
Co-authored-by: Vincent Lefevre <[email protected]> Closes aleaxit#418
@casevh, probably this can be closed as v2.2 released. |
gmpy2 sees test failures with mpfr 4.2.1, independent of the architecture, see for example
https://ci.debian.net/data/autopkgtest/testing/amd64/p/python-gmpy2/37232406/log.gz
mostly it's a missing "-", however there are a few tests in test_mpc.txt, which look suspicious with the double plus sign ...
Differences (ndiff with -expected +actual):
- mpc('inf+infj')
+ mpc('inf++infj')
? +
The text was updated successfully, but these errors were encountered: