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

[fixed, awaits confirmation] plot3d/transform.pyx test failure #1827

Closed
garyfurnish mannequin opened this issue Jan 18, 2008 · 5 comments
Closed

[fixed, awaits confirmation] plot3d/transform.pyx test failure #1827

garyfurnish mannequin opened this issue Jan 18, 2008 · 5 comments

Comments

@garyfurnish
Copy link
Mannequin

garyfurnish mannequin commented Jan 18, 2008

Failure on make check

sage -t  devel/sage-main/sage/plot/plot3d/transform.pyx     �[?1034h**********************************************************************
File "transform.pyx", line 213:
    sage: m
Expected:
    [                                                                                                                                        (x^2*z^2 - (cos(theta)*x^2 - cos(theta))*z^2)/z^2                                                                                                          (-sqrt(-z^2 - x^2 + 1)*(cos(theta)*x*abs(z) - x*abs(z)) - sin(theta)*z^2)/abs(z)                                                                                                (-cos(theta)*x*z^2*abs(z) + x*z^2*abs(z) + sin(theta)*z^2*sqrt(-z^2 - x^2 + 1))/(z*abs(z))]
    [                                                                                                            (sin(theta)*z^2*abs(z) - sqrt(-z^2 - x^2 + 1)*(cos(theta)*x*z^2 - x*z^2))/z^2                                              ((-(x^2 + cos(theta) - 1)*z^2 - x^4 + 2*x^2 - 1)*abs(z) - (-cos(theta)*x^2*z^2 - cos(theta)*x^4 + cos(theta)*x^2)*abs(z))/((x^2 - 1)*abs(z)) (-sqrt(-z^2 - x^2 + 1)*(cos(theta)*x^2*z^2*abs(z) + (-x^2 - cos(theta) + 1)*z^2*abs(z)) + sin(theta)*x*z^4 - z^2*(sin(theta)*x*z^2 + sin(theta)*x^3 - sin(theta)*x))/((x^2 - 1)*z*abs(z))]
    [                                                                                                               (-sin(theta)*z*sqrt(-z^2 - x^2 + 1)*abs(z) - cos(theta)*x*z^3 + x*z^3)/z^2                                               (-sqrt(-z^2 - x^2 + 1)*(cos(theta)*x^2*z*abs(z) + (-x^2 - cos(theta) + 1)*z*abs(z)) - (sin(theta)*x - sin(theta)*x^3)*z)/((x^2 - 1)*abs(z))                                                                        (((x^2 + cos(theta) - 1)*z^2 + cos(theta)*x^2 - cos(theta))*abs(z) - cos(theta)*x^2*z^2*abs(z))/((x^2 - 1)*abs(z))]
Got:
    [                                                                                                                                                                                                              sage17*cos(theta)*sqrt(1 - x^2) + sage13*sage76                                                                                                                                                                               (sqrt(-z^2 - x^2 + 1)*(sage76*abs(z) - cos(theta)*x*z) - sin(theta)*z*abs(z))/z                                                                                                                                                                               (sin(theta)*sqrt(-z^2 - x^2 + 1)*abs(z) + sage76*z*abs(z) - cos(theta)*x*z^2)/z]
    [                                                                                                                 (sqrt(1 - x^2)*sqrt(-z^2 - x^2 + 1)*(sage17*cos(theta)*x*abs(z) + sage13*sage80*z) - sage17*sin(theta)*sqrt(1 - x^2)*z^2)/((x^2 - 1)*abs(z))                                          (-sqrt(1 - x^2)*((-cos(theta)*x^2*z^2 - cos(theta)*x^4 + cos(theta)*x^2)*abs(z) + cos(theta)*z^2*abs(z)) - ((sage80 - sage80*x^2)*z^2 - sage80*x^4 + 2*sage80*x^2 - sage80)*abs(z))/(sqrt(1 - x^2)*(x^2 - 1)*abs(z)) (-sqrt(-z^2 - x^2 + 1)*(sqrt(1 - x^2)*(cos(theta)*x^2*z^2*abs(z) - cos(theta)*z^2*abs(z)) + (sage80*x^2 - sage80)*z^2*abs(z)) - sqrt(1 - x^2)*(z^2*(sin(theta)*x*z^2 + sin(theta)*x^3 - sin(theta)*x) - sin(theta)*x*z^4))/(sqrt(1 - x^2)*(x^2 - 1)*z*abs(z))]
    [                                                                                                               (sqrt(1 - x^2)*(sage17*cos(theta)*x*z*abs(z) + sage13*sage80*z^2) + sage17*sin(theta)*sqrt(1 - x^2)*z*sqrt(-z^2 - x^2 + 1))/((x^2 - 1)*abs(z))                                                   (-sqrt(-z^2 - x^2 + 1)*(sqrt(1 - x^2)*(cos(theta)*x^2*z*abs(z) - cos(theta)*z*abs(z)) + (sage80*x^2 - sage80)*z*abs(z)) - sqrt(1 - x^2)*(sin(theta)*x - sin(theta)*x^3)*z)/(sqrt(1 - x^2)*(x^2 - 1)*abs(z))                                                                                       (sqrt(1 - x^2)*((cos(theta)*z^2 + cos(theta)*x^2 - cos(theta))*abs(z) - cos(theta)*x^2*z^2*abs(z)) + (sage80 - sage80*x^2)*z^2*abs(z))/(sqrt(1 - x^2)*(x^2 - 1)*abs(z))]
**********************************************************************

System is 64 bit gentoo, gcc 4.2.2

Component: doctest coverage

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

@garyfurnish garyfurnish mannequin added this to the sage-2.10.1 milestone Jan 18, 2008
@garyfurnish garyfurnish mannequin added c: graphics labels Jan 18, 2008
@sagetrac-mabshoff

This comment has been minimized.

@sagetrac-mabshoff sagetrac-mabshoff mannequin added t: tests and removed c: graphics labels Jan 18, 2008
@sagetrac-mabshoff sagetrac-mabshoff mannequin modified the milestones: sage-2.10.1, sage-2.10 Jan 18, 2008
@williamstein
Copy link
Contributor

Attachment: trac-1827.patch.gz

this should completely fix the problem. But I've only tested it on one 32-bit linux system. it needs more testing

@sagetrac-mabshoff sagetrac-mabshoff mannequin changed the title plot3d/transform.pyx test failure [fixed, awaits confirmation] plot3d/transform.pyx test failure Jan 19, 2008
@robertwb
Copy link
Contributor

comment:3

For _an_element_impl, it should return a very generic element. If it returns zero, then it may mess up the coercion model!

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Jan 19, 2008

comment:4

Hi Robert,

can you provide a doctest that exposes the issue you describe?

Cheers,

Michael

@robertwb
Copy link
Contributor

comment:6

OK, I take this back.

It used to be that some multiplication code was written as

def _lmul_(self, other):
    if not other:
        return other
    ...

This would succeed when other was ANY type with bool(other) == False, and an_element was used to construct other to pass in and try it out (in the action detection code) which would cause it to succeed and this "valid" action would get cached (resulting in a error or segfault when a non-zero other was passed.

It now forces other to be an element of self.parent().base_ring(), which solves this problem.

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

2 participants