> I noticed that sometimes the Travis CI buildbot succeeds, and Stefan's
> buildbot fails on the same code.
> I also understand that sometimes the 32bit and 64bit Python versions
> behave differently in tests
> and sometimes also major Python versions like 3.2 vs 2.7, also I think
> 2.4 and 2.5 (or maybe it was 2.3 and 2.4).
I do not think that anybody is testing 2.3 or 2.4

> All these are caused by the different behavior of the hash() function.
> In particular, 32bit and 64bit
> and also sometimes Python versions have different hash implementation.
> Also in SymPy,
> sometimes we just store instances in a dictionary, but instances have
> essentially random hash
> (depending on where they sit in the memory, right?).
`id` depends on where they sit in the memory. Most of the hashes in
sympy are overloaded, however they are still dependent on many
environmental factors.

> So rather than trying to make the hash() uniform, we need to make sure
> that SymPy tests pass
> with any hash() implementation. I think the way to do it is to use the
> new "-R" option (http://bugs.python.org/issue13703) and specify
> the PYTHONHASHSEED env variable. We will use let's say 3 or 4
> different tests with different (but definite) value.
> Besides that, we should also run with "-R" and keep the seed random
> (to help discover seeds, that break sympy),
> but we need to be able to print the seed, so that we can add it to the
> test suite. My hope is that by having
> 3 or 4 different seeds will catch pretty much all such bugs in sympy
> (if things behave randomly,
> it shouldn't even matter what seeds we use, as long as we use 3 or 4
> different seeds). And we can just use one platform
> for testing. This should take care of the hash() differences for good 
> hopefully.
Aaron has just pushed a PR that enables hash randomization by default
in the tests, so probably most of the errors you see are coming
exactly from this. Some time ago there was a mailing list discussion
about making the sorting of args in Add and Mul hash agnostic as an
immediate solution. Also it was discussed that for a better solution
we should change the architecture of sympy in a way that never depends
on sorting of args, however this will be hard (it seems that it was
left as a very distant goal).

> Besides the hash, is there any other difference between platforms?
Not any that we should care about, I think.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" 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/sympy?hl=en.

Reply via email to