Opened 6 years ago

Closed 6 years ago

#21756 closed enhancement (fixed)

Upgrade to PARI 2.9.1

Reported by: Jeroen Demeyer Owned by:
Priority: major Milestone: sage-7.6
Component: packages: standard Keywords: atelierpari2017
Cc: Peter Bruin, John Cremona, Kiran Kedlaya, Jean-Pierre Flori Merged in:
Authors: Jeroen Demeyer Reviewers: John Cremona, Jean-Pierre Flori, Vincent Delecroix
Report Upstream: N/A Work issues:
Branch: 1d577e1 (Commits, GitHub, GitLab) Commit: 1d577e14640d5019790cf2272f52b856ba407607
Dependencies: Stopgaps:

Status badges

Description (last modified by Jeroen Demeyer)

Tarball: http://pari.math.u-bordeaux.fr/pub/pari/unix/pari-2.9.1.tar.gz

Numerous doctests have to be changed, due to different outputs from PARI (in particular the unit group of number fields).

One doctest change is potentially dubious but has been checked by John Cremona:

         It can happen that no points are found if the height bounds
         used in the search are too small (see :trac:`10745`)::
 
             sage: K.<y> = NumberField(x^4 + x^2 - 7)
             sage: E = EllipticCurve(K, [1, 0, 5*y^2 + 16, 0, 0])
             sage: E.gens(lim1=1, lim3=1)
             []
-            sage: E.rank(), E.gens()  # long time (about 3 s)
-            (1, [(9/25*y^2 + 26/25 : -229/125*y^3 - 67/25*y^2 - 731/125*y - 213/25 : 1)])
+            sage: E.rank(), E.gens(lim3=12)  # long time (about 4s)
+            (1,
+             [(369/25*y^3 + 539/25*y^2 + 1178/25*y + 1718/25 : -29038/125*y^3 - 43003/125*y^2 - 92706/125*y - 137286/125 : 1)])

I had to increase the lim3 value for Simon's 2-descent to find a point. The new point differs from the old point by a 3-torsion point and a sign.

Change History (46)

comment:1 Changed 6 years ago by Jeroen Demeyer

Dependencies: #21765

comment:2 Changed 6 years ago by Jeroen Demeyer

Dependencies: #21765#21703

comment:3 Changed 6 years ago by Jeroen Demeyer

Branch: u/jdemeyer/upgrade_to_pari_2_8_1

comment:4 Changed 6 years ago by Jeroen Demeyer

Commit: a7099ae741973f0db3a767c8af1f57989ddacf15
Description: modified (diff)
Summary: Upgrade to PARI 2.8.1Upgrade to PARI 2.9.0

New commits:

313b785Interface PARI precision in bits
f80485fRemove obsolete comment about stack increasing
b70ec86Add reference to precision guide in PariInstance.__init__
b4bc24fMerge tag '7.5.beta1' into t/21703/ticket/21703
3db3275Only use precisions which are in [33,64] mod 64
a7099aeImprove documentation

comment:5 Changed 6 years ago by git

Commit: a7099ae741973f0db3a767c8af1f57989ddacf15457bf6464a0a3efe1e397131457068e2d91e3ce3

Branch pushed to git repo; I updated commit sha1. New commits:

457bf64Upgrade to PARI 2.9.0

comment:6 Changed 6 years ago by git

Commit: 457bf6464a0a3efe1e397131457068e2d91e3ce30f226f74fed5ebbfd623ecd88d8b9a76c66ffc70

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

0f226f7Upgrade to PARI 2.9.0

comment:7 Changed 6 years ago by git

Commit: 0f226f74fed5ebbfd623ecd88d8b9a76c66ffc70920252a6c8fe46490410c84ca508381e7f08393a

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

920252aUpgrade to PARI 2.9.0

comment:8 Changed 6 years ago by Jeroen Demeyer

Status: newneeds_review

comment:9 Changed 6 years ago by Jeroen Demeyer

Description: modified (diff)

comment:10 Changed 6 years ago by Jeroen Demeyer

Description: modified (diff)

comment:11 Changed 6 years ago by Jeroen Demeyer

Description: modified (diff)

comment:12 Changed 6 years ago by Jean-Pierre Flori

Cc: Peter Bruin John Cremona Kiran Kedlaya Jean-Pierre Flori added

CC'ing random number theory people.

Given that the sum of the two result is of 3-torsion, the new point is still a generator, so should we really worry? @Jeroen: do you think the precision change is worrying?

comment:13 Changed 6 years ago by John Cremona

Nothing to worry about (in answer to the first question). The algorithm is computing E(Q)/2E(Q) anyway.

comment:14 in reply to:  12 Changed 6 years ago by Jeroen Demeyer

My worry is that PARI 2.8.0 found a point with the default settings of Simon's 2-descent, while PARI 2.9.0 does not find a point (it only finds a point after increasing some bound).

comment:15 Changed 6 years ago by François Bissey

I am having trouble with the new stackwarn patch and a pristine pari-2.9.0 tarball.

patching file src/gp/gp.c
patching file src/language/init.c
Hunk #1 succeeded at 740 (offset -34 lines).
Hunk #2 succeeded at 755 (offset -34 lines).
Hunk #3 FAILED at 804.
1 out of 3 hunks FAILED -- saving rejects to file src/language/init.c.rej

Am I doing something wrong?

comment:16 Changed 6 years ago by Jeroen Demeyer

The two patches need to be applied in order.

comment:17 Changed 6 years ago by François Bissey

I see!

comment:18 Changed 6 years ago by Jean-Pierre Flori

Did you ask about the prec issue on pari-devel?

comment:19 in reply to:  18 Changed 6 years ago by Jeroen Demeyer

Replying to jpflori:

Did you ask about the prec issue on pari-devel?

No. Do you think that I should? It's not really a PARI issue, but a potential issue with the 2-descent script.

comment:20 Changed 6 years ago by Jean-Pierre Flori

Sure, but Karim or someone else there could be more knowledgeable than us.

comment:21 Changed 6 years ago by John Cremona

Allow me to comment, since I know Simon's script quite well (he first wrote it at my suggestion in 1997 when he was Henri Cohen's grad student in Bordeaux and I was visiting). In the algorithm, various auxiliary curves ("homogeneous spaces") are constructed on which one must find rational points (one on each such curve is enough). The construction of these is dependent on some purely algebraic number field computations, of class groups and units, where the results are representatives of some equivalence classes, or generators of some group, and are not canonical. As we well know, new versions of pari often result in such representatives and/or generators changing. For Simon's code this means that the equations of the auxiliary curves will change but the curves represented by those equations are equivalent (in a technical sense which is all that matters for the algorithm). Now the new curves / equations will have rational points if and only if the old ones did, but they may be larger and harder to find, so as a side effect of a theoretically unimportant change in number fields code, one has to increase some search (*not* precision) bounds to get equally informative output.

comment:22 Changed 6 years ago by Jeroen Demeyer

So, John, can I conclude that you consider the change to be harmless (even though it looks like a regression).

comment:23 Changed 6 years ago by John Cremona

Yes, that's right!

comment:24 Changed 6 years ago by Jean-Pierre Flori

Reviewers: John Cremona, Jean-Pierre Flori
Status: needs_reviewpositive_review

Then LGTM.

comment:25 Changed 6 years ago by Volker Braun

Status: positive_reviewneeds_work

I'm getting

3348sage -t --long src/sage/interfaces/gp.py
3349**********************************************************************
3350File "src/sage/interfaces/gp.py", line 433, in sage.interfaces.gp.Gp._eval_line
3351Failed example:
3352    gp._eval_line('a='+str(list(range(2*10^5))))[:70]
3353Exception raised:
3354    Traceback (most recent call last):
3355      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 498, in _run
3356        self.compile_and_execute(example, compiler, test.globs)
3357      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 861, in compile_and_execute
3358        exec(compiled, globs)
3359      File "<doctest sage.interfaces.gp.Gp._eval_line[1]>", line 1, in <module>
3360        gp._eval_line('a='+str(list(range(Integer(2)*Integer(10)**Integer(5)))))[:Integer(70)]
3361      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/interfaces/gp.py", line 441, in _eval_line
3362        wait_for_prompt=wait_for_prompt)
3363      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/interfaces/expect.py", line 902, in _eval_line
3364        return self._eval_line_using_file(line)
3365      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/interfaces/expect.py", line 790, in _eval_line_using_file
3366        raise RuntimeError('%s terminated unexpectedly while reading in a large line:\n%s'%(self,msg[0]))
3367    RuntimeError: PARI/GP interpreter terminated unexpectedly while reading in a large line:
3368    PARI/GP interpreter terminated unexpectedly while reading in a large line
3369**********************************************************************
3370File "src/sage/interfaces/gp.py", line 628, in sage.interfaces.gp.Gp._next_var_name
3371Failed example:
3372    for n in [1..13000]:  # long time
3373        a = g(n)          # long time
3374Exception raised:
3375    Traceback (most recent call last):
3376      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 498, in _run
3377        self.compile_and_execute(example, compiler, test.globs)
3378      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 861, in compile_and_execute
3379        exec(compiled, globs)
3380      File "<doctest sage.interfaces.gp.Gp._next_var_name[5]>", line 2, in <module>
3381        a = g(n)          # long time
3382      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 246, in __call__
3383        return self._coerce_from_special_method(x)
3384      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 272, in _coerce_from_special_method
3385        return (x.__getattribute__(s))(self)
3386      File "sage/structure/sage_object.pyx", line 715, in sage.structure.sage_object.SageObject._gp_ (/Users/buildslave-sage/slave/sage_git/build/src/build/cythonized/sage/structure/sage_object.c:7387)
3387        return self._interface_(G)
3388      File "sage/structure/sage_object.pyx", line 680, in sage.structure.sage_object.SageObject._interface_ (/Users/buildslave-sage/slave/sage_git/build/src/build/cythonized/sage/structure/sage_object.c:6554)
3389        X = I(s)
3390      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 244, in __call__
3391        return cls(self, x, name=name)
3392      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/interfaces/expect.py", line 1380, in __init__
3393        self._name = parent._create(value, name=name)
3394      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 434, in _create
3395        self.set(name, value)
3396      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/interfaces/gp.py", line 557, in set
3397        raise TypeError("Error executing code in GP:\nCODE:\n\t%s\nPARI/GP ERROR:\n%s"%(cmd, out))
3398    TypeError: Error executing code in GP:
3399    CODE:
3400    	sage[12001]=12001;
3401    PARI/GP ERROR:
3402      ***   at top-level: sage[12001]=12001
3403      ***                     ^-------------
3404      ***   non-existent component: index > 12000
3405**********************************************************************
34062 items had failures:
3407   1 of   3 in sage.interfaces.gp.Gp._eval_line
3408   1 of   8 in sage.interfaces.gp.Gp._next_var_name
3409    [155 tests, 2 failures, 10.25 s]

comment:26 Changed 6 years ago by John Cremona

Since 2.9.1 was released today surely we might as well get that in rather than working more on 2.9.0?

comment:27 Changed 6 years ago by François Bissey

They ignored my two reports to the "maintainer" issues list. It is minor but not cool.

comment:28 Changed 6 years ago by Jeroen Demeyer

Description: modified (diff)
Summary: Upgrade to PARI 2.9.0Upgrade to PARI 2.9.1

comment:29 Changed 6 years ago by Jeroen Demeyer

Dependencies: #21703
Description: modified (diff)
Milestone: sage-7.5sage-7.6

comment:30 Changed 6 years ago by git

Commit: 920252a6c8fe46490410c84ca508381e7f08393a768635d691ef52cebbc6b005b25ccc5c7f7f465a

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

768635dUpgrade to PARI 2.9.1

comment:31 in reply to:  25 Changed 6 years ago by Jeroen Demeyer

Replying to vbraun:

I'm getting

3348sage -t --long src/sage/interfaces/gp.py
3349**********************************************************************
3350File "src/sage/interfaces/gp.py", line 433, in sage.interfaces.gp.Gp._eval_line
3351Failed example:
3352    gp._eval_line('a='+str(list(range(2*10^5))))[:70]
3353Exception raised:
3354    Traceback (most recent call last):
3355      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 498, in _run
3356        self.compile_and_execute(example, compiler, test.globs)
3357      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 861, in compile_and_execute
3358        exec(compiled, globs)
3359      File "<doctest sage.interfaces.gp.Gp._eval_line[1]>", line 1, in <module>
3360        gp._eval_line('a='+str(list(range(Integer(2)*Integer(10)**Integer(5)))))[:Integer(70)]
3361      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/interfaces/gp.py", line 441, in _eval_line
3362        wait_for_prompt=wait_for_prompt)
3363      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/interfaces/expect.py", line 902, in _eval_line
3364        return self._eval_line_using_file(line)
3365      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/interfaces/expect.py", line 790, in _eval_line_using_file
3366        raise RuntimeError('%s terminated unexpectedly while reading in a large line:\n%s'%(self,msg[0]))
3367    RuntimeError: PARI/GP interpreter terminated unexpectedly while reading in a large line:
3368    PARI/GP interpreter terminated unexpectedly while reading in a large line
3369**********************************************************************
3370File "src/sage/interfaces/gp.py", line 628, in sage.interfaces.gp.Gp._next_var_name
3371Failed example:
3372    for n in [1..13000]:  # long time
3373        a = g(n)          # long time
3374Exception raised:
3375    Traceback (most recent call last):
3376      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 498, in _run
3377        self.compile_and_execute(example, compiler, test.globs)
3378      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 861, in compile_and_execute
3379        exec(compiled, globs)
3380      File "<doctest sage.interfaces.gp.Gp._next_var_name[5]>", line 2, in <module>
3381        a = g(n)          # long time
3382      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 246, in __call__
3383        return self._coerce_from_special_method(x)
3384      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 272, in _coerce_from_special_method
3385        return (x.__getattribute__(s))(self)
3386      File "sage/structure/sage_object.pyx", line 715, in sage.structure.sage_object.SageObject._gp_ (/Users/buildslave-sage/slave/sage_git/build/src/build/cythonized/sage/structure/sage_object.c:7387)
3387        return self._interface_(G)
3388      File "sage/structure/sage_object.pyx", line 680, in sage.structure.sage_object.SageObject._interface_ (/Users/buildslave-sage/slave/sage_git/build/src/build/cythonized/sage/structure/sage_object.c:6554)
3389        X = I(s)
3390      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 244, in __call__
3391        return cls(self, x, name=name)
3392      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/interfaces/expect.py", line 1380, in __init__
3393        self._name = parent._create(value, name=name)
3394      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 434, in _create
3395        self.set(name, value)
3396      File "/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/sage/interfaces/gp.py", line 557, in set
3397        raise TypeError("Error executing code in GP:\nCODE:\n\t%s\nPARI/GP ERROR:\n%s"%(cmd, out))
3398    TypeError: Error executing code in GP:
3399    CODE:
3400    	sage[12001]=12001;
3401    PARI/GP ERROR:
3402      ***   at top-level: sage[12001]=12001
3403      ***                     ^-------------
3404      ***   non-existent component: index > 12000
3405**********************************************************************
34062 items had failures:
3407   1 of   3 in sage.interfaces.gp.Gp._eval_line
3408   1 of   8 in sage.interfaces.gp.Gp._next_var_name
3409    [155 tests, 2 failures, 10.25 s]

Confirmed (with PARI-2.9.1).

comment:32 in reply to:  26 Changed 6 years ago by Jeroen Demeyer

Replying to cremona:

Since 2.9.1 was released today surely we might as well get that in rather than working more on 2.9.0?

Done. Since this is a minor change, I don't expect any new doctest failures.

comment:33 Changed 6 years ago by Jeroen Demeyer

Just ran make ptestlong and the only issue is indeed 25.

comment:34 Changed 6 years ago by Jeroen Demeyer

Report Upstream: N/AReported upstream. No feedback yet.

comment:35 Changed 6 years ago by Jeroen Demeyer

Description: modified (diff)

25 is an upstream bug :-(

comment:36 Changed 6 years ago by Jeroen Demeyer

It's not an upstream bug, it's fallout from prot_none.patch.

comment:37 Changed 6 years ago by Jeroen Demeyer

Description: modified (diff)
Report Upstream: Reported upstream. No feedback yet.N/A

comment:38 Changed 6 years ago by git

Commit: 768635d691ef52cebbc6b005b25ccc5c7f7f465a5e91b6dc38e4fff0427a2dc7494c2dab5e917399

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

99bb049Upgrade to PARI 2.9.1
5e91b6dUpdate prot_none.patch

comment:39 Changed 6 years ago by git

Commit: 5e91b6dc38e4fff0427a2dc7494c2dab5e917399a0feccc84f6bc4c8da30c5d3840d6f6f9cc365ba

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

a0fecccUpdate prot_none.patch

comment:40 Changed 6 years ago by git

Commit: a0feccc84f6bc4c8da30c5d3840d6f6f9cc365baf7fabb3ba3fe07345ba1eaffdeb5ba4a5f640486

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

f7fabb3Update prot_none.patch

comment:41 Changed 6 years ago by git

Commit: f7fabb3ba3fe07345ba1eaffdeb5ba4a5f6404863da9565a84c0704740e521feb9958ea0dce9c5ef

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

d60ae83Upgrade to PARI 2.9.1
3da9565Update prot_none.patch

comment:42 Changed 6 years ago by Jeroen Demeyer

Status: needs_workneeds_review

This now passes all tests on 32-bit and 64-bit.

comment:43 Changed 6 years ago by git

Commit: 3da9565a84c0704740e521feb9958ea0dce9c5ef1d577e14640d5019790cf2272f52b856ba407607

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

b1c66bdUpgrade to PARI 2.9.1
1d577e1Update prot_none.patch

comment:44 Changed 6 years ago by Vincent Delecroix

Reviewers: John Cremona, Jean-Pierre FloriJohn Cremona, Jean-Pierre Flori, Vincent Delecroix
Status: needs_reviewpositive_review

Probably unrelated but I had one doctest failure running all tests in parallel

sage -t src/sage/libs/gap/assigned_names.py  # 1 doctest failed

I am not able to reproduce it.

comment:45 Changed 6 years ago by Vincent Delecroix

Keywords: atelierpari2017 added

comment:46 Changed 6 years ago by Volker Braun

Branch: u/jdemeyer/upgrade_to_pari_2_8_11d577e14640d5019790cf2272f52b856ba407607
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.