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

meson 1.2.3, numpy 1.26.1, require meson >= 1.2.0 #36509

Merged
merged 3 commits into from
Oct 31, 2023

Conversation

mkoeppe
Copy link
Contributor

@mkoeppe mkoeppe commented Oct 23, 2023

The increased lower bound for meson is for contourpy, which was updated in #36320.
ubuntu-mantic https://github.com/sagemath/sage/actions/runs/6645713841/job/18057705190?pr=36541#step:10:2162

[contourpy-1.1.1]     ../meson.build:10:17: ERROR: Meson version is 1.1.1 but project requires >= 1.2.0

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

@mkoeppe mkoeppe self-assigned this Oct 23, 2023
@mkoeppe mkoeppe added this to the sage-10.2 milestone Oct 24, 2023
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 25, 2023

@mkoeppe mkoeppe requested a review from dimpase October 25, 2023 20:56
@mkoeppe mkoeppe changed the title meson 1.2.3, numpy 1.26.1 meson 1.2.3, numpy 1.26.1, require meson >= 1.2.0 Oct 25, 2023
@github-actions
Copy link

Documentation preview for this PR (built with commit 2c46325; changes) is ready! 🎉

@kwankyu
Copy link
Collaborator

kwankyu commented Oct 27, 2023

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 27, 2023

Yes, I have reviewed all platforms in this run.
The failure of "standard" ubuntu-mantic is just a consequence of the timeout of the previous build phase, "standard-pre" ubuntu-mantic.

@kwankyu
Copy link
Collaborator

kwankyu commented Oct 27, 2023

OK. I could check that contourpy 1.1.1 was successfully built in

https://github.com/mkoeppe/sage/actions/runs/6622955701/job/18061230398

and meson 1.2.3 was built as well.

Yes, I have reviewed all platforms in this run. The failure of "standard" ubuntu-mantic is just a consequence of the timeout of the previous build phase, "standard-pre" ubuntu-mantic.

Nonetheless, It is unfortunate to see building sage on ubuntu-mantic fail in every target despite of the fix of this PR.

Is the timeout by limit of github action? No problem on this platform on sage side?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 27, 2023

Is the timeout by limit of github action? No problem on this platform on sage side?

We see these timeouts pretty frequently, and they are not specific to a platform: Workflows that normally that 3 hours sometimes get stuck and time out at GH Actions' limit of 6 hours.
My suspicion is that it gets stuck when downloading upstream tarballs, so I hope that it will go away with the 10.2 release, when the workflow added in #36438 deposits our upstream tarballs as GH release assets.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 27, 2023

I've restarted the failing workflows. https://github.com/mkoeppe/sage/actions/runs/6622955701/job/18110988146

@kwankyu
Copy link
Collaborator

kwankyu commented Oct 27, 2023

My suspicion is that it gets stuck when downloading upstream tarballs,

I think I saw this phenomenon on my own system.

so I hope that it will go away with the 10.2 release, when the workflow added in #36438 deposits our upstream tarballs as GH release assets.

OK. That's good news. Thanks for explanation.

Anyway this PR looks good to me.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 27, 2023

Thank you!

@kwankyu
Copy link
Collaborator

kwankyu commented Oct 27, 2023

By the way, ubuntu-mantic timed out again. Some suspected lines:

1871 debconf: delaying package configuration, since apt-utils is not installed
...
3672 configure: WARNING: unrecognized options: --with-system-_bootstrap
...
4920 Warning:  One or more build-args [TARGETS TARGETS_OPTIONAL TARGETS_PRE USE_MAKEFLAGS NUMPROC] were not consumed 

from the log.

vbraun pushed a commit to vbraun/sage that referenced this pull request Oct 28, 2023
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

The increased lower bound for meson is for contourpy, which was updated
in sagemath#36320.
ubuntu-mantic https://github.com/sagemath/sage/actions/runs/6645713841/j
ob/18057705190?pr=36541#step:10:2162
```
[contourpy-1.1.1]     ../meson.build:10:17: ERROR: Meson version is
1.1.1 but project requires >= 1.2.0
```

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36509
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee
@vbraun
Copy link
Member

vbraun commented Oct 29, 2023

On OSX I'm getting

****************************************************
C compiler: gcc
C compiler version:
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
****************************************************
Package 'scipy' is currently not installed
No legacy uninstaller found for 'scipy'; nothing to do
Installing scipy-1.11.3
Processing /Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.11.1/var/tmp/sage/build/scipy-1.11.3/src
  Preparing metadata (pyproject.toml): started
  Running command Preparing metadata (pyproject.toml)
  + meson setup /Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.11.1/var/tmp/sage/build/scipy-1.11.3/src /Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.11.1/var/tmp/sage/build/scipy-1.11.3/src/.mesonpy-dkvkbd9g -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.11.1/var/tmp/sage/build/scipy-1.11.3/src/.mesonpy-dkvkbd9g/meson-python-native-file.ini
  The Meson build system
  Version: 1.2.3
  Source dir: /Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.11.1/var/tmp/sage/build/scipy-1.11.3/src
  Build dir: /Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.11.1/var/tmp/sage/build/scipy-1.11.3/src/.mesonpy-dkvkbd9g
  Build type: native build
  Project name: SciPy
  Project version: 1.11.3
  ../meson.build:1:0: ERROR: Compiler gcc cannot compile programs.
  A full log can be found at /Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.11.1/var/tmp/sage/build/scipy-1.11.3/src/.mesonpy-dkvkbd9g/meson-logs/meson-log.txt
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.11.1/bin/python3 /Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py prepare_metadata_for_build_wheel /var/folders/06/0yb8f59j2ks8f0cph9fvkyp40000gp/T/tmpmagwwn48
  cwd: /Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.11.1/var/tmp/sage/build/scipy-1.11.3/src
  Preparing metadata (pyproject.toml): finished with status 'error'
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
********************************************************************************

@vbraun
Copy link
Member

vbraun commented Oct 29, 2023

Actually due to #36523 #36523

@vbraun vbraun merged commit 97b06bd into sagemath:develop Oct 31, 2023
27 of 33 checks passed
@mkoeppe mkoeppe deleted the meson_1.2.3 branch October 31, 2023 20:59
@jhpalmieri
Copy link
Member

On OS X, this seems to cause

File "src/sage/tests/books/computational-mathematics-with-sagemath/mpoly_doctest.py", line 398, in sage.tests.books.computational-mathematics-with-sagemath.mpoly_doctest
Failed example:
    [CDF['x'](p(y=ys[0][0])).roots() for p in J.gens()] # abs tol 2e-15
Expected:
    [[(-0.5999999999999999, 1), (0.6000000000000001, 1)], [(0.6000000000000001, 1), (2.600000000000001, 1)]]
Got:
    [[(-0.5999999999999998, 1), (0.5999999999999999, 1)],
     [(0.6000000000000001 - 6.162975822039155e-33*I, 1),
      (2.6 + 3.0814879110195774e-32*I, 1)]]
**********************************************************************
1 item had failures:
   1 of 161 in sage.tests.books.computational-mathematics-with-sagemath.mpoly_doctest
    [160 tests, 1 failure, 5.64 s]

(At least that's what git bisect led me to, and merging this branch with 10.2.beta8 gave me this failure.)

@dimpase
Copy link
Member

dimpase commented Nov 1, 2023

this looks like abs tol unable to handle non-real numerical noise properly, no?

@jhpalmieri
Copy link
Member

Another new doctest failure of the same flavor:

sage -t --long --random-seed=99830276876297880371069900454615993286 src/sage/rings/polynomial/polynomial_element.pyx
**********************************************************************
File "src/sage/rings/polynomial/polynomial_element.pyx", line 8097, in sage.rings.polynomial.polynomial_element.Polynomial.roots
Failed example:
    for (fld_in, fld_out) in flds:
        x = polygen(fld_in)
        f = x^3 - fld_in(2)
        x2 = polygen(fld_out)
        f2 = x2^3 - fld_out(2)
        for algo in (None, 'pari', 'numpy'):
            rts = f.roots(ring=fld_out, multiplicities=False)
            if fld_in == fld_out and algo is None:
                print("{} {}".format(fld_in, rts))
            for rt in rts:
                assert(abs(f2(rt)) <= 1e-10)
                assert(rt.parent() == fld_out)
Expected:
    Real Field with 53 bits of precision [1.25992104989487]
    Real Double Field [1.25992104989...]
    Real Field with 100 bits of precision [1.2599210498948731647672106073]
    Complex Field with 53 bits of precision [1.25992104989487, -0.62996052494743... - 1.09112363597172*I, -0.62996052494743... + 1.09112363597172*I]
    Complex Double Field [1.25992104989..., -0.629960524947... - 1.0911236359717...*I, -0.629960524947... + 1.0911236359717...*I]
    Complex Field with 100 bits of precision [1.2599210498948731647672106073, -0.62996052494743658238360530364 - 1.0911236359717214035600726142*I, -0.62996052494743658238360530364 + 1.0911236359717214035600726142*I]
Got:
    Real Field with 53 bits of precision [1.25992104989487]
    Real Double Field [1.2599210498948732]
    Real Field with 100 bits of precision [1.2599210498948731647672106073]
    Complex Field with 53 bits of precision [1.25992104989487, -0.629960524947437 - 1.09112363597172*I, -0.629960524947437 + 1.09112363597172*I]
    Complex Double Field [-0.6299605249474367 - 1.0911236359717218*I, -0.6299605249474369 + 1.091123635971722*I, 1.2599210498948736 - 1.250210327770565e-32*I]
    Complex Field with 100 bits of precision [1.2599210498948731647672106073, -0.62996052494743658238360530364 - 1.0911236359717214035600726142*I, -0.62996052494743658238360530364 + 1.0911236359717214035600726142*I]

@kwankyu
Copy link
Collaborator

kwankyu commented Nov 2, 2023

The second one is due to different ordering of roots.

@jhpalmieri
Copy link
Member

The second one is due to different ordering of roots.

I also haven't checked that it's due to this PR.

@kwankyu
Copy link
Collaborator

kwankyu commented Nov 2, 2023

Could be due to numpy version upgrade.

@dimpase
Copy link
Member

dimpase commented Nov 2, 2023

this looks like abs tol unable to handle non-real numerical noise properly, no?

This definitely is the case. E.g.

--- a/src/sage/doctest/parsing.py
+++ b/src/sage/doctest/parsing.py
@@ -1461,7 +1461,7 @@ class SageOutputChecker(doctest.OutputChecker):
             ...
             RuntimeError
             sage: 1  # abs tol 2
-            -0.5
+            -0.5+0.0001*I
             sage: print("0.9999")    # rel tol 1e-4
             1.0
             sage: print("1.00001")   # abs tol 1e-5

gives

sage -t --warn-long 20.5 --random-seed=37938279076849498617774420336933883040 src/sage/doctest/parsing.py
**********************************************************************
File "src/sage/doctest/parsing.py", line 1463, in sage.doctest.parsing.SageOutputChecker.check_output
Failed example:
    1  # abs tol 2
Expected:
    -0.5+0.0001*I
Got:
    1
**********************************************************************
1 item had failures:
   1 of  55 in sage.doctest.parsing.SageOutputChecker.check_output
    [322 tests, 1 failure, 0.17 s]
----------------------------------------------------------------------
sage -t --warn-long 20.5 --random-seed=37938279076849498617774420336933883040 src/sage/doctest/parsing.py  # 1 doctest failed

Indeed, RIF is used as data to check tolerances, no wonder things go wrong here.
By right, one needs a complex abs tol and rel tol.

@jhpalmieri
Copy link
Member

The second one is due to different ordering of roots.

We could sort the roots, say in increasing order of the imaginary part:

diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx
index 8e9c4822a7b..edb6d88fb2a 100644
--- a/src/sage/rings/polynomial/polynomial_element.pyx
+++ b/src/sage/rings/polynomial/polynomial_element.pyx
@@ -8104,7 +8104,7 @@ cdef class Polynomial(CommutativePolynomial):
             ....:     x2 = polygen(fld_out)
             ....:     f2 = x2^3 - fld_out(2)
             ....:     for algo in (None, 'pari', 'numpy'):
-            ....:         rts = f.roots(ring=fld_out, multiplicities=False)
+            ....:         rts = sorted(f.roots(ring=fld_out, multiplicities=False), key=lambda root: root.imag())
             ....:         if fld_in == fld_out and algo is None:
             ....:             print("{} {}".format(fld_in, rts))
             ....:         for rt in rts:
@@ -8113,9 +8113,9 @@ cdef class Polynomial(CommutativePolynomial):
             Real Field with 53 bits of precision [1.25992104989487]
             Real Double Field [1.25992104989...]
             Real Field with 100 bits of precision [1.2599210498948731647672106073]
-            Complex Field with 53 bits of precision [1.25992104989487, -0.62996052494743... - 1.09112363597172*I, -0.62996052494743... + 1.09112363597172*I]
-            Complex Double Field [1.25992104989..., -0.629960524947... - 1.0911236359717...*I, -0.629960524947... + 1.0911236359717...*I]
-            Complex Field with 100 bits of precision [1.2599210498948731647672106073, -0.62996052494743658238360530364 - 1.0911236359717214035600726142*I, -0.62996052494743658238360530364 + 1.0911236359717214035600726142*I]
+            Complex Field with 53 bits of precision [-0.62996052494743... - 1.09112363597172*I, 1.25992104989487, -0.62996052494743... + 1.09112363597172*I]
+            Complex Double Field [-0.629960524947... - 1.0911236359717...*I, 1.25992104989..., -0.629960524947... + 1.0911236359717...*I]
+            Complex Field with 100 bits of precision [-0.62996052494743658238360530364 - 1.0911236359717214035600726142*I, 1.2599210498948731647672106073, -0.62996052494743658238360530364 + 1.0911236359717214035600726142*I]
 
         Note that we can find the roots of a polynomial with algebraic
         coefficients::

That works on my machine. Any better ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants