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

build/pkgs/singular: Upgrade to 4.3.2p7, reject system Singular without FLINT #35934

Merged
merged 6 commits into from
Sep 1, 2023

Conversation

mkoeppe
Copy link
Contributor

@mkoeppe mkoeppe commented Jul 11, 2023

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

@mkoeppe mkoeppe self-assigned this Jul 11, 2023
@mkoeppe mkoeppe changed the title build/pkgs/singular: Upgrade to 4.3.2p2 build/pkgs/singular: Upgrade to 4.3.2p2, reject system Singular without FLINT Jul 11, 2023
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 12, 2023

Apparently there's something wrong with the documentation.

@sheerluck
Copy link
Contributor

I was able to build documentation after disabling 3 examples

@mkoeppe mkoeppe changed the title build/pkgs/singular: Upgrade to 4.3.2p2, reject system Singular without FLINT build/pkgs/singular: Upgrade to 4.3.2p4, reject system Singular without FLINT Aug 12, 2023
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 12, 2023

Testing this locally, I am getting

sage -t --random-seed=237896731798335436446517996240376867324 src/sage/rings/polynomial/multi_polynomial_ideal.py
**********************************************************************
File "src/sage/rings/polynomial/multi_polynomial_ideal.py", line 2448, in sage.rings.polynomial.multi_polynomial_ideal.?.saturation
Failed example:
    I.saturation(J)
Expected:
    (Ideal (y, x^5) of Multivariate Polynomial Ring in x, y, z over Rational Field, 4)
Got:
    (Ideal (y, x^5) of Multivariate Polynomial Ring in x, y, z over Rational Field,
     0)
**********************************************************************
File "src/sage/rings/polynomial/multi_polynomial_ideal.py", line 2459, in sage.rings.polynomial.multi_polynomial_ideal.?.saturation
Failed example:
    I.saturation(other = J)
Expected:
    (Ideal (y, x^5) of Multivariate Polynomial Ring in x, y, z over Algebraic Field, 4)
Got:
    (Ideal (y, x^5) of Multivariate Polynomial Ring in x, y, z over Algebraic Field,
     0)
**********************************************************************

@sheerluck
Copy link
Contributor

Testing this locally with vbraun/sage (develop branch commit 50208b7) + singular-4.3.2_p5, I am getting

sage -t --long --random-seed=237896731798335436446517996240376867324 sage/rings/polynomial/multi_polynomial_ideal.py
    4 tests not run due to known bugs
    6 ginv tests not run
    13 magma tests not run
    11 not tested tests not run
    [1012 tests, 7.33 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------

@sheerluck
Copy link
Contributor

same with singular-4.3.2_p6

@tornaria
Copy link
Contributor

OTOH, singular 4.3.2p7 gives

sage -t --random-seed=244346095003381053621674002219164718019 src/sage/sandpiles/sandpile.py
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 208, in sage.sandpiles.sandpile
Failed example:
    S.ideal()
Expected:
    Ideal (x1 - x0, x3*x2 - x0^2, x4^2 - x0^2, x2^3 - x4*x3*x0, x4*x2^2 - x3^2*x0, x3^3 - x4*x2*x0, x4*x3^2 - x2^2*x0) of Multivariate Polynomial Ring in x4, x3, x2, x1, x0 over Rational Field
Got:
    Ideal (x1, -x0) of Multivariate Polynomial Ring in x4, x3, x2, x1, x0 over Rational Field
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 213, in sage.sandpiles.sandpile
Failed example:
    S.resolution()
Expected:
    'R^1 <-- R^7 <-- R^15 <-- R^13 <-- R^4'
Got:
    'R^1 <-- R^2 <-- R^1'
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 218, in sage.sandpiles.sandpile
Failed example:
    S.betti()
Expected:
               0     1     2     3     4
    ------------------------------------
        0:     1     1     -     -     -
        1:     -     2     2     -     -
        2:     -     4    13    13     4
    ------------------------------------
    total:     1     7    15    13     4
Got:
               0     1     2
    ------------------------
        0:     1     2     1
    ------------------------
    total:     1     2     1
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 2419, in sage.sandpiles.sandpile.Sandpile.betti_complexes
Failed example:
    S.resolution()
Expected:
    'R^1 <-- R^5 <-- R^5 <-- R^1'
Got:
    'R^1 <-- R^2 <-- R^1'
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 2421, in sage.sandpiles.sandpile.Sandpile.betti_complexes
Failed example:
    S.betti()
Expected:
               0     1     2     3
    ------------------------------
        0:     1     -     -     -
        1:     -     5     5     -
        2:     -     -     -     1
    ------------------------------
    total:     1     5     5     1
Got:
               0     1     2
    ------------------------
        0:     1     -     -
        1:     -     2     -
        2:     -     -     1
    ------------------------
    total:     1     2     1
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 2513, in sage.sandpiles.sandpile.Sandpile.unsaturated_ideal
Failed example:
    S.ideal().gens()
Expected:
    [x2*x1 - x0^2, x3^2 - x0^2, x1^3 - x3*x2*x0, x3*x1^2 - x2^2*x0, x2^3 - x3*x1*x0, x3*x2^2 - x1^2*x0]
Got:
    [x2*x1, -x0^2]
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 2534, in sage.sandpiles.sandpile.Sandpile.ideal
Failed example:
    S.ideal()
Expected:
    Ideal (x2*x1 - x0^2, x3^2 - x0^2, x1^3 - x3*x2*x0, x3*x1^2 - x2^2*x0, x2^3 - x3*x1*x0, x3*x2^2 - x1^2*x0) of Multivariate Polynomial Ring in x3, x2, x1, x0 over Rational Field
Got:
    Ideal (x2*x1, -x0^2) of Multivariate Polynomial Ring in x3, x2, x1, x0 over Rational Field
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 2536, in sage.sandpiles.sandpile.Sandpile.ideal
Failed example:
    S.ideal(True)
Expected:
    [x2*x1 - x0^2, x3^2 - x0^2, x1^3 - x3*x2*x0, x3*x1^2 - x2^2*x0, x2^3 - x3*x1*x0, x3*x2^2 - x1^2*x0]
Got:
    [x2*x1, -x0^2]
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 2538, in sage.sandpiles.sandpile.Sandpile.ideal
Failed example:
    S.ideal().gens()  # another way to get the generators
Expected:
    [x2*x1 - x0^2, x3^2 - x0^2, x1^3 - x3*x2*x0, x3*x1^2 - x2^2*x0, x2^3 - x3*x1*x0, x3*x2^2 - x1^2*x0]
Got:
    [x2*x1, -x0^2]
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 2622, in sage.sandpiles.sandpile.Sandpile.resolution
Failed example:
    S.resolution()  # a Gorenstein sandpile graph
Expected:
    'R^1 <-- R^5 <-- R^5 <-- R^1'
Got:
    'R^1 <-- R^2 <-- R^1'
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 2624, in sage.sandpiles.sandpile.Sandpile.resolution
Failed example:
    S.resolution(True)
Expected:
    [
    [ x1^2 - x3*x0 x3*x1 - x2*x0  x3^2 - x2*x1  x2*x3 - x0^2  x2^2 - x1*x0],
    <BLANKLINE>
    [ x3  x2   0  x0   0]  [ x2^2 - x1*x0]
    [-x1 -x3  x2   0 -x0]  [-x2*x3 + x0^2]
    [ x0  x1   0  x2   0]  [-x3^2 + x2*x1]
    [  0   0 -x1 -x3  x2]  [x3*x1 - x2*x0]
    [  0   0  x0  x1 -x3], [ x1^2 - x3*x0]
    ]
Got:
    [
                   [  x1^2]
    [x3*x0  x1^2], [-x3*x0]
    ]
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 2635, in sage.sandpiles.sandpile.Sandpile.resolution
Failed example:
    r[0]*r[1]
Expected:
    [0 0 0 0 0]
Got:
    [0]
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 2637, in sage.sandpiles.sandpile.Sandpile.resolution
Failed example:
    r[1]*r[2]
Exception raised:
    Traceback (most recent call last):
      File "/home/tornaria/src/sage/sage-git/develop/pkgs/sagemath-standard/build/lib.linux-x86_64-cpython-311/sage/doctest/forker.py", line 709, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/tornaria/src/sage/sage-git/develop/pkgs/sagemath-standard/build/lib.linux-x86_64-cpython-311/sage/doctest/forker.py", line 1144, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.sandpiles.sandpile.Sandpile.resolution[5]>", line 1, in <module>
        r[Integer(1)]*r[Integer(2)]
                      ~^^^^^^^^^^^^
    IndexError: list index out of range
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 2676, in sage.sandpiles.sandpile.Sandpile.groebner
Failed example:
    S.groebner()
Expected:
    [x3*x2^2 - x1^2*x0, x2^3 - x3*x1*x0, x3*x1^2 - x2^2*x0, x1^3 - x3*x2*x0, x3^2 - x0^2, x2*x1 - x0^2]
Got:
    [x2*x1, x0^2]
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 2699, in sage.sandpiles.sandpile.Sandpile.betti
Failed example:
    S.betti()
Expected:
               0     1     2     3
    ------------------------------
        0:     1     -     -     -
        1:     -     2     -     -
        2:     -     4     9     4
    ------------------------------
    total:     1     6     9     4
Got:
               0     1     2
    ------------------------
        0:     1     -     -
        1:     -     2     -
        2:     -     -     1
    ------------------------
    total:     1     2     1
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 2707, in sage.sandpiles.sandpile.Sandpile.betti
Failed example:
    S.betti(False)
Expected:
    [1, 6, 9, 4]
Got:
    [1, 2, 1]
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 2728, in sage.sandpiles.sandpile.Sandpile.solve
Failed example:
    S.solve()
Exception raised:
    Traceback (most recent call last):
      File "/home/tornaria/src/sage/sage-git/develop/pkgs/sagemath-standard/build/lib.linux-x86_64-cpython-311/sage/interfaces/singular.py", line 1358, in __init__
        self._name = parent._create(value, type)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/tornaria/src/sage/sage-git/develop/pkgs/sagemath-standard/build/lib.linux-x86_64-cpython-311/sage/interfaces/singular.py", line 766, in _create
        self.set(type, name, value)
      File "/home/tornaria/src/sage/sage-git/develop/pkgs/sagemath-standard/build/lib.linux-x86_64-cpython-311/sage/interfaces/singular.py", line 709, in set
        self.eval(cmd)
      File "/home/tornaria/src/sage/sage-git/develop/pkgs/sagemath-standard/build/lib.linux-x86_64-cpython-311/sage/interfaces/singular.py", line 667, in eval
        raise SingularError('Singular error:\n%s'%s)
    sage.interfaces.singular.SingularError: Singular error:
       ? `vdG` is undefined
       ? error occurred in or before solve.lib::solve line 687: `  return(ret);`
       ? leaving solve.lib::solve (687)
       skipping text from `;` error at token `)`

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/home/tornaria/src/sage/sage-git/develop/pkgs/sagemath-standard/build/lib.linux-x86_64-cpython-311/sage/doctest/forker.py", line 709, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/tornaria/src/sage/sage-git/develop/pkgs/sagemath-standard/build/lib.linux-x86_64-cpython-311/sage/doctest/forker.py", line 1144, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.sandpiles.sandpile.Sandpile.solve[1]>", line 1, in <module>
        S.solve()
      File "/home/tornaria/src/sage/sage-git/develop/pkgs/sagemath-standard/build/lib.linux-x86_64-cpython-311/sage/sandpiles/sandpile.py", line 2761, in solve
        M = K.solve(5, 1)
            ^^^^^^^^^^^^^
      File "/home/tornaria/src/sage/sage-git/develop/pkgs/sagemath-standard/build/lib.linux-x86_64-cpython-311/sage/interfaces/interface.py", line 696, in __call__
        return self._obj.parent().function_call(self._name, [self._obj] + list(args), kwds)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/tornaria/src/sage/sage-git/develop/pkgs/sagemath-standard/build/lib.linux-x86_64-cpython-311/sage/interfaces/interface.py", line 616, in function_call
        return self.new(s)
               ^^^^^^^^^^^
      File "/home/tornaria/src/sage/sage-git/develop/pkgs/sagemath-standard/build/lib.linux-x86_64-cpython-311/sage/interfaces/interface.py", line 385, in new
        return self(code)
               ^^^^^^^^^^
      File "/home/tornaria/src/sage/sage-git/develop/pkgs/sagemath-standard/build/lib.linux-x86_64-cpython-311/sage/interfaces/singular.py", line 805, in __call__
        return SingularElement(self, type, x, False)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/tornaria/src/sage/sage-git/develop/pkgs/sagemath-standard/build/lib.linux-x86_64-cpython-311/sage/interfaces/singular.py", line 1363, in __init__
        raise TypeError(x)
    TypeError: Singular error:
       ? `vdG` is undefined
       ? error occurred in or before solve.lib::solve line 687: `  return(ret);`
       ? leaving solve.lib::solve (687)
       skipping text from `;` error at token `)`
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 2741, in sage.sandpiles.sandpile.Sandpile.solve
Failed example:
    len(_)
Exception raised:
    Traceback (most recent call last):
      File "/home/tornaria/src/sage/sage-git/develop/pkgs/sagemath-standard/build/lib.linux-x86_64-cpython-311/sage/doctest/forker.py", line 709, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/tornaria/src/sage/sage-git/develop/pkgs/sagemath-standard/build/lib.linux-x86_64-cpython-311/sage/doctest/forker.py", line 1144, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.sandpiles.sandpile.Sandpile.solve[2]>", line 1, in <module>
        len(_)
    TypeError: object of type 'int' has no len()
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 6094, in sage.sandpiles.sandpile.sandlib
Failed example:
    S.resolution()
Expected:
    'R^1 <-- R^5 <-- R^5 <-- R^1'
Got:
    'R^1 <-- R^2 <-- R^1'
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 6286, in sage.sandpiles.sandpile.glue_graphs
Failed example:
    S.resolution()
Expected:
    'R^1 <-- R^7 <-- R^21 <-- R^35 <-- R^35 <-- R^21 <-- R^7 <-- R^1'
Got:
    'R^1 <-- R^2 <-- R^1'
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 6446, in sage.sandpiles.sandpile.admissible_partitions
Failed example:
    for p in P:
     sum([partition_sandpile(S, i).betti(verbose=False)[-1] for i in p])
Expected:
    6
    8
    3
Got:
    6
    4
    1
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 6451, in sage.sandpiles.sandpile.admissible_partitions
Failed example:
    S.betti()
Expected:
               0     1     2     3
    ------------------------------
        0:     1     -     -     -
        1:     -     6     8     3
    ------------------------------
    total:     1     6     8     3
Got:
               0     1     2
    ------------------------
        0:     1     -     -
        1:     -     2     -
        2:     -     -     1
    ------------------------
    total:     1     2     1
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 6492, in sage.sandpiles.sandpile.partition_sandpile
Failed example:
    for p in P:
     sum([partition_sandpile(S, i).betti(verbose=False)[-1] for i in p])
Expected:
    6
    8
    3
Got:
    6
    4
    1
**********************************************************************
File "src/sage/sandpiles/sandpile.py", line 6497, in sage.sandpiles.sandpile.partition_sandpile
Failed example:
    S.betti()
Expected:
               0     1     2     3
    ------------------------------
        0:     1     -     -     -
        1:     -     6     8     3
    ------------------------------
    total:     1     6     8     3
Got:
               0     1     2
    ------------------------
        0:     1     -     -
        1:     -     2     -
        2:     -     -     1
    ------------------------
    total:     1     2     1
**********************************************************************
12 items had failures:
   3 of  79 in sage.sandpiles.sandpile
   2 of   4 in sage.sandpiles.sandpile.Sandpile.betti
   2 of   9 in sage.sandpiles.sandpile.Sandpile.betti_complexes
   1 of   3 in sage.sandpiles.sandpile.Sandpile.groebner
   3 of   5 in sage.sandpiles.sandpile.Sandpile.ideal
   4 of   7 in sage.sandpiles.sandpile.Sandpile.resolution
   2 of   5 in sage.sandpiles.sandpile.Sandpile.solve
   1 of   4 in sage.sandpiles.sandpile.Sandpile.unsaturated_ideal
   2 of   8 in sage.sandpiles.sandpile.admissible_partitions
   1 of  10 in sage.sandpiles.sandpile.glue_graphs
   2 of   6 in sage.sandpiles.sandpile.partition_sandpile
   1 of   5 in sage.sandpiles.sandpile.sandlib
    [928 tests, 24 failures, 6.47 s]
sage -t --random-seed=244346095003381053621674002219164718019 src/sage/schemes/projective/projective_subscheme.py
**********************************************************************
File "src/sage/schemes/projective/projective_subscheme.py", line 923, in sage.schemes.projective.projective_subscheme.AlgebraicScheme_subscheme_projective.dual
Failed example:
    X.dual()
Expected:
    Closed subscheme of Projective Space of dimension 2 over Rational Field
     defined by:
      y0^2 + y1^2 + y2^2
Got:
    Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
      0
**********************************************************************
File "src/sage/schemes/projective/projective_subscheme.py", line 937, in sage.schemes.projective.projective_subscheme.AlgebraicScheme_subscheme_projective.dual
Failed example:
    X.dual()
Expected:
    Closed subscheme of Projective Space of dimension 3 over
     Rational Field defined by:
      y2^2 - y1*y3,
      y1*y2 - y0*y3,
      y1^2 - y0*y2
Got:
    Closed subscheme of Projective Space of dimension 3 over Rational Field defined by:
      y2^2 - y1*y3
**********************************************************************
File "src/sage/schemes/projective/projective_subscheme.py", line 953, in sage.schemes.projective.projective_subscheme.AlgebraicScheme_subscheme_projective.dual
Warning: Consider using a block-scoped tag by inserting the line 'sage: # needs sage.rings.finite_rings' just before this line to avoid repeating the tag 4 times
    R = PolynomialRing(GF(61), 'a,b,c')                                   # optional - sage.rings.finite_rings
**********************************************************************
File "src/sage/schemes/projective/projective_subscheme.py", line 956, in sage.schemes.projective.projective_subscheme.AlgebraicScheme_subscheme_projective.dual
Failed example:
    X.dual()                                                              # optional - sage.rings.finite_rings
Expected:
    Closed subscheme of Projective Space of dimension 2 over
     Finite Field of size 61 defined by:
      y0^2 - 30*y1^2 - 20*y2^2
Got:
    Closed subscheme of Projective Space of dimension 2 over Finite Field of size 61 defined by:
      0
**********************************************************************
File "src/sage/schemes/projective/projective_subscheme.py", line 963, in sage.schemes.projective.projective_subscheme.AlgebraicScheme_subscheme_projective.dual
Warning: Consider using a block-scoped tag by inserting the line 'sage: # needs sage.rings.padics' just before this line to avoid repeating the tag 4 times
    R = PolynomialRing(Qp(3), 'a,b,c')                                    # optional - sage.rings.padics
**********************************************************************
File "src/sage/schemes/projective/projective_subscheme.py", line 1058, in sage.schemes.projective.projective_subscheme.AlgebraicScheme_subscheme_projective.intersection_multiplicity
Warning: Consider using a block-scoped tag by inserting the line 'sage: # needs sage.rings.finite_rings' just before this line to avoid repeating the tag 7 times
    P.<x,y,z> = ProjectiveSpace(GF(5), 2)                                 # optional - sage.rings.finite_rings
**********************************************************************
File "src/sage/schemes/projective/projective_subscheme.py", line 1148, in sage.schemes.projective.projective_subscheme.AlgebraicScheme_subscheme_projective.multiplicity
Warning: Consider using a block-scoped tag by inserting the line 'sage: # needs sage.rings.finite_rings' just before this line to avoid repeating the tag 4 times
    P.<x,y,z,w> = ProjectiveSpace(GF(29), 3)                              # optional - sage.rings.finite_rings
**********************************************************************
1 item had failures:
   3 of  20 in sage.schemes.projective.projective_subscheme.AlgebraicScheme_subscheme_projective.dual
    [288 tests, 3 failures, 2.13 s]
----------------------------------------------------------------------
sage -t --random-seed=244346095003381053621674002219164718019 src/sage/sandpiles/sandpile.py  # 24 doctests failed
sage -t --random-seed=244346095003381053621674002219164718019 src/sage/schemes/projective/projective_subscheme.py  # 3 doctests failed
----------------------------------------------------------------------

(I'm running 10.1 + #36018 + #36006)

@tornaria
Copy link
Contributor

The 3 failures in src/sage/schemes/projective/projective_subscheme.py get fixed by

--- a/src/sage/schemes/projective/projective_subscheme.py
+++ b/src/sage/schemes/projective/projective_subscheme.py
@@ -1001,7 +1001,7 @@ class AlgebraicScheme_subscheme_projective(AlgebraicScheme_subscheme):
         for i in range(n + 1):
             J = J + S.ideal(z[-1] * f_S.derivative(z[i]) - z[i + n + 1])
 
-        sat = ff.elim__lib.sat
+        sat = ff.elim__lib.sat_with_exp
 
         max_ideal = S.ideal(z[n + 1: 2 * n + 2])
         J_sat_gens = sat(J, max_ideal)[0]

Cf. #35980 (and the proper fix to support older singular is as in that PR, ofc).

The 24 failures in src/sage/sandpiles/sandpile.py remain.

@tornaria
Copy link
Contributor

And this fixes the sandpile:

--- a/src/sage/sandpiles/sandpile.py
+++ b/src/sage/sandpiles/sandpile.py
@@ -2495,7 +2495,7 @@ class Sandpile(DiGraph):
         """
         R = self.ring()
         I = self._unsaturated_ideal._singular_()
-        self._ideal = R.ideal(I.sat(prod(R.gens())._singular_())[1])
+        self._ideal = R.ideal(I.sat_with_exp(prod(R.gens())._singular_())[1])
 
     def unsaturated_ideal(self):
         r"""

@tornaria
Copy link
Contributor

Here's a tentative version of the two fixes above which seems to work ok with both singular 4.3.2p2 (old sat api) and with singular 4.3.2p7 (new sat api). In between versions (p3, p4) are broken.

--- a/src/sage/sandpiles/sandpile.py
+++ b/src/sage/sandpiles/sandpile.py
@@ -2493,9 +2493,15 @@ class Sandpile(DiGraph):
             sage: '_ideal' in S.__dict__
             True
         """
+        from sage.libs.singular.function_factory import ff
+        try:
+            sat = ff.elim__lib.sat_with_exp
+        except NameError:
+            sat = ff.elim__lib.sat
         R = self.ring()
-        I = self._unsaturated_ideal._singular_()
-        self._ideal = R.ideal(I.sat(prod(R.gens())._singular_())[1])
+        I = self._unsaturated_ideal
+        I_sat_gens = sat(I, prod(R.gens()))[0]
+        self._ideal = R.ideal(I_sat_gens)
 
     def unsaturated_ideal(self):
         r"""
diff --git a/src/sage/schemes/projective/projective_subscheme.py b/src/sage/schemes/projective/projective_subscheme.py
index e6caf19ba74..afd6484d779 100644
--- a/src/sage/schemes/projective/projective_subscheme.py
+++ b/src/sage/schemes/projective/projective_subscheme.py
@@ -1001,7 +1001,10 @@ class AlgebraicScheme_subscheme_projective(AlgebraicScheme_subscheme):
         for i in range(n + 1):
             J = J + S.ideal(z[-1] * f_S.derivative(z[i]) - z[i + n + 1])
 
-        sat = ff.elim__lib.sat
+        try:
+            sat = ff.elim__lib.sat_with_exp
+        except NameError:
+            sat = ff.elim__lib.sat
 
         max_ideal = S.ideal(z[n + 1: 2 * n + 2])
         J_sat_gens = sat(J, max_ideal)[0]

@tornaria
Copy link
Contributor

@mkoeppe could you try adding the patch from my last comment and with singular 4.3.2p7?

@mkoeppe mkoeppe changed the title build/pkgs/singular: Upgrade to 4.3.2p4, reject system Singular without FLINT build/pkgs/singular: Upgrade to 4.3.2p7, reject system Singular without FLINT Aug 21, 2023
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 21, 2023

Builds OK on macOS, and sage -tp --long src/sage/schemes src/sage/sandpiles src/sage/rings/function_field only shows the unrelated known failure in src/sage/schemes/curves/zariski_vankampen.py

@github-actions
Copy link

Documentation preview for this PR (built with commit 8f3bc18; changes) is ready! 🎉

@tornaria
Copy link
Contributor

Works for me, I tested the patch as-is now in my void linux package. The two reasons I'm not sure about giving positive review are (a) I wrote part of the fix (b) I'm not testing the actual singular spkg as I only build sagelib.

OTOH, I am using singular 4.3.2p7 from system (built from unpatched upstream), and I also tested this with 4.3.2p2 (also from system) to check the fallback works. Also I think the CI is testing that this works using the singular spkg, so there's that.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 22, 2023

Also I think the CI is testing that this works using the singular spkg

Yes, it built singular from spkg.

More portability tests running at https://github.com/mkoeppe/sage/actions/runs/5934767113 (together with some other upgrades)

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 23, 2023

Builds without problems on all platforms. Let's get this in.

@antonio-rojas
Copy link
Contributor

Works for me

@vbraun vbraun merged commit bfb6b3c into sagemath:develop Sep 1, 2023
11 of 12 checks passed
@mkoeppe mkoeppe added this to the sage-10.2 milestone Sep 1, 2023
Comment on lines +12 to +14
#include <singular/singularconfig.h>
#if !defined(HAVE_FLINT)
# error "Need Singular compiled with FLINT"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any chance that this program compiles?

It seems to be missing #endif and a main(){} although I'm not completely sure on the semantics of AC_LANG_PROGRAM. In any case, this test fails in void linux where singular is built with flint (and /usr/include/singular/singularconfig.h indeed does contain #define HAVE_FLINT 1)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #36212, I think

@mkoeppe mkoeppe deleted the singular_4_3_2_p2 branch September 10, 2023 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants