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