Semireproducible assertion failure

9 views
Skip to first unread message

Joachim Durchholz

unread,
May 2, 2012, 5:05:22 PM5/2/12
to sy...@googlegroups.com
I just got a nonreproducible assertion failure.
I.e. bin/test (with no additional options) gave me an AssertionError on
line 293 of sympy/polys/tests/test_polyroots.py.
Sure enough, that line compares two hashes for equality.

Rerunning the test in isolation did not reproduce the error, nor did
rerunning the test suite in full reproduce.
It does reproduce with the right random seed, 13604685, on my current
workdir and on current master.

Here's the first few lines of bin/test output:

============================= test process starts
==============================
executable: /usr/bin/python (2.7.3-final-0)
architecture: 64-bit
cache: yes
ground types: python
random seed: 13604685

What now?

Aaron Meurer

unread,
May 2, 2012, 5:47:10 PM5/2/12
to sy...@googlegroups.com
I can reproduce this with ./bin/test --seed=13604685
sympy/polys/tests/test_polyroots.py

I put in some print statements, and it seems that roots is returning
{1: 1, y/2 - sqrt(8*x**2 + y**2 - 2*y + 1)/2 + 1/2: 0, y/2 +
sqrt(8*x**2 + y**2 - 2*y + 1)/2 + 1/2: 0} when it should be returning
{1: 1, y/2 - sqrt(8*x**2 + y**2 - 2*y + 1)/2 + 1/2: 1, y/2 +
sqrt(8*x**2 + y**2 - 2*y + 1)/2 + 1/2: 1} (the difference is the
values).

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To post to this group, send email to sy...@googlegroups.com.
> To unsubscribe from this group, send email to
> sympy+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sympy?hl=en.
>

Aaron Meurer

unread,
May 2, 2012, 6:15:53 PM5/2/12
to sy...@googlegroups.com, Mateusz Paprocki
I've been tracking this in a debugger. There is a bug in the Wang
factorization algorithm. The difference comes at line 920 of
factortools.py, where a random number is used. I can try and see if I
can figure this out, but it probably won't be easy without
understanding of the algorithm.

Mateusz, can you look at this? For reference, the input to dmp_zz_wang is

f = [[[mpz(2)]], [[]], [[mpz(1), mpz(-1)], [mpz(-1), mpz(1),
mpz(0)]]], u = 2, K = ZZ, mod=None.

Aaron Meurer

Aaron Meurer

unread,
May 4, 2012, 8:12:28 PM5/4/12
to sy...@googlegroups.com, Mateusz Paprocki
I opened http://code.google.com/p/sympy/issues/detail?id=3256 for this.

Aaron Meurer
Reply all
Reply to author
Forward
0 new messages