primesearch / Mlucas

Ⓜ️ Ernst Mayer's Mlucas and Mfactor programs for GIMPS
https://mersenneforum.org/mayer/README.html
GNU General Public License v3.0
8 stars 2 forks source link

Assertion failed: Full-residue == 3^nsquares (mod q) check fails! #32

Open efvb opened 5 months ago

efvb commented 5 months ago

I am using code from main, May 5th, compiled with GCC 11 with tuned Makefile with -O3 -flto=auto -DUSE_ARM_V8_SIMD -mcpu=neoverse-n1 This is an Ampere Arm VM.

I also have the file to restart, if needed.

Mlucas 21.0.1

https://www.mersenneforum.org/mayer/README.html

INFO: testing qfloat routines... System total RAM = 23236, free RAM = 10691 INFO: 10691 MB of free system RAM detected. CPU Family = ARM Embedded ABI, OS = Linux, 64-bit Version, compiled with Gnu C [or other compatible], Version 11.4.1 20230605 (Red Hat 11.4.1-2.1.0.1). INFO: Build uses ARMv8 advanced-SIMD instruction set. INFO: Using prefetch. INFO: Using inline-macro form of MUL_LOHI64. INFO: Using FMADD-based 100-bit modmul routines for factoring. INFO: MLUCAS_PATH is set to "" INFO: using 53-bit-significand form of floating-double rounding constant for scalar-mode DNINT emulation. INFO: testing IMUL routines... INFO: Testing 64-bit 2^p (mod q) functions with 100000 random (p, q odd) pairs... INFO: System has 4 available processor cores. INFO: testing FFT radix tables... Set affinity for the following 4 cores: 0.1.2.3. User did not set LowMem in mlucas.ini ... allowing all test types. User did not set CheckInterval in mlucas.ini ... using default. NTHREADS = 4 Setting ITERS_BETWEEN_CHECKPOINTS = 10000. looking for worktodo.txt file... worktodo.txt file found...reading next assignment... worktodo.txt entry: PRP=164C2E2861CC217CF6033B299322924C,1,2,8546743,-1,99,0,3,5,"209104614239,2707424768671102639169"

INFO: Maximum recommended exponent for FFT length (448 Kdbl) = 8954601; p[ = 8546743]/pmax_rec = 0.9544526886. Initial DWT-multipliers chain length = [long] in carry step. INFO: restart file p8546743 found...reading... Computing 8540000-squaring residue R (mod known prime q = 209104614239) A: R == 9997626983 (mod q) B: R == 135567088145 (mod q) ERROR: at line 5271 of file ../src/Mlucas.c Assertion failed: Full-residue == 3^nsquares (mod q) check fails!

tdulcet commented 5 months ago

Thanks for the bug report!

There are some known issues with LTO (see #10), so would you mind disabling it so we can rule that out. Just remove the -flto=auto argument from your Makefile and then recompile Mlucas.

If that does not help, could you add this printf call:

printf("pow[0] = %llu\npow[1] = %llu\npow[2] = %llu\npow[3] = %llu\n\nrem[0] = %llu\nrem[1] = %llu\nrem[2] = %llu\nrem[3] = %llu\n\nk = %u\n", pow[0], pow[1], pow[2], pow[3], rem[0], rem[1], rem[2], rem[3], k);

above that assert statement on line 5271: https://github.com/primesearch/Mlucas/blob/18398583da19f270eed22a036c27d9b6beb9973d/src/Mlucas.c#L5268-L5271 and then recompile Mlucas. This would provide more information about why the assert statement is failing.