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

Upgrade Maxima to 5.33.0 #13973

Closed
dimpase opened this issue Jan 19, 2013 · 59 comments
Closed

Upgrade Maxima to 5.33.0 #13973

dimpase opened this issue Jan 19, 2013 · 59 comments

Comments

@dimpase
Copy link
Member

dimpase commented Jan 19, 2013

This is a continuation of #13364, and aims at including more upstream bug fixes, which e.g. fix an
issue reported on sage-support,
which was reported as Maxima bug 2535, and marked there as closed in post-5.29.1.

Fixes #11894, #13526, #13712, #14209, #14306, #15386 and possibly other Maxima-related bugs.

Ought to fix #13733 (but loading the abs_integrate package currently causes this to fail).

Ought to fix #8728 (but Maxima asks for more constraints which follow from the existing ones).

Does not fix #14591, #14677, #15033.

tarball: http://homepages.warwick.ac.uk/staff/P.Bruin/sage/maxima-5.33.0.tar.bz2

Note about the existing maxima_bug_2526.patch: ​the bug was marked "closed" in the Maxima bug tracking system, but the commit somehow disappeared from the Maxima repository and the bug has been reopened. Hence this patch is still needed to fix it.

CC: @SnarkBoojum

Component: packages: standard

Keywords: sd48

Author: Peter Bruin

Branch: a130eed

Reviewer: Marc Mezzarobba

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

@kcrisman
Copy link
Member

Changed dependencies from 13364 to #13364

@kcrisman
Copy link
Member

comment:2

So for instance going at least as far as the fix for #13733 would be good.

@zimmermann6
Copy link

comment:3

while we are at it, it seems strange to me that sage/interfaces/maxima_abstract.py contains a doctest for the maxima version used:

File "/localdisk/tmp/sage-5.5/devel/sage-12615b/sage/interfaces/maxima_abstract.py", line 422:
    sage: maxima.version()
Expected:
    '5.26.0'
Got:
    '5.29.1'

What really matters is the functionality provided, not the actual version?
Does Sage check the actual version of each component?

Paul

@dimpase
Copy link
Member Author

dimpase commented Jan 23, 2013

comment:4

Replying to @zimmermann6:

while we are at it, it seems strange to me that sage/interfaces/maxima_abstract.py contains a doctest for the maxima version used:

File "/localdisk/tmp/sage-5.5/devel/sage-12615b/sage/interfaces/maxima_abstract.py", line 422:
    sage: maxima.version()
Expected:
    '5.26.0'
Got:
    '5.29.1'

seems that https://github.com/sagemath/sage-prod/files/10656171/doctests.2.patch.gz
was not installed into the Sage installation you work with.

What really matters is the functionality provided, not the actual version?
Does Sage check the actual version of each component?

Sage provides versions at least for some other components, e.g. gap.version()

Sometimes it might be useful; AFAIK some optional packages check this.

Dima

Paul

@zimmermann6
Copy link

comment:5

Dima, I don't object about providing a function maxima_version(), but checking it returns a particular value.

Paul

@dimpase
Copy link
Member Author

dimpase commented Jan 23, 2013

comment:6

Replying to @zimmermann6:

Dima, I don't object about providing a function maxima_version(), but checking it returns a particular value.

well, one would like to test Sage functions... How else would you check that it works and returns something meaningful?

Paul

@zimmermann6
Copy link

comment:7

we could for example check that the version is of the form x.y.z, or is greater than or equal to a given number.

Paul

@zimmermann6
Copy link

comment:8

see #14306 (issue fixed in Maxima git)

Paul

@kcrisman
Copy link
Member

kcrisman commented May 8, 2013

comment:9

Also note that Maxima is now at 5.30.0.

@kiwifb
Copy link
Member

kiwifb commented May 8, 2013

comment:10

Yes it is at 5.30.0. No check from sage-on-gentoo on whether it works so far because the maxima ecl library building is currently broken for that particular version - an adsf upgrade problem in gentoo.

I second checking the form of the version returned rather than the value. That would make my life easier when R, maxima are upgraded in s-o-g independently of sage itself (and without side effects at leat in doctests).

@jdemeyer
Copy link

comment:12

I'll try making a new Maxima spkg just to see what happpens...

@jdemeyer
Copy link

Author: Jeroen Demeyer

@jdemeyer

This comment has been minimized.

@jdemeyer jdemeyer modified the milestones: sage-5.10, sage-5.11 Jun 13, 2013
@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link

comment:15

This looks problematic:

sage -t devel/sage/sage/calculus/calculus.py
**********************************************************************
File "devel/sage/sage/calculus/calculus.py", line 145, in sage.calculus.calculus
Failed example:
    e^M
Exception raised:
    Traceback (most recent call last):
      File "/mazur/release/merger/sage-5.10.rc2/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 466, in _run
        self.execute(example, compiled, test.globs)
      File "/mazur/release/merger/sage-5.10.rc2/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 825, in execute
        exec compiled in globs
      File "<doctest sage.calculus.calculus[32]>", line 1, in <module>
        e**M
      File "constants_c.pyx", line 275, in sage.symbolic.constants_c.E.__pow__ (sage/symbolic/constants_c.cpp:2779)
      File "matrix_symbolic_dense.pyx", line 387, in sage.matrix.matrix_symbolic_dense.Matrix_symbolic_dense.exp (sage/matrix/matrix_symbolic_dense.c:3433)
      File "/mazur/release/merger/sage-5.10.rc2/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 199, in __call__
        return cls(self, x, name=name)
      File "/mazur/release/merger/sage-5.10.rc2/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 626, in __init__
        raise TypeError, x
    TypeError: ECL says: Error executing code in Maxima: Unable to find the spectral representation
**********************************************************************

@jdemeyer
Copy link

comment:16

Also

sage -t devel/sage/sage/interfaces/maxima.py  # Time out

due to a timeout of

sage: maxima('limit(x^a,x,0)')

This is fixable, it is because of a slightly different output format of assumptions.

@jdemeyer
Copy link

Changed upstream from Fixed upstream, but not in a stable release. to none

@kcrisman
Copy link
Member

comment:18

That is awesome, thanks for checking this, Jeroen.

@kcrisman
Copy link
Member

comment:19

This is fixable, it is because of a slightly different output format of assumptions.

Jeroen, while it's true that the error is slightly different in format, I don't think this is the problem (or at least not the whole one). The other things are still passing doctests, and we never even get to the

           if i > 0:
                v = self._expect.before

branch, as one can verify by inserting print statements.

This looks problematic:

This is #2400 again, to some extent. Not sure why this doesn't work any more. In Maxima 5.29.1, this is fine.

Maxima 5.29.1 http://maxima.sourceforge.net
using Lisp ECL 12.12.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) m: matrix([%i*%pi]);
(%o1)                             [ %i %pi ]
(%i4) matrixexp(m), keepfloat:true;
(%o4)                                 - 1
(%i5) matrixexp(m),keepfloat:false;
(%o5)                                 - 1

which is good. In 5.30, though, we have

(%i1) m: matrix([%i*%pi]);
(%o1)                             [ %i %pi ]
(%i6) matrixexp(m),keepfloat:true;

Unable to find the spectral representation
 -- an error. To debug this try: debugmode(true);
(%i7) matrixexp(m),keepfloat:false;

Unable to find the spectral representation
 -- an error. To debug this try: debugmode(true);

@kcrisman
Copy link
Member

Changed keywords from none to sd48

@kcrisman
Copy link
Member

comment:21

Note that the spkg changes are not committed.

@kcrisman
Copy link
Member

Changed dependencies from #13364 to none

@kcrisman
Copy link
Member

Upstream: Reported upstream. Developers acknowledge bug.

@kcrisman
Copy link
Member

comment:22

Thanks to Barton Willis for this workaround.

This bug is due to circa January 2013 changes to matrix inversion. A workaround is to set ratmx to true:

Maxima branch_5_30_base_98_g29f9239_dirty http://maxima.sourceforge.net
using Lisp Clozure Common Lisp Version 1.9-r15764  (WindowsX8632)

(%i1) matrixexp(matrix([%i*%pi]));

Unable to find the spectral representation

(%i2) matrixexp(matrix([%i*%pi])), ratmx=true;
(%o2)                                 - 1

I've reported this here. I don't know if doing this ratmx thing universally is good, though:

 if FALSE will cause determinant and matrix addition, subtraction, and multiplication to be performed in the representation of the matrix elements and will cause the result of matrix inversion to be left in general representation. If it is TRUE, the 4 operations mentioned above will be performed in CRE form and the result of matrix inverse will be in CRE form. Note that this may cause the elements to be expanded (depending on the setting of RATFAC) which might not always be desired.

@mezzarobba
Copy link
Member

comment:41
sage -t --long src/sage/interfaces/maxima_lib.py
**********************************************************************
File "src/sage/interfaces/maxima_lib.py", line 702, in sage.interfaces.maxima_lib.MaximaLib.sr_integral
Failed example:
    integrate(cos(x + abs(x)), x)
Expected:
    -1/4*(2*x - sin(2*x))*realpart(sgn(x)) + 1/2*x + 1/4*sin(2*x)
Got:
    -1/4*(2*x - sin(2*x))*real_part(sgn(x)) + 1/2*x + 1/4*sin(2*x)
**********************************************************************

This is with Volker's current develop branch on github (d409685), which includes a few dozens new tickets compared to 6.3.beta1.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 23, 2014

Changed commit from 13d48c2 to a130eed

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 23, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

a130eedTrac 13973: realpart should be real_part

@pjbruin
Copy link
Contributor

pjbruin commented May 23, 2014

comment:43

Thanks, that must be a consequence of #16224.

@kcrisman
Copy link
Member

comment:44

Thanks, that must be a consequence of #16224.

So... did we have an incorrect translation of Maxima's realpart all along? Interesting.

@mezzarobba
Copy link
Member

comment:45

Is there a reason for no longer using z... in the following test?

@@ -9231,7 +9231,7 @@ cdef class Expression(CommutativeRingElement):
             sage: from sage.calculus.calculus import maxima
             sage: sol = maxima(cos(x)==0).to_poly_solve(x)
             sage: sol.sage()
-            [[x == -1/2*pi + 2*pi*z...], [x == 1/2*pi + 2*pi*z...]]
+            [[x == 1/2*pi + pi*z82]]
 
         If a returned unsolved expression has a denominator, but the
         original one did not, this may also be true::

The same comment may apply to z[0-9]+ in

src/sage/interfaces/maxima_lib.py:            [[x == pi*z54]]
src/sage/symbolic/relation.py:        [[x == 1/4*pi + pi*z80, y == -1/4*pi - pi*z80]]

The bugs listed in the description indeed appear to be fixed with the update, except #13733, for which I get:

sage: integral(log(cot(x)-1),x,0,pi/4)
...
RuntimeError: ECL says: Error executing code in Maxima: PSLOG: internal error.

Otherwise looks good to me.

@pjbruin

This comment has been minimized.

@pjbruin
Copy link
Contributor

pjbruin commented May 23, 2014

comment:46

Replying to @mezzarobba:

Is there a reason for no longer using z... in the following test?

Mostly readability (since the tests are also part of the documentation); with the ... it is not clear that it is just a "serial number" and not part of a larger expression that has been left out. Of course it is somewhat random, so it may change once in a while with Maxima upgrades or changes in other doctests in the same file. I personally think displaying a complete answer is worth the trouble of having to change it every now and then, but if you insist I can change all such examples to ....

The bugs listed in the description indeed appear to be fixed with the update, except #13733, for which I get:

sage: integral(log(cot(x)-1),x,0,pi/4)
...
RuntimeError: ECL says: Error executing code in Maxima: PSLOG: internal error.

You're right; I tested this inside Maxima (sage --maxima), but Sage loads additional packages. In this case the failure is caused by loading abs_integrate. Using 5.33.0:

$ sage --maxima
...
(%i1) display2d: false$

(%i2) integrate(log(cot(x)-1),x,0,%pi/4);

(%o2) (%i*li[2]((%i+1)/2)-%i*li[2](-(%i-1)/2))/2
 -(%i*(2*li[2](%i+1)-2*li[2](1-%i))+%pi*log(2))/4
(%i3) load(abs_integrate)$

(%i4) integrate(log(cot(x)-1),x,0,%pi/4);

log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
log: encountered log(0).
PSLOG: internal error.
 -- an error. To debug this try: debugmode(true);

@mezzarobba
Copy link
Member

Reviewer: Marc Mezzarobba

@mezzarobba
Copy link
Member

Changed upstream from Completely fixed; Fix reported upstream to none

@mezzarobba
Copy link
Member

comment:47

Replying to @pjbruin:

Replying to @mezzarobba:

Is there a reason for no longer using z... in the following test?

Mostly readability (since the tests are also part of the documentation); with the ... it is not clear that it is just a "serial number" and not part of a larger expression that has been left out. Of course it is somewhat random, so it may change once in a while with Maxima upgrades or changes in other doctests in the same file. I personally think displaying a complete answer is worth the trouble of having to change it every now and then, but if you insist I can change all such examples to ....

No, that's fine with me, I just wanted to make sure that it was intentional.

@vbraun
Copy link
Member

vbraun commented May 25, 2014

Changed branch from u/pbruin/13973-maxima_update to a130eed

@kcrisman
Copy link
Member

kcrisman commented Jun 4, 2014

comment:49

Note about the patches: maxima_bug_2526.patch, which fixes http://sourceforge.net/p/maxima/bugs/2526/, is still necessary even though the bug is marked "closed" in the Maxima bug tracking system; the commit somehow didn't make it into the Maxima repository.

Okay, this is finally in Maxima, so the next Maxima upgrade will get to remove this patch.

@kcrisman
Copy link
Member

kcrisman commented Jun 4, 2014

Changed commit from a130eed to none

@kcrisman
Copy link
Member

kcrisman commented Jun 4, 2014

comment:50

#14306 needs review.

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

8 participants