Doh, just figured it out. Here is a fix:
lines 149-153 of mpn/mul.c need to be: #if GMP_NUMB_BITS == 32 if ((ABOVE_THRESHOLD (un + vn, 2*MUL_TOOM8H_THRESHOLD)) && (vn >= 86) && (5*un <= 11*vn)) #else if ((ABOVE_THRESHOLD (un + vn, 2*MUL_TOOM8H_THRESHOLD)) && (vn >= 86) && (4*un <= 13*vn)) #endif The problem occurs when un is very large and vn is small, but the sum still over the threshold. Better still, could replace that 86 with TOOM8H_MIN_SIZE in gmp-impl.h or something. Bill. On 26 May 2010 16:40, Bill Hart <[email protected]> wrote: > That is truly bizarre. I mean it is even bigger than 86*2 = 172. > > I don't see how the function can ever be called with bn < 86. > > Scratches head.... I must be missing something obvious.... > > Bill. > > On 26 May 2010 16:02, Jason Moxham <[email protected]> wrote: >> if i change boxens mparams from >> >> #define MUL_TOOM8H_THRESHOLD 224 >> >> >> to >> >> #define MUL_TOOM8H_THRESHOLD 173 >> >> so that it matches powerpc64 >> >> then we get the assertion failure >> >> and it still happens if I change all the mul params over >> >> >> On Wednesday 26 May 2010 15:50:42 Jason Moxham wrote: >>> On Wednesday 26 May 2010 14:45:45 Bill Hart wrote: >>> > But that is a serious problem! >>> > >>> > Which tuning values did you change for boxen which caused the issue to >>> > show up there? >>> >>> i just copied powerpc64/gmp-mparam.h to x86_64/core2/penryn/gmp-mparam.h >>> >>> I can try a few at a time , to see if we can narrow it down >>> >>> > It must be one of the division cutoffs is wrong. That must cause a >>> > negative value to be passed for bn to toom8h_mul or something. But >>> > that is something we'll want to fix. >>> > >>> > Bill. >>> > >>> > On 26 May 2010 14:39, Jason Moxham <[email protected]> wrote: >>> > > On Wednesday 26 May 2010 14:24:57 Bill Hart wrote: >>> > >> I've checked the code over and the only places this function is even >>> > >> called are in mul.c and mul_n.c, and directly from toom8h_mul.c >>> > >> itself. >>> > >> >>> > >> In all cases, it is impossible, with those thresholds, to have bn < >>> > >> 86. >>> > >> >>> > >> Something is definitely going wrong. Either it is picking up the wrong >>> > >> tuning values somehow, the library needs rebuilding, there is a >>> > >> compiler bug, something is wrong with the assert. I don't know. >>> > >> >>> > >> But I'm pretty confident it is not a bug in the way the thresholds are >>> > >> handled. >>> > >> >>> > >> Bill. >>> > > >>> > > I forced boxen to use those gmp-mparam values , and I got the assertion >>> > > failure again , so those values are bad , I will retune again >>> > > >>> > >> On 26 May 2010 13:35, Jason Moxham <[email protected]> wrote: >>> > >> > gcc -std=gnu99 -m64 -mcpu=970 -O3 -o .libs/t-gcdext t-gcdext.o >>> > >> > ../../tests/.libs/libtests.a >>> > >> > /home/jasonmoxham/mpir/branches/test_stuff/varro/.libs/libmpir.dylib >>> > >> > ../../.libs/libmpir.dylib >>> > >> > creating t-gcdext >>> > >> > make check-TESTS >>> > >> > PASS: t-asmtype >>> > >> > PASS: t-aors_1 >>> > >> > PASS: t-divrem_1 >>> > >> > PASS: t-fat >>> > >> > PASS: t-get_d >>> > >> > PASS: t-instrument >>> > >> > PASS: t-iord_u >>> > >> > PASS: t-mulmid >>> > >> > PASS: t-mp_bases >>> > >> > PASS: t-perfsqr >>> > >> > PASS: t-scan >>> > >> > PASS: t-lorrshift1 >>> > >> > PASS: t-divebyff >>> > >> > PASS: t-addadd_n >>> > >> > PASS: t-addsub_n >>> > >> > PASS: t-subadd_n >>> > >> > PASS: t-redc_basecase >>> > >> > PASS: t-divebyBm1of >>> > >> > PASS: t-mullowhigh >>> > >> > PASS: t-mullow_basecase >>> > >> > PASS: t-neg >>> > >> > PASS: t-mulmod_2expp1 >>> > >> > PASS: t-mulmod_2expm1 >>> > >> > PASS: t-tdiv_q >>> > >> > PASS: t-sb_divappr_q >>> > >> > PASS: t-dc_divappr_q_n >>> > >> > PASS: t-inv_divappr_q_n >>> > >> > PASS: t-invert >>> > >> > PASS: t-sb_div_q >>> > >> > PASS: t-sb_div_qr >>> > >> > toom8h_mul.c:84: GNU MP assertion failed: bn >= 86 >>> > >> > FAIL: t-dc_div_q >>> > >> > toom8h_mul.c:84: GNU MP assertion failed: bn >= 86 >>> > >> > FAIL: t-dc_div_qr >>> > >> > toom8h_mul.c:84: GNU MP assertion failed: bn >= 86 >>> > >> > FAIL: t-dc_divappr_q >>> > >> > PASS: t-dc_div_qr_n >>> > >> > PASS: t-inv_divappr_q >>> > >> > toom8h_mul.c:84: GNU MP assertion failed: bn >= 86 >>> > >> > FAIL: t-inv_div_q >>> > >> > toom8h_mul.c:84: GNU MP assertion failed: bn >= 86 >>> > >> > FAIL: t-inv_div_qr >>> > >> > PASS: t-inv_div_qr_n >>> > >> > toom8h_mul.c:84: GNU MP assertion failed: bn >= 86 >>> > >> > FAIL: t-tdiv_qr >>> > >> > PASS: t-sb_bdiv_q >>> > >> > PASS: t-sb_bdiv_qr >>> > >> > PASS: t-dc_bdiv_q_n >>> > >> > PASS: t-dc_bdiv_qr_n >>> > >> > toom8h_mul.c:84: GNU MP assertion failed: bn >= 86 >>> > >> > FAIL: t-dc_bdiv_qr >>> > >> > toom8h_mul.c:84: GNU MP assertion failed: bn >= 86 >>> > >> > FAIL: t-dc_bdiv_q >>> > >> > toom8h_mul.c:84: GNU MP assertion failed: bn >= 86 >>> > >> > FAIL: t-gcdext >>> > >> > PASS: st_fat >>> > >> > PASS: st_instrument >>> > >> > ============================================================= >>> > >> > 9 of 48 tests failed >>> > >> > Please report to http://groups.google.co.uk/group/mpir-devel/ >>> > >> > ============================================================= >>> > >> > make[4]: *** [check-TESTS] Error 1 >>> > >> > make[3]: *** [check-am] Error 2 >>> > >> > make[2]: *** [check-recursive] Error 1 >>> > >> > make[1]: *** [check-recursive] Error 1 >>> > >> > make: *** [check] Error 2 >>> > >> > varro >>> > >> > >>> > >> > PASSED CC=gcc CXX=g++ configure= >>> > >> > PASSED CC=gcc CXX=g++ configure= --enable-cxx --enable-gmpcompat >>> > >> > FAILED CC=gcc CXX=g++ configure= --enable-cxx --enable-gmpcompat >>> > >> > --enable- assert --enable-alloca=debug >>> > >> > >>> > >> > This is on varro 64 bit ie mpn/powerpc64/gmp-mparam.h >>> > >> > and this has been tuned >>> > >> > >>> > >> > On Wednesday 26 May 2010 13:23:25 Jason Moxham wrote: >>> > >> >> This on Cato , note make tune fails on cato , so we cannot tune the >>> > >> >> parameters >>> > >> >> >>> > >> >> >>> > >> >> On Wednesday 26 May 2010 09:29:49 Cactus wrote:PASS: t-dc_bdiv_q_n >>> > >> >> PASS: t-dc_bdiv_qr_n >>> > >> >> PASS: t-dc_bdiv_qr >>> > >> >> PASS: t-dc_bdiv_q >>> > >> >> /bin/sh: line 4: 617 Segmentation fault ${dir}$tst >>> > >> >> FAIL: t-gcdext >>> > >> >> PASS: st_fat >>> > >> >> PASS: st_instrument >>> > >> >> ============================================================= >>> > >> >> 1 of 48 tests failed >>> > >> >> Please report to http://groups.google.co.uk/group/mpir-devel/ >>> > >> >> ============================================================= >>> > >> >> make[4]: *** [check-TESTS] Error 1 >>> > >> >> make[4]: Leaving directory >>> > >> >> `/.root0/home/jasonmoxham/mpir/branches/test_stuff/sca-m0n8.scsyste >>> > >> >>m/ tes ts/ mpn' make[3]: *** [check-am] Error 2 >>> > >> >> make[3]: Leaving directory >>> > >> >> `/.root0/home/jasonmoxham/mpir/branches/test_stuff/sca-m0n8.scsyste >>> > >> >>m/ tes ts/ mpn' make[2]: *** [check-recursive] Error 1 >>> > >> >> make[2]: Leaving directory >>> > >> >> `/.root0/home/jasonmoxham/mpir/branches/test_stuff/sca-m0n8.scsyste >>> > >> >>m/ tes ts' make[1]: *** [check-recursive] Error 1 >>> > >> >> make[1]: Leaving directory >>> > >> >> `/.root0/home/jasonmoxham/mpir/branches/test_stuff/sca-m0n8.scsyste >>> > >> >>m' make: *** [check] Error 2 >>> > >> >> sca-m0n8.scsystem >>> > >> >> >>> > >> >> FAILED CC=gcc CXX=g++ configure= >>> > >> >> jasonmox...@sca-m0n8 ~/mpir/branches/test_stuff $ >>> > >> >> >>> > >> >> We need a better set of default params , we cant have gcdext >>> > >> >> crashing on any system we havent tuned. >>> > >> >> >>> > >> >> Note varro gives some spurious errors sometimes , they go away when >>> > >> >> you retry the operation , this must be something to do with NFS >>> > >> >> >>> > >> >> > On May 26, 8:00 am, Minh Nguyen <[email protected]> wrote: >>> > >> >> > > Hi folks, >>> > >> >> > > >>> > >> >> > > MPIR 2.1.0-rc1 was released on 25th May 2010. >>> > >> >> > > >>> > >> >> > > Source:http://www.mpir.org/mpir-2.1.0-rc1.tar.gz >>> > >> >> > > >>> > >> >> > > Documentation:http://www.mpir.org/mpir-2.1.0.pdf >>> > >> >> > > >>> > >> >> > > The main features and changes in this release cycle are: >>> > >> >> > > >>> > >> >> > > * Fixed the xgcd normalisation issue and redid the tuning code >>> > >> >> > > for gcd and xgcd * Fixes for compiling with GCC 4.5.0 on >>> > >> >> > > Itanium * Set default flags for GCC to -O2 on Itanium as GCC >>> > >> >> > > 4.5.0 fails to handle -O3 * Experimental build with Visual >>> > >> >> > > Studio 2010 * Removed all old gcdext_threshold that were set to >>> > >> >> > > zero * Changed all mpn_sqr_n to mpn_sqr >>> > >> >> > > >>> > >> >> > > The changelog for the MPIR 2.1.0 release cycle is available at >>> > >> >> > > >>> > >> >> > > http://www.mpir.org/changes.html >>> > >> >> > > >>> > >> >> > > If it is missing something, please report to this list. Please >>> > >> >> > > test and report all issues. >>> > >> >> > > >>> > >> >> > > As I'm progressing in managing this release cycle, I'm fleshing >>> > >> >> > > out details on issuing an MPIR release. The current document >>> > >> >> > > [1] is a work in progress and based on Bill's recent post [2] >>> > >> >> > > in which he outlines necessary workflows. Comments, >>> > >> >> > > suggestions, or enhancements are welcome. >>> > >> >> > > >>> > >> >> > > [1]http://www.mpir.org/release.html >>> > >> >> > > >>> > >> >> > > [2]http://groups.google.com/group/mpir-devel/browse_thread/thre >>> > >> >> > >ad /f9 39c 5. .. >>> > >> >> > > >>> > >> >> > > -- >>> > >> >> > > Regards >>> > >> >> > > Minh Van Nguyen >>> > >> >> > >>> > >> >> > Hi Minh, >>> > >> >> > >>> > >> >> > Congratulations on your progress in taking on the release >>> > >> >> > management role! >>> > >> >> > >>> > >> >> > There was a minor error in 'setversion' that meant that the >>> > >> >> > Windows version string was not being set. >>> > >> >> > >>> > >> >> > I think (maybe 'hope' as I am not a frequent user of Unix text >>> > >> >> > processing tools) I have corrected setversion and gmp-h.in in the >>> > >> >> > SVN repository accordingly. >>> > >> >> >>> > >> >> looks fine to me >>> > >> >> >>> > >> >> > Brian >>> > >> > >>> > >> > -- >>> > >> > You received this message because you are subscribed to the Google >>> > >> > Groups "mpir-devel" group. To post to this group, send email to >>> > >> > [email protected]. To unsubscribe from this group, send >>> > >> > email to [email protected]. For more options, >>> > >> > visit this group at http://groups.google.com/group/mpir-devel?hl=en. >>> > > >>> > > -- >>> > > You received this message because you are subscribed to the Google >>> > > Groups "mpir-devel" group. To post to this group, send email to >>> > > [email protected]. To unsubscribe from this group, send email >>> > > to [email protected]. For more options, visit >>> > > this group at http://groups.google.com/group/mpir-devel?hl=en. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "mpir-devel" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/mpir-devel?hl=en. >> >> > -- You received this message because you are subscribed to the Google Groups "mpir-devel" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/mpir-devel?hl=en.
