cschwan / sage-on-gentoo

(Unofficial) Gentoo Overlay for Sage- and Sage-related ebuilds
84 stars 26 forks source link

--randon-seed and consistent doctest results #688

Closed strogdon closed 2 years ago

strogdon commented 2 years ago

This is on vanilla but I'm sure the phenomenon exist on s-o-g. Sage automatically sets the random-seed when doctesting. When running the testsuite I have the failure

sage -t --long --warn-long 96.7 --random-seed=323793429833434243810534467855837341563 src/sage/schemes/toric/sheaf/klyachko.py
**********************************************************************
File "src/sage/schemes/toric/sheaf/klyachko.py", line 951, in sage.schemes.toric.sheaf.klyachko.KlyachkoBundle_class.random_deformation
Failed example:
    Vtilde.cohomology(dim=True, weight=(0,))
Expected:
    (1, 0)
Got:
    (0, 0)

which I can replicate by running the test individually using the indicated random-seed. However running the test individually as

./sage -t --long src/sage/schemes/toric/sheaf/klyachko.py

Sage selects a new random-seed and the test passes

sage -t --long --warn-long 90.1 --random-seed=257179504306441420102668740208004283296 src/sage/schemes/toric/sheaf/klyachko.py
    [151 tests, 13.49 s]
----------------------------------------------------------------------
All tests passed!

Any idea what's up?

strogdon commented 2 years ago
sage -t --long --warn-long 96.7 --random-seed=323793429833434243810534467855837341563 /usr/lib/python3.10/site-packages/sage/schemes/toric/sheaf/klyachko.py

also fails on s-o-g but

sage -t --long /usr/lib/python3.10/site-packages/sage/schemes/toric/sheaf/klyachko.py

selects the random-seed

sage -t --long --warn-long 92.2 --random-seed=303102343567653614112271349982422554511 /usr/lib/python3.10/site-packages/sage/schemes/toric/sheaf/klyachko.py
    [151 tests, 6.90 s]
----------------------------------------------------------------------
All tests passed!
kiwifb commented 2 years ago

That needs a post on sage-devel. It looks like you have found a particular case that needs to be studied.

strogdon commented 2 years ago

It looks like random-seed is not a done deal. See

https://trac.sagemath.org/ticket/32773 https://trac.sagemath.org/ticket/29935 https://trac.sagemath.org/ticket/32544

kiwifb commented 2 years ago

It does exactly what it's supposed to do. Find bugs.

strogdon commented 2 years ago

I learned something about random-seed.