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

Upgrade to pari 2.17, cypari 2.2.1 #38749

Open
wants to merge 29 commits into
base: develop
Choose a base branch
from

Conversation

antonio-rojas
Copy link
Contributor

NEXT_PRIME_VIADIFF is removed in 2.17, port pari_prime_range to pari_PRIMES instead

Needs sagemath/cypari2#165 applied to cypari

@antonio-rojas
Copy link
Contributor Author

Needs work because this is not compatible with 2.15. So either it needs to be merged with the pari upgrade or be made to work with older pari too (no idea how).

Running tests now.

@antonio-rojas antonio-rojas changed the title Fix build with pari 2.17 [WIP] Fix build with pari 2.17 Oct 3, 2024
@antonio-rojas
Copy link
Contributor Author

Many test failures.

@antonio-rojas antonio-rojas changed the title [WIP] Fix build with pari 2.17 [WIP] Fix build and tests with pari 2.17 Oct 3, 2024
@jhpalmieri
Copy link
Member

If the changes here eventually allow us to use a system Pari 2.17, then we should undo the change in #38772.

@antonio-rojas antonio-rojas changed the title [WIP] Fix build and tests with pari 2.17 Fix build and tests with pari 2.17 Oct 6, 2024
@antonio-rojas
Copy link
Contributor Author

antonio-rojas commented Oct 6, 2024

With this MR and the cypari fixes sagemath/cypari2#165 and sagemath/cypari2#166 all tests are passing with pari 2.17.

The changes are not compatible with 2.15 though, making them compatible requires more work. Also, some pari opeations (such as the number field prime ideals above a given prime) give random output with 2.17, which makes it harder to test. To solve both issues (and make tests more future proof), we should gradually move away from testing the exact output to just testing that the output is correct.

@antonio-rojas
Copy link
Contributor Author

pari 2.17.1 is out with the needed fixes, so we should go ahead with the upgrade. We just need a cypari release including sagemath/cypari2#166

@tornaria
Copy link
Contributor

I think you missed one hunk in the last merge:

--- a/src/sage/rings/integer.pyx
+++ b/src/sage/rings/integer.pyx
@@ -5585,7 +5585,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
             sage: 5.is_norm(K)
             False
             sage: n.is_norm(K, element=True)
-            (True, 4*beta + 6)
+            (True, -4*beta + 6)
             sage: n.is_norm(K, element=True)[1].norm()
             4
             sage: n = 5

@tornaria
Copy link
Contributor

@antonio-rojas

Two more doctest fixes: 0a0be0c and 6d00b9c

With this + all, I have everything working just fine 🎉 void-linux/void-packages#51902

In case it's useful to someone else, I have a branch for pari-2.17 support and a branch for python 3.13 support, both based on 10.5:

It would be nice to move forward to pari 2.17 early in the 10.6 cycle.

You can take my review and testing as a positive review for this PR, but of course it can't be merged until pari is updated.

Comment on lines 8792 to 8814
[(Number Field in a0 with defining polynomial x, Ring morphism:
From: Number Field in a0 with defining polynomial x
To: Number Field in a with defining polynomial 2*x^4 + 6*x^2 + 1/2
Defn: 0 |--> 0, None),
(Number Field in a1 with defining polynomial x^2 - 2, Ring morphism:
From: Number Field in a1 with defining polynomial x^2 - 2
To: Number Field in a with defining polynomial 2*x^4 + 6*x^2 + 1/2
Defn: a1 |--> -a^2 - 3/2, None),
(Number Field in a2 with defining polynomial x^2 + 4, Ring morphism:
From: Number Field in a2 with defining polynomial x^2 + 4
To: Number Field in a with defining polynomial 2*x^4 + 6*x^2 + 1/2
Defn: a2 |--> 2*a^3 + 7*a, None),
(Number Field in a3 with defining polynomial x^2 + 2, Ring morphism:
From: Number Field in a3 with defining polynomial x^2 + 2
To: Number Field in a with defining polynomial 2*x^4 + 6*x^2 + 1/2
Defn: a3 |--> -2*a^3 - 5*a, None),
(Number Field in a4 with defining polynomial x^4 + 1, Ring morphism:
From: Number Field in a4 with defining polynomial x^4 + 1
To: Number Field in a with defining polynomial 2*x^4 + 6*x^2 + 1/2
Defn: a4 |--> -a^3 - 1/2*a^2 - 5/2*a - 3/4, Ring morphism:
From: Number Field in a with defining polynomial 2*x^4 + 6*x^2 + 1/2
To: Number Field in a4 with defining polynomial x^4 + 1
Defn: a |--> 1/2*a4^3 + a4^2 + 1/2*a4)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Something here looks like a messed up merge. This block was changed in #39027, you seem to be reverting some of those changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed. Looks like the changes in #39027 are transparent to doctesting.

@antonio-rojas antonio-rojas changed the title Fix build and tests with pari 2.17 Upgrade to pari 2.17, cypari 2.2.1 Jan 7, 2025
Copy link

github-actions bot commented Jan 7, 2025

Documentation preview for this PR (built with commit 1570ab0; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

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.

3 participants