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

Random failure in src/sage/schemes/elliptic_curves/ell_field.py #28383

Open
vbraun opened this issue Aug 22, 2019 · 4 comments
Open

Random failure in src/sage/schemes/elliptic_curves/ell_field.py #28383

vbraun opened this issue Aug 22, 2019 · 4 comments

Comments

@vbraun
Copy link
Member

vbraun commented Aug 22, 2019

File "src/sage/schemes/elliptic_curves/ell_field.py", line 988, in sage.schemes.elliptic_curves.ell_field.EllipticCurve_field.isogenies_prime_degree
Failed example:
    E.isogenies_prime_degree(max_l=3)
Exception raised:
    Traceback (most recent call last):
      File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 681, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1105, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.schemes.elliptic_curves.ell_field.EllipticCurve_field.isogenies_prime_degree[15]>", line 1, in <module>
        E.isogenies_prime_degree(max_l=Integer(3))
      File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/schemes/elliptic_curves/ell_field.py", line 1091, in isogenies_prime_degree
        return sum([isogenies_prime_degree(self, d) for d in L], [])
      File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/schemes/elliptic_curves/isogeny_small_degree.py", line 2340, in isogenies_prime_degree
        return isogenies_2(E, minimal_models=minimal_models)
      File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/schemes/elliptic_curves/isogeny_small_degree.py", line 708, in isogenies_2
        isogs = [E.isogeny(f, model=model) for f in ff]
      File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/schemes/elliptic_curves/ell_field.py", line 878, in isogeny
        return EllipticCurveIsogeny(self, kernel, codomain, degree, model, check=check)
      File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/schemes/elliptic_curves/ell_curve_isogeny.py", line 983, in __init__
        if not isinstance(kernel, list) and kernel in E :
      File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/schemes/elliptic_curves/ell_generic.py", line 423, in __contains__
        P = self(P)
      File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/schemes/elliptic_curves/ell_generic.py", line 549, in __call__
        return plane_curve.ProjectivePlaneCurve.__call__(self, *args, **kwds)
      File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/schemes/generic/scheme.py", line 266, in __call__
        return self.point(args)
      File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/schemes/projective/projective_subscheme.py", line 120, in point
        return self._point(self, v, check=check)
      File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/schemes/elliptic_curves/ell_point.py", line 275, in __init__
        raise TypeError("v (=%s) must have %s components" % (v, d))
      File "sage/structure/sage_object.pyx", line 191, in sage.structure.sage_object.SageObject.__repr__ (build/cythonized/sage/structure/sage_object.c:2428)
        result = reprfunc()
      File "sage/rings/polynomial/polynomial_element.pyx", line 2589, in sage.rings.polynomial.polynomial_element.Polynomial._repr_ (build/cythonized/sage/rings/polynomial/polynomial_element.c:26822)
        return self._repr()
      File "sage/rings/polynomial/polynomial_element.pyx", line 2541, in sage.rings.polynomial.polynomial_element.Polynomial._repr (build/cythonized/sage/rings/polynomial/polynomial_element.c:26025)
        coeffs = self.list(copy=False)
      File "sage/rings/polynomial/polynomial_zz_pex.pyx", line 191, in sage.rings.polynomial.polynomial_zz_pex.Polynomial_ZZ_pEX.list (build/cythonized/sage/rings/polynomial/polynomial_zz_pex.cpp:15301)
        return [K(ZZ_pE_c_to_list(ZZ_pEX_coeff(self.x, i)))
      File "sage/structure/parent.pyx", line 900, in sage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:9197)
        return mor._call_(x)
      File "sage/structure/coerce_maps.pyx", line 162, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:4556)
        raise
      File "sage/structure/coerce_maps.pyx", line 157, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:4448)
        return C._element_constructor(x)
      File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/categories/sets_cat.py", line 994, in _element_constructor_from_element_class
        return self.element_class(self, *args, **keywords)
      File "sage/rings/finite_rings/element_pari_ffelt.pyx", line 336, in sage.rings.finite_rings.element_pari_ffelt.FiniteFieldElement_pari_ffelt.__init__ (build/cythonized/sage/rings/finite_rings/element_pari_ffelt.c:3414)
        self.construct_from(x)
      File "sage/rings/finite_rings/element_pari_ffelt.pyx", line 504, in sage.rings.finite_rings.element_pari_ffelt.FiniteFieldElement_pari_ffelt.construct_from (build/cythonized/sage/rings/finite_rings/element_pari_ffelt.c:5493)
        self.construct_from(self._parent.polynomial_ring()([Fp(y) for y in x]))
      File "sage/rings/finite_rings/element_pari_ffelt.pyx", line 494, in sage.rings.finite_rings.element_pari_ffelt.FiniteFieldElement_pari_ffelt.construct_from (build/cythonized/sage/rings/finite_rings/element_pari_ffelt.c:5172)
        self.construct_from(x.substitute(self._parent.gen()))
      File "sage/rings/polynomial/polynomial_element.pyx", line 452, in sage.rings.polynomial.polynomial_element.Polynomial.subs (build/cythonized/sage/rings/polynomial/polynomial_element.c:8543)
        return self(*x, **kwds)
      File "sage/rings/polynomial/polynomial_zmod_flint.pyx", line 321, in sage.rings.polynomial.polynomial_zmod_flint.Polynomial_zmod_flint.__call__ (build/cythonized/sage/rings/polynomial/polynomial_zmod_flint.cpp:15655)
        return Polynomial.__call__(self, *x, **kwds)
      File "sage/rings/polynomial/polynomial_element.pyx", line 775, in sage.rings.polynomial.polynomial_element.Polynomial.__call__ (build/cythonized/sage/rings/polynomial/polynomial_element.c:9340)
        cst, aa = coercion_model.canonical_coercion(cst, a)
      File "sage/structure/coerce.pyx", line 1270, in sage.structure.coerce.CoercionModel.canonical_coercion (build/cythonized/sage/structure/coerce.c:11302)
        x_elt = (<Map>x_map)._call_(x)
      File "sage/rings/finite_rings/hom_prime_finite_field.pyx", line 95, in sage.rings.finite_rings.hom_prime_finite_field.FiniteFieldHomomorphism_prime._call_ (build/cythonized/sage/rings/finite_rings/hom_prime_finite_field.c:3590)
        return self._codomain._element_constructor(x)
      File "/home/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/sage/categories/sets_cat.py", line 994, in _element_constructor_from_element_class
        return self.element_class(self, *args, **keywords)
      File "sage/rings/finite_rings/element_pari_ffelt.pyx", line 336, in sage.rings.finite_rings.element_pari_ffelt.FiniteFieldElement_pari_ffelt.__init__ (build/cythonized/sage/rings/finite_rings/element_pari_ffelt.c:3414)
        self.construct_from(x)
      File "sage/rings/finite_rings/element_pari_ffelt.pyx", line 410, in sage.rings.finite_rings.element_pari_ffelt.FiniteFieldElement_pari_ffelt.construct_from (build/cythonized/sage/rings/finite_rings/element_pari_ffelt.c:3985)
        sig_on()
    SystemError: calling remove_from_pari_stack() inside sig_on()
**********************************************************************
1 item had failures:
   1 of  43 in sage.schemes.elliptic_curves.ell_field.EllipticCurve_field.isogenies_prime_degree
    [219 tests, 1 failure, 3.54 s]
----------------------------------------------------------------------
sage -t --long src/sage/schemes/elliptic_curves/ell_field.py  # 1 doctest failed
----------------------------------------------------------------------

CC: @jdemeyer @slel

Component: elliptic curves

Keywords: random_fail

Issue created by migration from https://trac.sagemath.org/ticket/28383

@vbraun vbraun added this to the sage-8.9 milestone Aug 22, 2019
@embray
Copy link
Contributor

embray commented Dec 30, 2019

comment:1

Ticket retargeted after milestone closed

@embray embray modified the milestones: sage-8.9, sage-9.1 Dec 30, 2019
@mkoeppe
Copy link
Member

mkoeppe commented May 1, 2020

comment:2

Moving tickets to milestone sage-9.2 based on a review of last modification date, branch status, and severity.

@mkoeppe mkoeppe modified the milestones: sage-9.1, sage-9.2 May 1, 2020
@mkoeppe mkoeppe modified the milestones: sage-9.2, sage-9.3 Oct 24, 2020
@JohnCremona
Copy link
Member

comment:5

I am not sure how to debug this at the Sage level. The test asks for all isogenies of the curve E of degree up to 3, and the error is raised when computing 2-isogenies, of which there are three. These are computed by constructing a EllipticCurveIsogeny object using EllipticCurveIsogeny(E, ker) where ker is a degree 1 polynomial of the form x-x0 over the base field. Since ker is a polynomial it should the 'kohel' algorithm, but the test in line 982 of ell_curve_isogeny tests whether ker is a point using "kernel in E", which attempts to construct a point via E(ker), and that is causing the error. There should be a better way to determine whether the caller has provided a point of E generating the kernel, and not a polynomial.

The file ell_curve_isogeny is over 4000 lines long, mostly not written by me but I have spent many hours in it debugging (though not recently). I would have written it very differently.

I can try replacing the test "kernel in E" with something like

sage: from sage.schemes.elliptic_curves.ell_point import EllipticCurvePoint_field                                               
sage: isinstance(P, EllipticCurvePoint_field) and P.curve() is E

but how to test whether the sporadic error has gone away?

@mkoeppe
Copy link
Member

mkoeppe commented May 10, 2021

comment:6

Moving to 9.4, as 9.3 has been released.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 May 10, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Aug 22, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 18, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 May 3, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants