Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gap 4.13 released, some doctest failures #37616

Open
tornaria opened this issue Mar 15, 2024 · 9 comments · May be fixed by #38169
Open

Gap 4.13 released, some doctest failures #37616

tornaria opened this issue Mar 15, 2024 · 9 comments · May be fixed by #38169

Comments

@tornaria
Copy link
Contributor

----------------------------------------------------------------------
sage -t --warn-long 10.0 --random-seed=32031828330801998112684409287747815985 sage/groups/perm_gps/permgroup_named.py  # 3 doctests failed
sage -t --warn-long 10.0 --random-seed=32031828330801998112684409287747815985 sage/interfaces/gap.py  # 1 doctest failed
sage -t --warn-long 10.0 --random-seed=32031828330801998112684409287747815985 sage/categories/simplicial_sets.py  # 7 doctests failed
sage -t --warn-long 10.0 --random-seed=32031828330801998112684409287747815985 sage/groups/finitely_presented.py  # 5 doctests failed
sage -t --warn-long 10.0 --random-seed=32031828330801998112684409287747815985 sage/groups/libgap_wrapper.pyx  # 1 doctest failed
sage -t --warn-long 10.0 --random-seed=32031828330801998112684409287747815985 sage/interfaces/gap3.py  # 2 doctests failed
----------------------------------------------------------------------

Mostly seem to be due to changes in order of generators.

@dimpase
Copy link
Member

dimpase commented Mar 17, 2024

why is gap3 involved here?

is it compared with gap4.13?

@tornaria
Copy link
Contributor Author

sage -t --long --warn-long 30.0 --random-seed=136505318494519323046791635148959727560 sage/interfaces/gap3.py
**********************************************************************
File "sage/interfaces/gap3.py", line 756, in sage.interfaces.gap3.GAP3Element._latex_
Failed example:
    s._latex_()
Expected:
    '\\left(\\begin{array}{rr} 1&2\\\\ 3/4&\\frac{5}{6}\\\\ \\end{array}\\right)'
Got:
    '[ [ 1, 2 ], [ 3/4, 5/6 ] ]' 
**********************************************************************
File "sage/interfaces/gap3.py", line 758, in sage.interfaces.gap3.GAP3Element._latex_
Failed example:
    latex(s)
Expected:
    \left(\begin{array}{rr} 1&2\\ 3/4&\frac{5}{6}\\ \end{array}\right)
Got:
    [ [ 1, 2 ], [ 3/4, 5/6 ] ]
**********************************************************************
1 item had failures:
   2 of   4 in sage.interfaces.gap3.GAP3Element._latex_
    [11 tests, 2 failures, 0.16 s]

@tornaria
Copy link
Contributor Author

@antonio-rojas @kiwifb

@dimpase
Copy link
Member

dimpase commented Mar 18, 2024

sage -t --long --warn-long 30.0 --random-seed=136505318494519323046791635148959727560 sage/interfaces/gap3.py
**********************************************************************
File "sage/interfaces/gap3.py", line 756, in sage.interfaces.gap3.GAP3Element._latex_
Failed example:
    s._latex_()
Expected:
    '\\left(\\begin{array}{rr} 1&2\\\\ 3/4&\\frac{5}{6}\\\\ \\end{array}\\right)'
Got:
    '[ [ 1, 2 ], [ 3/4, 5/6 ] ]' 
**********************************************************************
File "sage/interfaces/gap3.py", line 758, in sage.interfaces.gap3.GAP3Element._latex_
Failed example:
    latex(s)
Expected:
    \left(\begin{array}{rr} 1&2\\ 3/4&\frac{5}{6}\\ \end{array}\right)
Got:
    [ [ 1, 2 ], [ 3/4, 5/6 ] ]
**********************************************************************
1 item had failures:
   2 of   4 in sage.interfaces.gap3.GAP3Element._latex_
    [11 tests, 2 failures, 0.16 s]

It's a bug in the tests there; obviously it should be using gap3 (as it otherwise does not test the implementation in this function!), not gap (i.e. gap4). So we should apply

--- a/src/sage/interfaces/gap3.py
+++ b/src/sage/interfaces/gap3.py
@@ -752,7 +752,8 @@ class GAP3Element(GapElement_generic):
         r"""
         EXAMPLES::
 
-            sage: s = gap("[[1,2], [3/4, 5/6]]")
+            sage: # optional - gap3
+            sage: s = gap3("[[1,2], [3/4, 5/6]]")
             sage: s._latex_()
             '\\left(\\begin{array}{rr} 1&2\\\\ 3/4&\\frac{5}{6}\\\\ \\end{array}\\right)'
             sage: latex(s)

Otherwise we merely testing what gap4 can do (and what you see is that gap4.13 is broken at this place).

Unfortunately the diff above, with gap3 installed, gives

File "src/sage/interfaces/gap3.py", line 757, in sage.interfaces.gap3.GAP3Element._latex_
Failed example:
    s._latex_()
Expected:
    '\\left(\\begin{array}{rr} 1&2\\\\ 3/4&\\frac{5}{6}\\\\ \\end{array}\\right)'
Got:
    '1&2\\\\\\n\\frac34&\\frac56\\\\\\n'
**********************************************************************
File "src/sage/interfaces/gap3.py", line 759, in sage.interfaces.gap3.GAP3Element._latex_
Failed example:
    latex(s)
Expected:
    \left(\begin{array}{rr} 1&2\\ 3/4&\frac{5}{6}\\ \end{array}\right)
Got:
    1&2\\\n\frac34&\frac56\\\n

OTOH gap3 is an experimental package, so this is tolerable (without gap3 installed, there won't be a doctest failure here, after this patch is applied.

@dimpase
Copy link
Member

dimpase commented Mar 18, 2024

I've opened #37624 to fix this little thing - it's quite orthogonal to gap 4.13, so it deserves a separate PR. Please review/approve it.

@antonio-rojas
Copy link
Contributor

There's one more failure with --long

File "/usr/lib/python3.11/site-packages/sage/algebras/fusion_rings/fusion_double.py", line 134, in sage.algebras.fusion_rings.fusion_double.FusionDouble
Failed example:
    b13^2 # long time (4s)
Expected:
    b0 + b2 + b4 + b15 + b16 + b17 + b18 + b24 + b26 + b27
Got:
    b0 + b3 + b4

@antonio-rojas
Copy link
Contributor

antonio-rojas commented Mar 18, 2024

LaTeX and LaTeXObj are gone in 4.13 (and there doesn't seem to be a replacement)

gap-system/gap#5524

@dimpase
Copy link
Member

dimpase commented Mar 18, 2024

LaTeX and LaTeXObj are gone in 4.13 (and there doesn't seem to be a replacement)

gap-system/gap#5524

we can use https://gap-packages.github.io/typeset/ I presume

vbraun pushed a commit to vbraun/sage that referenced this issue Mar 30, 2024
    
this fixes a long-standing bug in testing gap3 code, pointed out in
sagemath#37616
    
URL: sagemath#37624
Reported by: Dima Pasechnik
Reviewer(s): Gonzalo Tornaría
@antonio-rojas
Copy link
Contributor

There's one more failure that only manifests itself if bliss is installed

sage -t --long --random-seed=192739335773734784141473037713226530622 /usr/lib/python3.12/site-packages/sage/graphs/generic_graph.py
**********************************************************************
File "/usr/lib/python3.12/site-packages/sage/graphs/generic_graph.py", line 23617, in sage.graphs.generic_graph.GenericGraph.?
Failed example:
    G.is_isomorphic(H)
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python3.12/site-packages/sage/doctest/forker.py", line 714, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/usr/lib/python3.12/site-packages/sage/doctest/forker.py", line 1146, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.graphs.generic_graph.GenericGraph.?[14]>", line 1, in <module>
        G.is_isomorphic(H)
      File "/usr/lib/python3.12/site-packages/sage/groups/perm_gps/permgroup.py", line 4287, in is_isomorphic
        iso = self._libgap_().IsomorphismGroups(right)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "sage/libs/gap/element.pyx", line 2645, in sage.libs.gap.element.GapElement_MethodProxy.__call__ (build/cythonized/sage/libs/gap/element.c:27071)
        return GapElement_Function.__call__(self, * ([self.first_argument] + list(args)))
      File "sage/libs/gap/element.pyx", line 2514, in sage.libs.gap.element.GapElement_Function.__call__ (build/cythonized/sage/libs/gap/element.c:26326)
        sig_on()
    sage.libs.gap.util.GAPError: Error, no method found! Error, no 1st choice method found for `Representative' on 1 arguments
    The 1st argument is 'fail' which might point to an earlier problem
**********************************************************************

But it seems to be an upstream issue
gap-system/gap#5708

@mkoeppe mkoeppe added this to the sage-10.4 milestone May 3, 2024
@mkoeppe mkoeppe linked a pull request Jun 9, 2024 that will close this issue
5 tasks
vbraun pushed a commit to vbraun/sage that referenced this issue Jun 10, 2024
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

- Based on sagemath#37884 by @tornaria
- Fixes sagemath#37616

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->

- Depends on sagemath#38144 (merged here for testing)
    
URL: sagemath#38169
Reported by: Matthias Köppe
Reviewer(s):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants