mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > YAFU

Reply
 
Thread Tools
Old 2018-04-23, 06:10   #1
tmp
 
Apr 2018

1 Posts
Default two (trivial) bugs for yafu 1.34

Hello. When I played with yafu-1.34 recently, I found some unusual behaviours as below:

1. The state_fermat is bypassed on Linux machine, due to uninitalized fermat_iterations variable.

2. When I use a large number consist of many primes, the output type can be wrong. It seems the type variables are not correctly updated when delete factors. For example, one factor is wrongly labeled as prime here.
Code:
user@machine:~$ ./yafu


04/23/18 06:03:04 v1.34.5 @ machine, System/Build Info:
Using GMP-ECM 6.4.4, Powered by GMP 5.1.1
detected Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz
detected L1 = 32768 bytes, L2 = 31457280 bytes, CL = 64 bytes
measured cpu frequency ~= 2199.976780
using 20 random witnesses for Rabin-Miller PRP checks

===============================================================
======= Welcome to YAFU (Yet Another Factoring Utility) =======
=======             bbuhrow@gmail.com                   =======
=======     Type help at any time, or quit to quit      =======
===============================================================
cached 78498 primes. pmax = 999983


>> factor(27581 * 27583 * 27611 * 27617 * 27631 * 27647 * 27653 * 27673 * 27689 * 27691 * 27697 * 27701 * 27733 * 27737 * 27739)

fac: factoring 4256714116406481080465850827827846132360630331512285046282096722381
fac: using pretesting plan: normal
fac: no tune info: using qs/gnfs crossover of 95 digits
div: primes less than 10000
rho: x^2 + 3, starting 1000 iterations on C67
rho: x^2 + 2, starting 1000 iterations on C67
rho: x^2 + 2, starting 1000 iterations on C63
rho: x^2 + 2, starting 1000 iterations on C54
rho: x^2 + 2, starting 1000 iterations on C45
rho: x^2 + 2, starting 1000 iterations on C40
rho: x^2 + 2, starting 1000 iterations on C36
rho: x^2 + 2, starting 1000 iterations on C18
rho: x^2 + 2, starting 1000 iterations on C9
fac: factoring 765295807
fac: using pretesting plan: normal
fac: no tune info: using qs/gnfs crossover of 95 digits
div: primes less than 10000
fmt: 1000000 iterations
Total factoring time = 0.0059 seconds
fac: factoring 587328196026280979
fac: using pretesting plan: normal
fac: no tune info: using qs/gnfs crossover of 95 digits
div: primes less than 10000
fmt: 1000000 iterations
fac: factoring 766734251
fac: using pretesting plan: normal
fac: no tune info: using qs/gnfs crossover of 95 digits
div: primes less than 10000
fmt: 1000000 iterations
Total factoring time = 0.0054 seconds
fac: factoring 766012729
fac: using pretesting plan: normal
fac: no tune info: using qs/gnfs crossover of 95 digits
div: primes less than 10000
fmt: 1000000 iterations
Total factoring time = 0.0055 seconds
Total factoring time = 0.0215 seconds
fac: factoring 763304359
fac: using pretesting plan: normal
fac: no tune info: using qs/gnfs crossover of 95 digits
div: primes less than 10000
fmt: 1000000 iterations
Total factoring time = 0.0057 seconds
too many refactorization attempts, aborting
Total factoring time = 0.0451 seconds


***factors found***

P5 = 27701
P5 = 27739
P5 = 27689
P9 = 761538991
P5 = 27653
P5 = 27691
P5 = 27697
P5 = 27631
P5 = 27733
P5 = 27647
P5 = 27737
P5 = 27617
P5 = 27673
P5 = 27583

ans = 1
The yafu program is downloaded from sourceforge (https://sourceforge.net/projects/yaf...atest/download)


I have tried to patch it locally as below, if anyone interested. (the newest source I have found is 1.34.3)

Code:
user@machine:~$ diff ~/yafu-1.34-src/yafu-1.34.3/factor/factor_common.c ~/yafu-1.34-src/yafu-1.34.3/factor/factor_common.c.bak
557d556
<                 fobj->fobj_factors[j].type = fobj->fobj_factors[j+1].type;
1816d1814
<     fwork->fermat_iterations = 0;
tmp is offline   Reply With Quote
Old 2018-05-19, 21:14   #2
blufox
 
May 2018

3 Posts
Default The yafu bug, is it universal?

The yafu that I have just compiled from the source files available here cannot factor this integer [67 digits]: 4256714116406481080465850827827846132360630331512285046282096722381
Well, yafu factors it but does not get it right. The factoring time is less than a second, but in the list of factors is P9 = 761538991, which is not prime. Therefore yafu gets it WRONG!
Do other versions of yafu have this problem? I would like to find a version of yafu that can factor this integer. What is special about this integer? Other factoring programs, such as msieve and pari-gp, get it right. Why do I care? Well, for integers up to 70 digits or so, yafu has the best time, and I have a lot of such integers to factor.
blufox is offline   Reply With Quote
Old 2018-05-20, 03:24   #3
kladner
 
kladner's Avatar
 
"Kieren"
Jul 2011
In My Own Galaxy!

2·3·1,693 Posts
Default

Hi! And welcome to the forum. May you find what you are looking for!
I am a recently appointed moderator, and yours is the first post I got to pass through. Thanks!
kladner is offline   Reply With Quote
Old 2018-05-20, 13:02   #4
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

2·32·191 Posts
Default

There was a bug in the rho code that was fixed a while ago that may be causing this... are you using the latest source from /branches/wip?
bsquared is offline   Reply With Quote
Old 2018-05-24, 08:52   #5
blufox
 
May 2018

112 Posts
Default Am I getting yafu from the correct place?

Here is the url:

http://www.mersenneforum.org/showthread.php?t=23087

Here is what is suggested to get yafu:

svn co https://svn.code.sf.net/p/yafu/code/branches/wip

Here is what happens:

version 1.34.5 in directory yafu-code on 21 May 18
version 1.35 beta in directory wip on 23 May 18 <--- does not compile

Am I getting yafu from the correct place?
blufox is offline   Reply With Quote
Old 2018-05-24, 13:11   #6
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

343810 Posts
Default

Yes, that looks like the right place. And I've verified the bug with yafu-1.34.5. branches/wip works. So, how are you trying to compile the wip version?
bsquared is offline   Reply With Quote
Old 2018-05-24, 16:43   #7
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

2·3·619 Posts
Default

I ran the composite with several of my machines across three different platforms and OSs with no issue, so I can't duplicate the trouble here.
EdH is offline   Reply With Quote
Old 2018-05-27, 06:40   #8
blufox
 
May 2018

316 Posts
Default I am getting a compiler error

Two hours ago I did the following to make sure that I have the latest code:

svn co https://svn.code.sf.net/p/yafu/code/branches/wip

Question: Why is spbrent.c in the top directory?

I am running Fedora 28. I am using gcc version 8.1.1-1. I modified the makefile for my environment. This is the compiler error that I am getting:

Quote:
gcc -march=native -mtune=native -g -DUSE_SSE41 -m64 -msse4.1 -DUSE_NFS -O3 -fomit-frame-pointer -Wall -I. -Iinclude -Itop/aprcl -Itop/ -I../gmp/include -I../../ecm-7.0.3/install/include/ -c -o factor/qs/msieve/lanczos.o factor/qs/msieve/lanczos.c
In file included from include/factor.h:25,
from include/lanczos.h:21,
from factor/qs/msieve/lanczos.c:18:
include/arith.h:53:34: error: expected declaration specifiers or ‘...’ before ‘(’ token
__inline uint32_t _reset_lsb(x) ((x) &= ((x)-1))
^
factor/qs/msieve/lanczos.c: In function ‘yafu_block_lanczos_core’:
factor/qs/msieve/lanczos.c:1245:5: warning: null argument where non-null required (argument 1) [-Wnonnull]
fprintf(NULL, "linear algebra completed %u "
^~~~~~~
make: *** [Makefile:357: factor/qs/msieve/lanczos.o] Error 1
blufox is offline   Reply With Quote
Old 2018-05-29, 19:38   #9
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

2×32×191 Posts
Default

Quote:
Originally Posted by blufox View Post
Two hours ago I did the following to make sure that I have the latest code:

svn co https://svn.code.sf.net/p/yafu/code/branches/wip

Question: Why is spbrent.c in the top directory?

I am running Fedora 28. I am using gcc version 8.1.1-1. I modified the makefile for my environment. This is the compiler error that I am getting:
Sorry about that - I hadn't sufficiently tested the various build methods. Hopefully fixed now (r369).
(I suspect there will still be cases that won't work.)
bsquared is offline   Reply With Quote
Old 2018-05-30, 21:32   #10
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

2×3×619 Posts
Default

Is gcc-7.3.0 a requirement? The repository gcc for Ubuntu 16.04 is 5.4.0, which compiles r369 without trouble. (I'm also compiling it against r1021 of msieve.) I am running the r369 revision on a test machine ATM, with no noticeable issues.


Thanks for all...

Last fiddled with by EdH on 2018-05-30 at 21:33
EdH is offline   Reply With Quote
Old 2018-05-30, 22:05   #11
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

2·32·191 Posts
Default

Quote:
Originally Posted by EdH View Post
Is gcc-7.3.0 a requirement? The repository gcc for Ubuntu 16.04 is 5.4.0, which compiles r369 without trouble. (I'm also compiling it against r1021 of msieve.) I am running the r369 revision on a test machine ATM, with no noticeable issues.


Thanks for all...
Not a requirement unless you want to build AVX512 enabled code (of which there is now some in the sieve of Eratosthenes). Then you need some version of gcc capable of that, which I think starts in 7.x somewhere.
bsquared is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
yafu bugs jwes YAFU 492 2021-04-19 09:44
Running YAFU via Aliqueit doesn't find yafu.ini EdH YAFU 8 2018-03-14 17:22
Trivial question davieddy Information & Answers 6 2011-12-08 08:07
Trivial bug: repeated PM notifications Christenson Forum Feedback 0 2011-03-21 03:49
SNFS trivial factorization fetofs Factoring 39 2006-07-26 12:32

All times are UTC. The time now is 00:17.

Wed May 12 00:17:24 UTC 2021 up 33 days, 18:58, 0 users, load averages: 4.33, 4.09, 3.90

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.