PARI/GP Bug report logs - #2469
regression in factor() in pari 2.15.3

version graph

Package: pari-stable; Maintainer for pari-stable is Aurel Page <aurel.page@normalesup.org>; Source for pari-stable is src:pari-stable.

Reported by: dima.pasechnik@cs.ox.ac.uk

Date: Tue, 28 Mar 2023 14:48:01 UTC

Severity: normal

Found in version 2.15.3

Done: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>

Bug is archived. No further changes may be made.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list@pari.math.u-bordeaux.fr, Aurel Page <aurel.page@normalesup.org>:
Bug#2469; Package pari-stable. (Tue, 28 Mar 2023 14:48:01 GMT) (full text, mbox, link).


Acknowledgement sent to dima.pasechnik@cs.ox.ac.uk:
New Bug report received and forwarded. Copy sent to Aurel Page <aurel.page@normalesup.org>. (Tue, 28 Mar 2023 14:48:01 GMT) (full text, mbox, link).


Message #5 received at submit@pari.math.u-bordeaux.fr (full text, mbox, reply):

From: dima.pasechnik@cs.ox.ac.uk
To: submit@pari.math.u-bordeaux.fr
Cc: Lorenz Panny <lorenz@yx7.cc>, Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
Subject: regression in factor() in pari 2.15.3
Date: Tue, 28 Mar 2023 15:36:03 +0100
[Message part 1 (text/plain, inline)]
Package: pari-stable
Version: 2.15.3

Calling factor() on a large prime leads to a hang. With 2.13.4, the
following completes almost instantly:

$ echo "factor(2^2203-1)" | gp -qf

[... output omitted ...]

With pari 2.15.3 and 2.15.2, it keeps running seemingly forever, >10
minutes for sure.


This is apparently fixed as a by-product of 
 > From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
 > Date: Wed, 16 Nov 2022 13:33:21 +0100
 > Subject: [PATCH] Keep product of prime numbers to use in Z_factor_limit

but this is not a good idea to simply apply this, as Bill says.

---
Best,
Dima


[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-submit-list@pari.math.u-bordeaux.fr, Aurel Page <aurel.page@normalesup.org>:
Bug#2469; Package pari-stable. (Wed, 29 Mar 2023 11:03:01 GMT) (full text, mbox, link).


Acknowledgement sent to Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>:
Extra info received and forwarded to list. Copy sent to Aurel Page <aurel.page@normalesup.org>. (Wed, 29 Mar 2023 11:03:01 GMT) (full text, mbox, link).


Message #10 received at 2469@pari.math.u-bordeaux.fr (full text, mbox, reply):

From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
To: dima.pasechnik@cs.ox.ac.uk
Cc: 2694@pari.math.u-bordeaux.fr, Lorenz Panny <lorenz@yx7.cc>
Subject: Re: regression in factor() in pari 2.15.3
Date: Wed, 29 Mar 2023 12:00:37 +0200
On Tue, Mar 28, 2023 at 03:36:03PM +0100, dima.pasechnik@cs.ox.ac.uk wrote:
> Package: pari-stable
> Version: 2.15.3
> 
> Calling factor() on a large prime leads to a hang. With 2.13.4, the
> following completes almost instantly:
> 
> $ echo "factor(2^2203-1)" | gp -qf
> 
> [... output omitted ...]
> 
> With pari 2.15.3 and 2.15.2, it keeps running seemingly forever, >10
> minutes for sure.
> 
> This is apparently fixed as a by-product of 
>  > From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
>  > Date: Wed, 16 Nov 2022 13:33:21 +0100
>  > Subject: [PATCH] Keep product of prime numbers to use in Z_factor_limit

Also the first bad commit is 

commit 22373e45d14f6e4848567569f559f2c6f39913f2 (HEAD, refs/bisect/bad)
Author: Karim Belabas <Karim.Belabas@math.u-bordeaux.fr>
Date:   Sun Jun 13 18:56:36 2021 +0200

    ifactor_sign: fix tuning parameters for avoiding ispsp test

so what happens is probably that ifactor_sign does not detect that the number is prime.

Cheers,
Bill.



Information forwarded to bug-submit-list@pari.math.u-bordeaux.fr, Aurel Page <aurel.page@normalesup.org>:
Bug#2469; Package pari-stable. (Mon, 03 Apr 2023 12:18:02 GMT) (full text, mbox, link).


Acknowledgement sent to Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>:
Extra info received and forwarded to list. Copy sent to Aurel Page <aurel.page@normalesup.org>. (Mon, 03 Apr 2023 12:18:02 GMT) (full text, mbox, link).


Message #15 received at 2469@pari.math.u-bordeaux.fr (full text, mbox, reply):

From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
To: 2469@pari.math.u-bordeaux.fr
Cc: dima.pasechnik@cs.ox.ac.uk, Lorenz Panny <lorenz@yx7.cc>
Subject: Re: Bug#2469: regression in factor() in pari 2.15.3
Date: Mon, 3 Apr 2023 14:13:23 +0200
[Message part 1 (text/plain, inline)]
On Wed, Mar 29, 2023 at 12:00:37PM +0200, Bill Allombert wrote:
> On Tue, Mar 28, 2023 at 03:36:03PM +0100, dima.pasechnik@cs.ox.ac.uk wrote:
> > Package: pari-stable
> > Version: 2.15.3
> > 
> > Calling factor() on a large prime leads to a hang. With 2.13.4, the
> > following completes almost instantly:
> > 
> > $ echo "factor(2^2203-1)" | gp -qf
> > 
> > [... output omitted ...]
> > 
> > With pari 2.15.3 and 2.15.2, it keeps running seemingly forever, >10
> > minutes for sure.
> > 
> > This is apparently fixed as a by-product of 
> >  > From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
> >  > Date: Wed, 16 Nov 2022 13:33:21 +0100
> >  > Subject: [PATCH] Keep product of prime numbers to use in Z_factor_limit
> 
> Also the first bad commit is 
> 
> commit 22373e45d14f6e4848567569f559f2c6f39913f2 (HEAD, refs/bisect/bad)
> Author: Karim Belabas <Karim.Belabas@math.u-bordeaux.fr>
> Date:   Sun Jun 13 18:56:36 2021 +0200
> 
>     ifactor_sign: fix tuning parameters for avoiding ispsp test
> 
> so what happens is probably that ifactor_sign does not detect that the number is prime.

I join a patch, which I hope is correct. This is difficult to test.

Cheers,
Bill.
[patch (text/plain, attachment)]

Information forwarded to bug-submit-list@pari.math.u-bordeaux.fr, Aurel Page <aurel.page@normalesup.org>:
Bug#2469; Package pari-stable. (Tue, 27 Jun 2023 19:33:02 GMT) (full text, mbox, link).


Acknowledgement sent to Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>:
Extra info received and forwarded to list. Copy sent to Aurel Page <aurel.page@normalesup.org>. (Tue, 27 Jun 2023 19:33:02 GMT) (full text, mbox, link).


Message #20 received at 2469@pari.math.u-bordeaux.fr (full text, mbox, reply):

From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
To: 2469@pari.math.u-bordeaux.fr
Cc: dima.pasechnik@cs.ox.ac.uk, Lorenz Panny <lorenz@yx7.cc>
Subject: Re: Bug#2469: regression in factor() in pari 2.15.3
Date: Tue, 27 Jun 2023 21:16:26 +0200
On Mon, Apr 03, 2023 at 02:13:23PM +0200, Bill Allombert wrote:
> I join a patch, which I hope is correct. This is difficult to test.

Dear Dima,

I have made a snapshot of pari 2.15.4 available that should be released in two
weeks:
https://pari.math.u-bordeaux.fr/pub/pari/snapshots/pari-2.15.4-pre1.tar.gz

Could you test that it works with sagemath ?

Cheers,
Bill



Reply sent to Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>:
You have taken responsibility. (Mon, 10 Jul 2023 10:03:01 GMT) (full text, mbox, link).


Notification sent to dima.pasechnik@cs.ox.ac.uk:
Bug acknowledged by developer. (Mon, 10 Jul 2023 10:03:01 GMT) (full text, mbox, link).


Message #25 received at 2469-done@pari.math.u-bordeaux.fr (full text, mbox, reply):

From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
To: 2469-done@pari.math.u-bordeaux.fr
Cc: dima.pasechnik@cs.ox.ac.uk, Lorenz Panny <lorenz@yx7.cc>
Subject: Re: Bug#2469: regression in factor() in pari 2.15.3
Date: Mon, 10 Jul 2023 11:42:35 +0200
On Tue, Jun 27, 2023 at 09:16:26PM +0200, Bill Allombert wrote:
> On Mon, Apr 03, 2023 at 02:13:23PM +0200, Bill Allombert wrote:
> > I join a patch, which I hope is correct. This is difficult to test.
> 
> Dear Dima,
> 
> I have made a snapshot of pari 2.15.4 available that should be released in two
> weeks:
> https://pari.math.u-bordeaux.fr/pub/pari/snapshots/pari-2.15.4-pre1.tar.gz
> 
> Could you test that it works with sagemath ?

I have released 2.15.4 so I close this bug report.
Thanks for reporting this bug!

Cheers,
Bill



Bug archived. Request was from Debbugs Internal Request <allomber@math.u-bordeaux.fr> to internal_control@pari.math.u-bordeaux.fr. (Tue, 08 Aug 2023 05:24:02 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Bill Allombert <allomber@math.u-bordeaux.fr>. Last modified: Fri Apr 4 13:16:45 2025; Machine Name: pari

PARI/GP Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.