sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.37k stars 465 forks source link

Test failure in gap/element.pyx #38760

Open mantepse opened 6 days ago

mantepse commented 6 days ago

Steps To Reproduce

martin@convex63:~/sage$ sage -t src/sage/libs/gap/element.pyx
too many failed tests, not using stored timings
Running doctests with ID 2024-10-03-16-58-17-7a849a68.
Git branch: develop
Git ref: 10.5.beta6
Running with SAGE_LOCAL='/home/martin/sage/local' and SAGE_VENV='/home/martin/sage/local/var/lib/sage/venv-python3.10'
Using --optional=debian,dot2tex,fricas,gap_packages,jmol,jupyter_jsmol,libsemigroups,pip,qepcad,saclib,sage,sage_spkg
Features to be detected: 4ti2,SAGE_SRC,benzene,bliss,buckygen,conway_polynomials,coxeter3,csdp,cvxopt,cvxopt,database_cremona_ellcurve,database_cremona_mini_ellcurve,database_cubic_hecke,database_ellcurves,database_graphs,database_jones_numfield,database_knotinfo,dvipng,ecm,fpylll,fricas,gap_package_atlasrep,gap_package_design,gap_package_grape,gap_package_guava,gap_package_hap,gap_package_polycyclic,gap_package_qpa,gap_package_quagroup,gfan,giac,glucose,graphviz,imagemagick,ipython,jmol,jupymake,jupyter_sphinx,kenzo,kissat,latte_int,lrcalc_python,lrslib,mathics,matroid_database,mcqd,meataxe,mpmath,msolve,nauty,networkx,numpy,palp,pandoc,pdf2svg,pdftocairo,pexpect,phitigra,pillow,plantri,polytopes_db,polytopes_db_4d,pplpy,primecountpy,ptyprocess,pycosat,pycryptosat,pynormaliz,pyparsing,python_igraph,requests,rpy2,rubiks,sage.combinat,sage.geometry.polyhedron,sage.graphs,sage.groups,sage.libs.braiding,sage.libs.ecl,sage.libs.flint,sage.libs.gap,sage.libs.giac,sage.libs.homfly,sage.libs.linbox,sage.libs.m4ri,sage.libs.ntl,sage.libs.pari,sage.libs.singular,sage.misc.cython,sage.modular,sage.modules,sage.numerical.mip,sage.plot,sage.rings.complex_double,sage.rings.finite_rings,sage.rings.function_field,sage.rings.number_field,sage.rings.padics,sage.rings.polynomial.pbori,sage.rings.real_double,sage.rings.real_mpfr,sage.sat,sage.schemes,sage.symbolic,sage_numerical_backends_coin,sagemath_doc_html,scipy,singular,sirocco,sphinx,symengine_py,sympy,tdlib,threejs,topcom
Doctesting 1 file.
sage -t --random-seed=193042893373062424981991505836900486184 src/sage/libs/gap/element.pyx
**********************************************************************
File "src/sage/libs/gap/element.pyx", line 2440, in sage.libs.gap.element.GapElement_Function.__call__
Failed example:
    sorted(a(b))
Expected:
    [Group(()),
     Sym( [ 1 .. 4 ] ),
     Alt( [ 1 .. 4 ] ),
     Group([ (1,4)(2,3), (1,2)(3,4) ])]
Got:
    [Group(()),
     Sym( [ 1 .. 4 ] ),
     Alt( [ 1 .. 4 ] ),
     Group([ (1,4)(2,3), (1,3)(2,4) ])]
**********************************************************************
1 item had failures:
   1 of  26 in sage.libs.gap.element.GapElement_Function.__call__
    [519 tests, 1 failure, 2.19 s]
----------------------------------------------------------------------
sage -t --random-seed=193042893373062424981991505836900486184 src/sage/libs/gap/element.pyx  # 1 doctest failed
----------------------------------------------------------------------
Total time for all tests: 7.3 seconds
    cpu time: 1.7 seconds
    cumulative wall time: 2.2 seconds
Features detected for doctesting:

Expected Behavior

test should pass

Actual Behavior

they don't

Additional Information

No response

Environment

Checklist

dimpase commented 6 days ago

how about just replacing Group([ (1,4)(2,3), (1,3)(2,4) ])] with Group([ (1,4)(2,3), (1...4) ])]

enriqueartal commented 6 days ago

I have seen this error other times. The group is the same.

enriqueartal commented 6 days ago

I have the develop branch installed in three different computers with Fedora 40; it fails in two of them, not in the third one.

dimpase commented 5 days ago

several things may affect the discrepancy in this test. E.g. for different random seeds the results might differ; installed GAP packages may provide algorithms used instead of the default one, and give different generators for the same group. A robust test would call GAP's StructureDescription() on the elements of the list in question. In particular for the last entry it gives "C2 x C2".

dimpase commented 5 days ago

Like this:

sage: [x.StructureDescription() for x in sorted(a(b))]
["1", "S4", "A4", "C2 x C2"]