Opened 19 months ago

Last modified 8 days ago

#25993 new enhancement

Upgrade Singular

Reported by: jdemeyer Owned by:
Priority: major Milestone: sage-9.1
Component: packages: standard Keywords: upgrade, Singular
Cc: SimonKing, gh-timokau, slelievre, isuruf, saraedum, dkrenn, araichev, cheuberg, behackl Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues: failing doctests in asymptotics_multivariate_generating_functions.py
Branch: u/gh-mwageringel/singular412p4 (Commits) Commit: 9dbc2badedcda7046e37bc5adc2a4768f60318e6
Dependencies: Stopgaps:

Change History (62)

comment:1 Changed 19 months ago by jdemeyer

  • Dependencies set to #24735

comment:2 Changed 19 months ago by jdemeyer

  • Cc SimonKing gh-timokau added
  • Description modified (diff)

comment:3 Changed 19 months ago by jdemeyer

  • Branch set to u/jdemeyer/ticket/25993

comment:4 Changed 19 months ago by jdemeyer

  • Commit set to ec53e6fadfe9cb22a70029f4b9c91576c6c2b1d3
  • Description modified (diff)

Last 10 new commits:

0f55b76More real -> Float porting
aea0544Don't check for exact Singular version
4e52b5eUse p_Divide for lcm as suggested by upstream
50b9ae2Backport patch to move singular's NTL handling out of libsingular
7b56ef2Document patch
930ba2eRemove duplicate cimport
f31d9daMove patch documentation inside patch itself
07ef11brest -> reminder
a9e5aedMinor fixes to Singular interface
ec53e6fUpgrade to Singular 4.1.1p3

comment:5 follow-up: Changed 19 months ago by SimonKing

Sigh. So I have to upgrade the group cohomology package earlier than I thought. I'll see what I can do (after grading some exam).

comment:6 follow-up: Changed 19 months ago by SimonKing

The ticket description prominently tells that the group cohomology package is failing, but the title of the ticket is about upgrading Singular.

So, just to be sure about the topic of this ticket:

  • Is this ticket about upgrading Singular, which means that a new ticket for upgrading the group cohomology package needs to be created? If this is so, which of the tickets should depend on the other?
  • Is this ticket only about upgrading the group cohomology package? Looking at the commits, I suppose that this is not the case.

comment:7 in reply to: ↑ description Changed 19 months ago by SimonKing

Replying to jdemeyer:

It's not clear to me whether this is a Singular bug or a p_group_cohomology bug.

Most likely it is an API change.

comment:8 in reply to: ↑ 6 ; follow-up: Changed 19 months ago by jdemeyer

This ticket is about upgrading Singular. If the p_group_cohomology package must be changed, ideally it should be done in a way which makes it compatible both with Singular 4.1.1p3 as well as earlier versions. In that case, the upgrade of p_group_cohomology can be done on a different ticket and #25993 should depend on that.

Concerning the commit history, only the last commit belongs to this ticket. The rest belongs to #24735 which is an upgrade of Singular to 4.1.1p2.

comment:9 in reply to: ↑ 8 ; follow-up: Changed 19 months ago by SimonKing

Replying to jdemeyer:

Concerning the commit history, only the last commit belongs to this ticket. The rest belongs to #24735 which is an upgrade of Singular to 4.1.1p2.

I see. Do you know if the breakage already happens in p2?

comment:10 follow-up: Changed 19 months ago by SimonKing

PS: I recently added a patch to Singular which backports a bugfix that is important to me. Is that bugfix in Singular-4.1.1?

comment:11 in reply to: ↑ 9 ; follow-up: Changed 19 months ago by jdemeyer

Replying to SimonKing:

I see. Do you know if the breakage already happens in p2?

I know that it does not occur. That's also a good reason to do the upgrade in two steps: first to 4.1.1p2 which works fine and then to 4.1.1p3 (or a later version) once p_group_cohomology is fixed.

comment:12 in reply to: ↑ 11 Changed 19 months ago by SimonKing

Replying to jdemeyer:

Replying to SimonKing:

I see. Do you know if the breakage already happens in p2?

I know that it does not occur. That's also a good reason to do the upgrade in two steps: first to 4.1.1p2 which works fine and then to 4.1.1p3 (or a later version) once p_group_cohomology is fixed.

Thank you! That sounds like a good plan. And do you know about the backported bug fix?

comment:13 in reply to: ↑ 10 ; follow-up: Changed 19 months ago by jdemeyer

Replying to SimonKing:

I recently added a patch to Singular which backports a bugfix that is important to me. Is that bugfix in Singular-4.1.1?

That's hard to say if you don't say which patch you mean. In any case, all patches which are currently (in Sage 8.3.rc3) applied to Singular are included in Singular 4.1.1p2.

Note that you said 4.1.1 but I guess you really care about 4.1.1p2 or 4.1.1p3. Despite what the version numbers suggest, experience shows that Singular adds non-trivial changes in such patch-releases.

comment:14 in reply to: ↑ 13 ; follow-ups: Changed 19 months ago by SimonKing

Replying to jdemeyer:

Replying to SimonKing:

I recently added a patch to Singular which backports a bugfix that is important to me. Is that bugfix in Singular-4.1.1?

That's hard to say if you don't say which patch you mean. In any case, all patches which are currently (in Sage 8.3.rc3) applied to Singular are included in Singular 4.1.1p2.

It is backport_std.patch

Note that you said 4.1.1 but I guess you really care about 4.1.1p2 or 4.1.1p3. Despite what the version numbers suggest, experience shows that Singular adds non-trivial changes in such patch-releases.

I see. I thought that the "p something" patch level is Sage's addition of patches, not Singular's.

comment:15 Changed 19 months ago by jdemeyer

  • Description modified (diff)
  • Report Upstream changed from N/A to Fixed upstream, but not in a stable release.

comment:16 in reply to: ↑ 14 Changed 19 months ago by jdemeyer

Replying to SimonKing:

I see. I thought that the "p something" patch level is Sage's addition of patches, not Singular's.

No, Sage's p levels have a dot. So you can have a Singular package version number like 4.1.1p2.p0 (where 4.1.1p2 comes from Singular upstream and .p0 from Sage). I know, it's confusing :-)

comment:17 Changed 19 months ago by git

  • Commit changed from ec53e6fadfe9cb22a70029f4b9c91576c6c2b1d3 to 83c8ac26d40bfa342d4fe37d43ec9db84e1055ba

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

83c8ac2Upgrade to Singular 4.1.1p3

comment:18 in reply to: ↑ 14 ; follow-up: Changed 19 months ago by jdemeyer

Replying to SimonKing:

It is backport_std.patch

Sorry, I don't know what you mean. Where should I find this patch?

comment:19 in reply to: ↑ 18 Changed 19 months ago by SimonKing

Replying to jdemeyer:

Replying to SimonKing:

It is backport_std.patch

Sorry, I don't know what you mean. Where should I find this patch?

#25889

comment:20 in reply to: ↑ 5 Changed 19 months ago by jdemeyer

Replying to SimonKing:

Sigh. So I have to upgrade the group cohomology package earlier than I thought.

At least this time, it's not the fault of Sage but Singular :-)

comment:21 Changed 19 months ago by SimonKing

  • Dependencies changed from #24735 to #24735 #26001

I created #26001 to deal with the now needed upgrade of the group cohomology package. I suggest that I bae #26001 on top of #24735 (which by now is positively reviewed) and make the new ticket a dependency for the upgrade of Singular to version 4.1.1.p3.

comment:22 Changed 18 months ago by gh-timokau

Is this supposed to pass the non-optional doctests already? I cherry-picket the last two commits (Upgrade to Singular 4.1.1p3 and Minor fixes to Singular interface) and added the patch to singular in an attempt to update nix's Singular to p3. I'm getting a segfault while running the doctests:

File "/nix/store/pzc940fjxrhq17j58krwry2y7wi9czh8-sage-src-8.3/src/sage/rings/polynomial/plural.pyx", line 396, in sage.rings.polynomial.plural.NCPolynomialRing_plural.__dealloc__
Failed example:
    R2 = A2.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2))
Exception raised:
    Traceback (most recent call last):
      File "/nix/store/ic3b215ln47d0js46lyvc7zjizd9jfqp-python-2.7.15-env/lib/python2.7/site-packages/sage/doctest/forker.py", line 573, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/nix/store/ic3b215ln47d0js46lyvc7zjizd9jfqp-python-2.7.15-env/lib/python2.7/site-packages/sage/doctest/forker.py", line 983, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.rings.polynomial.plural.NCPolynomialRing_plural.__dealloc__[6]>", line 1, in <module>
        R2 = A2.g_algebra({y*x:x*y-z, z*x:x*z+Integer(2)*x, z*y:y*z-Integer(2)*y}, order=TermOrder('degrevlex', Integer(2)))
      File "/nix/store/ic3b215ln47d0js46lyvc7zjizd9jfqp-python-2.7.15-env/lib/python2.7/site-packages/sage/algebras/free_algebra.py", line 876, in g_algebra
        order=order, check=check)
      File "sage/structure/factory.pyx", line 368, in sage.structure.factory.UniqueFactory.__call__ (build/cythonized/sage/structure/factory.c:2046)
        return self.get_object(version, key, kwds)
      File "sage/structure/factory.pyx", line 411, in sage.structure.factory.UniqueFactory.get_object (build/cythonized/sage/structure/factory.c:2422)
        obj = self.create_object(version, key, **extra_args)
      File "sage/rings/polynomial/plural.pyx", line 173, in sage.rings.polynomial.plural.G_AlgFactory.create_object (build/cythonized/sage/rings/polynomial/plural.cpp:5046)
        return NCPolynomialRing_plural(base_ring, names, c, d, order,
      File "sage/rings/polynomial/plural.pyx", line 351, in sage.rings.polynomial.plural.NCPolynomialRing_plural.__init__ (build/cythonized/sage/rings/polynomial/plural.cpp:6406)
        test = ff.nctools__lib.ndcond(ring = self)
      File "sage/libs/singular/function.pyx", line 1330, in sage.libs.singular.function.SingularFunction.__call__ (build/cythonized/sage/libs/singular/function.cpp:15332)
        return call_function(self, args, ring, interruptible, attributes)
      File "sage/libs/singular/function.pyx", line 1512, in sage.libs.singular.function.call_function (build/cythonized/sage/libs/singular/function.cpp:17285)
        with opt_ctx: # we are preserving the global options state here
      File "sage/libs/singular/function.pyx", line 1514, in sage.libs.singular.function.call_function (build/cythonized/sage/libs/singular/function.cpp:17197)
        sig_on()
    SignalError: Segmentation fault

comment:23 Changed 18 months ago by arojas

Note that this will also break the build of polymake (not sure if it affects the 3.1 version shipped by Sage)

http://www.singular.uni-kl.de:8002/trac/ticket/838

comment:24 Changed 16 months ago by fbissey

  • Milestone changed from sage-8.4 to sage-8.5

comment:25 follow-up: Changed 14 months ago by arojas

4.1.1p4 is out, with fixes for the gcd in ZZ and the polymake issue. But (of course) with new problems: the stest function has changed signature and now only accepts two parameters [1]. After porting the Sage code I'm getting floating point exceptions

File "/usr/lib/python2.7/site-packages/sage/rings/quotient_ring_element.py", line 629, in sage.rings.quotient_ring_element.QuotientRingElement._richcmp_
Failed example:
    I = F*[x*y+y*z,x^2+x*y-y*x-y^2]*F
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/sage/doctest/forker.py", line 671, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/usr/lib/python2.7/site-packages/sage/doctest/forker.py", line 1086, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.rings.quotient_ring_element.QuotientRingElement._richcmp_[7]>", line 1, in <module>
        I = F*[x*y+y*z,x**Integer(2)+x*y-y*x-y**Integer(2)]*F
      File "sage/structure/element.pyx", line 1517, in sage.structure.element.Element.__mul__ (build/cythonized/sage/structure/element.c:12022)
        return (<Element>left)._mul_(right)
      File "sage/algebras/letterplace/free_algebra_element_letterplace.pyx", line 604, in sage.algebras.letterplace.free_algebra_element_letterplace.FreeAlgebraElement_letterplace._mul_ (build/cythonized/sage/algebras/letterplace/free_algebra_element_letterplace.cpp:9487)
        rshift = singular_system("stest",right._poly,left._poly.degree(), ring=A._current_ring)
      File "sage/libs/singular/function.pyx", line 1330, in sage.libs.singular.function.SingularFunction.__call__ (build/cythonized/sage/libs/singular/function.cpp:15055)
        return call_function(self, args, ring, interruptible, attributes)
      File "sage/libs/singular/function.pyx", line 1512, in sage.libs.singular.function.call_function (build/cythonized/sage/libs/singular/function.cpp:16879)
        with opt_ctx: # we are preserving the global options state here
      File "sage/libs/singular/function.pyx", line 1514, in sage.libs.singular.function.call_function (build/cythonized/sage/libs/singular/function.cpp:16791)
        sig_on()
    FloatingPointError: Floating point exception

[1] https://github.com/Singular/Sources/commit/b00f8a34fb50dbff4746ce45d0680d242f28260c

comment:26 in reply to: ↑ 25 ; follow-up: Changed 14 months ago by jdemeyer

Replying to arojas:

4.1.1p4 is out

Really? I don't see it on ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-1-1/

comment:27 in reply to: ↑ 26 Changed 14 months ago by arojas

Replying to jdemeyer:

Replying to arojas:

4.1.1p4 is out

Really? I don't see it on ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-1-1/

That mirror seems to be outdated

https://service.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/4-1-1/

comment:28 Changed 14 months ago by jdemeyer

  • Dependencies changed from #24735 #26001 to #26001
  • Description modified (diff)
  • Summary changed from Upgrade to Singular 4.1.1p3 to Upgrade to Singular 4.1.1p4

comment:29 follow-up: Changed 14 months ago by SimonKing

Can you test if it is also breaking the new version of p_group_cohomology (see #26001), which is ready for review?

comment:30 in reply to: ↑ 29 Changed 14 months ago by SimonKing

Replying to SimonKing:

Can you test if it is also breaking the new version of p_group_cohomology (see #26001), which is ready for review?

I did test: The upgrade to singular-4.1.1p3 is not problematic with the new version of p_group_cohomology. I cannot tell about p4, of course.

Anyway, some good news for the start of the new year...

comment:31 Changed 13 months ago by jdemeyer

  • Dependencies #26001 deleted
  • Description modified (diff)

comment:32 Changed 13 months ago by jdemeyer

  • Description modified (diff)
  • Report Upstream changed from Fixed upstream, but not in a stable release. to N/A

comment:33 Changed 13 months ago by git

  • Commit changed from 83c8ac26d40bfa342d4fe37d43ec9db84e1055ba to 4bd32fe685b58802a56a8a6cb4e75b9abe02e94b

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

4bd32feUpgrade to Singular 4.1.1p4

comment:34 Changed 13 months ago by jdemeyer

This version compiles, but leads to doctest failures, in particular

sage -t src/sage/rings/quotient_ring.py
**********************************************************************
File "src/sage/rings/quotient_ring.py", line 89, in sage.rings.quotient_ring
Failed example:
    Q3 = F.quo(F*[F.prod(m) for m in product(F.gens(), repeat=3)]*F)
Exception raised:
    Traceback (most recent call last):
      File "/usr/local/src/sage-config/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 671, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/usr/local/src/sage-config/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1086, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.rings.quotient_ring[20]>", line 1, in <module>
        Q3 = F.quo(F*[F.prod(m) for m in product(F.gens(), repeat=Integer(3))]*F)
      File "/usr/local/src/sage-config/local/lib/python2.7/site-packages/sage/categories/monoids.py", line 158, in prod
        return prod(args, self.one())
      File "sage/misc/misc_c.pyx", line 144, in sage.misc.misc_c.prod (build/cythonized/sage/misc/misc_c.c:2570)
        prod = balanced_list_prod(x, 0, n, recursion_cutoff)
      File "sage/misc/misc_c.pyx", line 180, in sage.misc.misc_c.balanced_list_prod (build/cythonized/sage/misc/misc_c.c:2706)
        prod *= <object>PySequence_Fast_GET_ITEM(L, k)
      File "sage/structure/element.pyx", line 1517, in sage.structure.element.Element.__mul__ (build/cythonized/sage/structure/element.c:12023)
        return (<Element>left)._mul_(right)
      File "sage/algebras/letterplace/free_algebra_element_letterplace.pyx", line 604, in sage.algebras.letterplace.free_algebra_element_letterplace.FreeAlgebraElement_letterplace._mul_ (build/cythonized/sage/algebras/letterplace/free_algebra_element_letterplace.cpp:9525)
        rshift = singular_system("stest",right._poly,left._poly.degree(),A._degbound,A.__ngens, ring=A._current_ring)
      File "sage/libs/singular/function.pyx", line 1330, in sage.libs.singular.function.SingularFunction.__call__ (build/cythonized/sage/libs/singular/function.cpp:15057)
        return call_function(self, args, ring, interruptible, attributes)
      File "sage/libs/singular/function.pyx", line 1528, in sage.libs.singular.function.call_function (build/cythonized/sage/libs/singular/function.cpp:17033)
        raise RuntimeError("error in Singular function call %r:\n%s" %
    RuntimeError: error in Singular function call 'system':
    wrong length of parameters(4), expected `poly`,`int`
**********************************************************************

comment:35 Changed 13 months ago by arojas

Yes, see comment:25. The letterplace algebra implementation has been completely rewritten in Singular, in particular "stest" can only be used with rings that are explicitely declared as letterplace. In the long term free_algebra_letterplace.pyx should be refactored to use the new implementation, but a faster short-term solution could be to implement an internal variable shifting method in Sage itself (to replace "stest" usage).

comment:36 Changed 12 months ago by slelievre

  • Cc slelievre added
  • Keywords upgrade Singular added

It seems Singular 4-1-2 is out, see the GitHub "releases" page and one official sources directory at uni-kl:

So far no mention on the Singular home page or download page:

but I guess they will be updated soon.

comment:37 follow-up: Changed 12 months ago by arojas

Relevant changes: system("stest") and system("freegb") are no longer a thing. There is a stest function now, but it's marked static so not accessible from outside the library.

comment:38 in reply to: ↑ 37 ; follow-up: Changed 12 months ago by SimonKing

Replying to arojas:

Relevant changes: system("stest") and system("freegb") are no longer a thing. There is a stest function now, but it's marked static so not accessible from outside the library.

That's quite unfortunate. freegb is needed for free commutative algebras in letterplace implementation. I am not sure if stest is needed there, too.

Any replacement for freegb?

comment:39 in reply to: ↑ 38 ; follow-up: Changed 12 months ago by arojas

Replying to SimonKing:

Replying to arojas:

Relevant changes: system("stest") and system("freegb") are no longer a thing. There is a stest function now, but it's marked static so not accessible from outside the library.

That's quite unfortunate. freegb is needed for free commutative algebras in letterplace implementation. I am not sure if stest is needed there, too.

Any replacement for freegb?

Looks like one can simply use std now https://github.com/Singular/Sources/commit/6a0ad754

Last edited 12 months ago by arojas (previous) (diff)

comment:40 Changed 12 months ago by jdemeyer

  • Description modified (diff)
  • Summary changed from Upgrade to Singular 4.1.1p4 to Upgrade Singular

comment:41 Changed 8 months ago by isuruf

  • Cc isuruf saraedum added

comment:42 in reply to: ↑ 39 Changed 8 weeks ago by gh-mwageringel

Replying to arojas:

Looks like one can simply use std now https://github.com/Singular/Sources/commit/6a0ad754

Indeed, std/twostd can be used for this, but one needs to work over a polynomial ring constructed via `freeAlgebra`, so that certain attributes like the degree bound are set for the computation.

However, I do not see how to make the degrees option work, as Singular's freeAlgebra function does not allow for block orders:

sage: F.<a,b,c> = FreeAlgebra(QQ, implementation='letterplace', degrees=(1,2,3))
sage: F.commutative_ring().term_order()
Block term order with blocks:
(Degree reverse lexicographic term order of length 3,
 Lexicographic term order of length 1)

sage: from sage.libs.singular.function_factory import ff
sage: A = ff.freegb__lib.freeAlgebra(F.commutative_ring(), 5)
...
RuntimeError: error in Singular function call 'freeAlgebra':
only for rings with a global ordering of one block

This is with Singular 4.1.2p1 (freeAlgebra does not exist in the Singular version that is currently in Sage).

The other failing doctests seem mostly harmless.

comment:43 follow-ups: Changed 8 weeks ago by gh-mwageringel

  • Description modified (diff)
  • Milestone changed from sage-8.5 to sage-9.1

With Singular 4.1.2p2, building Pynac fails with errors like this:

In file included from /amd/compute/mwagerin/git/sage_compute/python3/local/include/factory/factory.h:26,
                 from mpoly-singular.cpp:27:
/amd/compute/mwagerin/git/sage_compute/python3/local/include/factory/factoryconf.h:21:10: fatal error: factory/globaldefs.h: No such file or directory
 #include "factory/globaldefs.h"
          ^~~~~~~~~~~~~~~~~~~~~~

I do not know how to resolve this.

comment:44 in reply to: ↑ 43 Changed 8 weeks ago by fbissey

Replying to gh-mwageringel:

With Singular 4.1.2p2, building Pynac fails with errors like this:

In file included from /amd/compute/mwagerin/git/sage_compute/python3/local/include/factory/factory.h:26,
                 from mpoly-singular.cpp:27:
/amd/compute/mwagerin/git/sage_compute/python3/local/include/factory/factoryconf.h:21:10: fatal error: factory/globaldefs.h: No such file or directory
 #include "factory/globaldefs.h"
          ^~~~~~~~~~~~~~~~~~~~~~

I do not know how to resolve this.

Does the file exists? If not it looks like a bug in singular's installation. I'll have a look locally when I can.

comment:45 in reply to: ↑ 43 ; follow-up: Changed 8 weeks ago by arojas

Replying to gh-mwageringel:

With Singular 4.1.2p2, building Pynac fails with errors like this:

In file included from /amd/compute/mwagerin/git/sage_compute/python3/local/include/factory/factory.h:26,
                 from mpoly-singular.cpp:27:
/amd/compute/mwagerin/git/sage_compute/python3/local/include/factory/factoryconf.h:21:10: fatal error: factory/globaldefs.h: No such file or directory
 #include "factory/globaldefs.h"
          ^~~~~~~~~~~~~~~~~~~~~~

I do not know how to resolve this.

This is a bug in singular install: https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/singular#n42

comment:46 follow-up: Changed 8 weeks ago by fbissey

Did you fill a ticket upstream?

comment:47 in reply to: ↑ 46 ; follow-up: Changed 8 weeks ago by arojas

Replying to fbissey:

Did you fill a ticket upstream?

No - i'm tired of filing singular bug reports just to have them ignored.

comment:48 in reply to: ↑ 45 Changed 8 weeks ago by gh-mwageringel

Replying to arojas:

This is a bug in singular install: https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/singular#n42

Thank you. That works.

comment:49 in reply to: ↑ 47 ; follow-up: Changed 8 weeks ago by arojas

Replying to arojas:

Replying to fbissey:

Did you fill a ticket upstream?

No - i'm tired of filing singular bug reports just to have them ignored.

Seems to be fixed in git master

comment:50 in reply to: ↑ 49 ; follow-up: Changed 8 weeks ago by fbissey

Replying to arojas:

Replying to arojas:

Replying to fbissey:

Did you fill a ticket upstream?

No - i'm tired of filing singular bug reports just to have them ignored.

Seems to be fixed in git master

If you are thinking of https://github.com/Singular/Sources/commit/557b878dd8c840afb5ec95de122ba27a0ec99926 it is in my source for 4.1.2p2 and it obviously doesn't help. Are you thinking of another commit?

comment:51 in reply to: ↑ 50 Changed 8 weeks ago by arojas

Replying to fbissey:

Replying to arojas:

Replying to arojas:

Replying to fbissey:

Did you fill a ticket upstream?

No - i'm tired of filing singular bug reports just to have them ignored.

Seems to be fixed in git master

If you are thinking of https://github.com/Singular/Sources/commit/557b878dd8c840afb5ec95de122ba27a0ec99926 it is in my source for 4.1.2p2 and it obviously doesn't help. Are you thinking of another commit?

I don't know which commit fixed it, I just compiled git master and checked that the header is installed.

comment:52 Changed 8 weeks ago by fbissey

All right it is actually fixed in the next commit https://github.com/Singular/Sources/commit/10ccdf4ec3a17fc1e6b47d06f9abf4565ae63341

kind of sad.

comment:53 Changed 8 weeks ago by fbissey

I have checked, that commit is all you need to get this particular header.

comment:54 follow-up: Changed 7 weeks ago by gh-mwageringel

  • Work issues set to update letterplace algebras

Regarding the degrees option of letterplace algebras, Singular should support weighted degree orders naturally now, so Sage's workaround using slack variables should not be necessary anymore. However, I have difficulties to reproduce the old results with Singular's new implementation. The example from letterplace.pyx:

sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace', degrees=[1,2,3])
sage: I = F * [x*y+z-y*x, x*y*z-x^6+y^3] * F
sage: I.groebner_basis(Infinity)
...
sage: F.degbound()
22

The maximum degree was 22, so the following Singular code should compute the same, as far as I understand, but it fails with an error:

LIB "freegb.lib";
ring r = 0,(x,y,z),wp(1,2,3);
def R = freeAlgebra(r, 22);
setring R;
ideal I = x*y+z-y*x, x*y*z-x^6+y^3;
ideal J = twostd(I);
//   ? degree bound of Letterplace ring is 22, but at least 23 is needed for this multiplication

Is this a bug in Singular? I think Singular should make sure not to go beyond the degree bound in this computation.

comment:55 in reply to: ↑ 54 Changed 6 weeks ago by gh-mwageringel

I have posted this problem to the Singular forums.

comment:56 Changed 6 weeks ago by gh-mwageringel

  • Branch changed from u/jdemeyer/ticket/25993 to u/gh-mwageringel/singular412p1
  • Commit changed from 4bd32fe685b58802a56a8a6cb4e75b9abe02e94b to 0c071234ae99343c40735b17280cdf5d0b3a2d6d
  • Work issues changed from update letterplace algebras to segfault in plural.pyx

Viktor Levandovskyy has sent a response to the problem, which was very helpful. The ordering I was trying to use is not actually supported. Also, some of the orderings Sage was using in the letterplace computations were not actually supported and, apparently, were silently ignored by Singular. As a consequence, results obtained with the new Letterplace API (which now supports some of the orders) may be a bit different than before. In the case of non-standard degrees, a deglex ordering seems to give similar results as before.

Here is a tentative branch that makes Sage's letterplace functionality work with Singular 4.1.2p1. I followed Antonio's suggestion from comment:35 and his downstream patch about implementing a variable shifting method, and implemented a workaround to call Singular's twostd with a letterplace polynomial ring constructed via freeAlgebra. Of course, this should only be seen as a short-term solution, to maintain backward compatibility where possible.


There is one remaining problem for upgrading to Singular 4.1.2p1. The tests in src/sage/rings/polynomial/plural.pyx sometimes produce the segmentation fault reported in comment:22, which I do not know how to resolve. For me, the segfault usually occurs during make ptestlong, but not always when testing the file standalone.

Any help with this is appreciated.


New commits:

0ff739025993: upgrade to singular 4.1.2p1
71c871f25993: rename polynomial shift method to _cycle
0c0712325993: call new Singular API for letterplace algebras

comment:57 Changed 12 days ago by arojas

Good news, the plural.pyx segfault seems fixed in 4.1.2.p3. There are a few additional test failures, but they look mostly harmless, caused by doc output changes and different generators for some ideals. There's also a small regression in the pc file https://www.singular.uni-kl.de:8005/trac/ticket/861

comment:58 Changed 11 days ago by fbissey

fails its own testsuite on gentoo for stupid reason

make  check-TESTS
make[4]: Entering directory '/dev/shm/portage/sci-mathematics/singular-4.1.2_p3/work/singular-4.1.2/libpolys/polys'
make[5]: Entering directory '/dev/shm/portage/sci-mathematics/singular-4.1.2_p3/work/singular-4.1.2/libpolys/polys'
../../build-aux/test-driver: line 107: 707661 Segmentation fault      (core dumped) "$@" > $log_file 2>&1
FAIL: test
============================================================================
Testsuite summary for libpolys 4.1.2
============================================================================
# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See polys/test-suite.log

And when I look at the core dump

#0  0x00007f272947b23a in p_Add_q__FieldGeneral_LengthOne_OrdPomog () from /usr/libexec/singular/MOD/p_Procs_FieldGeneral.so
#1  0x00005583ef7743b8 in TestSum(ip_sring*, int) ()
#2  0x00005583ef775c03 in Test(ip_sring*) ()
#3  0x00005583ef77618f in test_Z13_t_GF() ()
#4  0x00005583ef77236f in main ()

the stupid thing tries to load a plugin from a previous install rather than the one it just compiled.

Tests pass on a machine with singular removed but it is annoying.

comment:59 Changed 10 days ago by arojas

4.1.2p4 has just been released with a fix for the pkgconfig issue

comment:60 Changed 9 days ago by fbissey

My test suite issue is now https://github.com/Singular/Sources/issues/980 but if everything else can be worked out we should proceed. I'll add that flint detection is stinky and poorly thought out. It kinds of works but leads to messy warnings in the linker in some systems.

comment:61 Changed 8 days ago by gh-mwageringel

  • Branch changed from u/gh-mwageringel/singular412p1 to u/gh-mwageringel/singular412p4
  • Commit changed from 0c071234ae99343c40735b17280cdf5d0b3a2d6d to 9dbc2badedcda7046e37bc5adc2a4768f60318e6
  • Description modified (diff)
  • Work issues segfault in plural.pyx deleted

I have updated the branch to fix the doctests for Singular 4.1.2p4. The changes are mostly harmless:

  • sign changes in the representatives of fraction field elements
  • rational points are returned in a different order
  • intersection of ideals does not return a Gröbner basis anymore: Neither Sage nor Singular clearly state that the result should be a Gröbner basis, so this change seems fine, but it might be worth checking whether this change was intentional.

New commits:

3af226fMerge tag '9.1.beta4' into #25993
9dbc2ba25993: upgrade to singular 4.1.2p4

comment:62 Changed 8 days ago by gh-mwageringel

  • Cc dkrenn araichev cheuberg behackl added
  • Work issues set to failing doctests in asymptotics_multivariate_generating_functions.py

The only remaining failing doctests are in asymptotics_multivariate_generating_functions.py. It would be nice if the authors or anyone familiar with asymptotics could take a look.

Some of these are caused by different representatives being chosen modulo an ideal, which should be fine. However, the relative error does not get small anymore which suggests that there might be a bug on the Sage side.

File "src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py", line 1576, in sage.rings.asymptotic.asymptotics_multivariate_generating_functions.FractionWithFactoredDenominator.?
Failed example:
    decomp = F.asymptotic_decomposition(alpha); decomp
Expected:
    (0, []) + (-3/2*r*(1/y + 1) - 1/2/y - 1/2, [(x*y + x + y - 1, 1)])
Got:
    (0, []) + (2*r*(1/x + 1) + 1/2/x - 1/2, [(x*y + x + y - 1, 1)])
**********************************************************************
File "src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py", line 1585, in sage.rings.asymptotic.asymptotics_multivariate_generating_functions.FractionWithFactoredDenominator.?
Failed example:
    asy
Expected:
    (1/6000*(3600*sqrt(5)*sqrt(3)*sqrt(2)*sqrt(r)/sqrt(pi)
      + 463*sqrt(5)*sqrt(3)*sqrt(2)/(sqrt(pi)*sqrt(r)))*432^r,
     432,
     3/5*sqrt(5)*sqrt(3)*sqrt(2)*sqrt(r)/sqrt(pi)
      + 463/6000*sqrt(5)*sqrt(3)*sqrt(2)/(sqrt(pi)*sqrt(r)))
Got:
    (-1/6000*(3600*sqrt(5)*sqrt(3)*sqrt(2)*sqrt(r)/sqrt(pi) - 137*sqrt(5)*sqrt(3)*sqrt(2)/(sqrt(pi)*sqrt(r)))*432^r,
     432,
     -3/5*sqrt(5)*sqrt(3)*sqrt(2)*sqrt(r)/sqrt(pi) + 137/6000*sqrt(5)*sqrt(3)*sqrt(2)/(sqrt(pi)*sqrt(r)))
**********************************************************************
File "src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py", line 1591, in sage.rings.asymptotic.asymptotics_multivariate_generating_functions.FractionWithFactoredDenominator.?
Failed example:
    F.relative_error(asy[0], alpha, [1, 2, 4, 8, 16], asy[1])  # abs tol 1e-10
Expected:
    [((4, 3), 2.083333333, [2.092576110], [-0.004436533009]),
     ((8, 6), 2.787374614, [2.790732875], [-0.001204811281]),
     ((16, 12), 3.826259447, [3.827462310], [-0.0003143703383]),
     ((32, 24), 5.328112821, [5.328540787], [-0.00008032230388]),
     ((64, 48), 7.475927885, [7.476079664], [-0.00002030232879])]
Got:
    [((4, 3), 2.083333333, [-1.783556749], [1.856107239]),
     ((8, 6), 2.787374614, [-2.572223188], [1.922812160]),
     ((16, 12), 3.826259447, [-3.672952629], [1.959932979]),
     ((32, 24), 5.328112821, [-5.219285944], [1.979574968]),
     ((64, 48), 7.475927885, [-7.398824824], [1.989686489])]
Tolerance exceeded in 10 of 25:
    2.092576110 vs -1.783556749, tolerance 4e0 > 1e-10
    -0.004436533009 vs 1.856107239, tolerance 2e0 > 1e-10
    2.790732875 vs -2.572223188, tolerance 6e0 > 1e-10
    -0.001204811281 vs 1.922812160, tolerance 2e0 > 1e-10
    3.827462310 vs -3.672952629, tolerance 8e0 > 1e-10
    -0.0003143703383 vs 1.959932979, tolerance 2e0 > 1e-10
    5.328540787 vs -5.219285944, tolerance 2e1 > 1e-10
    -0.00008032230388 vs 1.979574968, tolerance 2e0 > 1e-10
    7.476079664 vs -7.398824824, tolerance 2e1 > 1e-10
    -0.00002030232879 vs 1.989686489, tolerance 2e0 > 1e-10
**********************************************************************
File "src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py", line 1609, in sage.rings.asymptotic.asymptotics_multivariate_generating_functions.FractionWithFactoredDenominator.?
Failed example:
    decomp = F.asymptotic_decomposition(alpha); decomp
Expected:
    (0, []) +
    (-16*r*(3/y - 4/z) - 16/y + 32/z,
     [(x + 2*y + z - 4, 1), (2*x + y + z - 4, 1)])
Got:
    (0, []) + (-16*r*(3/x - 2/z) - 16/x + 16/z, [(x + 2*y + z - 4, 1), (2*x + y + z - 4, 1)])
**********************************************************************
File "src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py", line 1620, in sage.rings.asymptotic.asymptotics_multivariate_generating_functions.FractionWithFactoredDenominator.?
Failed example:
    asy # long time
Expected:
    (4/3*sqrt(3)*sqrt(r)/sqrt(pi) + 47/216*sqrt(3)/(sqrt(pi)*sqrt(r)),
     1, 4/3*sqrt(3)*sqrt(r)/sqrt(pi) + 47/216*sqrt(3)/(sqrt(pi)*sqrt(r)))
Got:
    (-4/3*sqrt(3)*sqrt(r)/sqrt(pi) - 47/216*sqrt(3)/(sqrt(pi)*sqrt(r)),
     1,
     -4/3*sqrt(3)*sqrt(r)/sqrt(pi) - 47/216*sqrt(3)/(sqrt(pi)*sqrt(r)))
**********************************************************************
File "src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py", line 1623, in sage.rings.asymptotic.asymptotics_multivariate_generating_functions.FractionWithFactoredDenominator.?
Failed example:
    F.relative_error(asy[0], alpha, [1, 2, 4, 8], asy[1]) # long time
Expected:
    [((3, 3, 2), 0.9812164307, [1.515572606], [-0.54458543...]),
     ((6, 6, 4), 1.576181132, [1.992989399], [-0.26444185...]),
     ((12, 12, 8), 2.485286378, [2.712196351], [-0.091301338...]),
     ((24, 24, 16), 3.700576827, [3.760447895], [-0.016178847...])]
Got:
    [((3, 3, 2), 0.9812164307, [-1.515572606], [2.544585434]),
     ((6, 6, 4), 1.576181132, [-1.992989399], [2.264441858]),
     ((12, 12, 8), 2.485286378, [-2.712196351], [2.091301338]),
     ((24, 24, 16), 3.700576827, [-3.760447895], [2.016178847])]
**********************************************************************
Note: See TracTickets for help on using tickets.