Opened 5 years ago

Last modified 4 months ago

#23712 new enhancement

Upgrade to Tachyon 0.99.2

Reported by: dimpase Owned by:
Priority: major Milestone: sage-9.7
Component: packages: standard Keywords: upgrade, tachyon
Cc: slelievre, mjo, fbissey, arojas, tscrim Merged in:
Authors: Dima Pasechnik Reviewers:
Report Upstream: N/A Work issues:
Branch: public/23712 (Commits, GitHub, GitLab) Commit: 6209e8e5903286a51f8bdbfd7fffc829a4e1d617
Dependencies: Stopgaps:

Status badges

Change History (26)

comment:1 Changed 5 years ago by chapoton

  • Branch set to public/23712
  • Commit set to 8138ccf1ee71785c44efe9df9e87eab7210425d9

None of our 4 patches does apply. I do not know if they should be removed or rebased.


New commits:

8138ccfnew tachyon 99b6

comment:2 follow-up: Changed 5 years ago by dimpase

there are quite a few doctests failing with this branch. Presumably the interface might have changed a bit.

comment:3 in reply to: ↑ 2 Changed 5 years ago by fbissey

Replying to dimpase:

there are quite a few doctests failing with this branch. Presumably the interface might have changed a bit.

That's what I remember. Are all the failing doctests in doc? I realised yesterday that I have lost the ability to test those in sage-on-gentoo recently (for some reason .rst files get installed as .rst.txt and then they are not tested). So I miss all broken doctests from rst files at the moment.

For the record I don't seem to have any (repeatable) failures on the stuff I doctest in sage-on-gentoo.

comment:4 Changed 5 years ago by dimpase

This is what I get with ptestlong:

sage -t --long --warn-long 45.7 src/sage/plot/plot3d/parametric_plot3d.py  # 1 doctest failed
sage -t --long --warn-long 45.7 src/sage/plot/plot3d/implicit_plot3d.py  # 6 doctests failed
sage -t --long --warn-long 45.7 src/sage/plot/plot3d/platonic.py  # 1 doctest failed
sage -t --long --warn-long 45.7 src/sage/graphs/generic_graph.py  # 9 doctests failed
sage -t --long --warn-long 45.7 src/sage/plot/plot3d/parametric_surface.pyx  # 3 doctests failed
sage -t --long --warn-long 45.7 src/sage/plot/plot3d/implicit_surface.pyx  # 1 doctest failed
sage -t --long --warn-long 45.7 src/sage/plot/plot3d/tachyon.py  # 21 doctests failed
sage -t --long --warn-long 45.7 src/sage/combinat/tiling.py  # 1 doctest failed
sage -t --long --warn-long 45.7 src/sage/numerical/sdp.pyx  # 9 doctests failed
sage -t --long --warn-long 45.7 src/sage/numerical/backends/cvxopt_sdp_backend.pyx  # 7 doctests failed
sage -t --long --warn-long 45.7 src/sage/geometry/polyhedron/backend_normaliz.py  # 2 doctests failed
sage -t --long --warn-long 45.7 src/sage/plot/plot3d/index_face_set.pyx  # 1 doctest failed
sage -t --long --warn-long 45.7 src/sage/plot/plot3d/base.pyx  # 1 doctest failed

Typically it's something about PNG interface:

Using --optional=ccache,cmake,database_gap,gap_packages,mpir,normaliz,pynormaliz,python2,qhull,sage
Doctesting entire Sage library.
Sorting sources by runtime so that slower doctests are run first....
Doctesting 3578 files using 4 threads.
sage -t --long --warn-long 45.7 src/sage/plot/plot3d/parametric_plot3d.py
**********************************************************************
File "src/sage/plot/plot3d/parametric_plot3d.py", line 172, in sage.plot.plot3d.parametric_plot3d.?
Failed example:
    P.show(viewer='tachyon')
Exception raised:
    Traceback (most recent call last):
      File "/home/dima/Sage/sage-dev/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 515, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/dima/Sage/sage-dev/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 885, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.plot.plot3d.parametric_plot3d.?[13]>", line 1, in <module>
        P.show(viewer='tachyon')
      File "sage/plot/plot3d/base.pyx", line 1478, in sage.plot.plot3d.base.Graphics3d.show (build/cythonized/sage/plot/plot3d/base.c
:21367)
        dm.display_immediately(self, **kwds)
      File "/home/dima/Sage/sage-dev/local/lib/python2.7/site-packages/sage/repl/rich_output/display_manager.py", line 834, in displa
y_immediately
        self._backend.display_immediately(plain_text, rich_output)
      File "/home/dima/Sage/sage-dev/local/lib/python2.7/site-packages/sage/repl/rich_output/backend_doctest.py", line 209, in displa
y_immediately
        self.validate(rich_output)
      File "/home/dima/Sage/sage-dev/local/lib/python2.7/site-packages/sage/repl/rich_output/backend_doctest.py", line 270, in valida
te
        assert rich_output.png.get().startswith('\x89PNG')
    AssertionError

Running the corresponding lines at the Sage prompt works and shows a meaningful plot. However, it's not stored in a PNG file, it's stored in TGA file:

$ file tmp_ZccmzF.png 
tmp_ZccmzF.png: Targa image data - RGB 500 x 500 x 24 - top Targa image data - RGB 500 x 500 x 24 - top

comment:5 Changed 5 years ago by dimpase

In fact, ldd says that tachyon is not linked to libpng - no wonder it cannot do PNG.

comment:6 Changed 5 years ago by dimpase

I see that Debian has a set of patches to this version, including autotoolisation! https://packages.debian.org/source/sid/tachyon

Should we use them, rather than keep wrestling with patches to Makefiles?

comment:7 Changed 5 years ago by fbissey

Probably. The linking problem would also explain why I don't see those failures in s-o-g.

comment:8 follow-up: Changed 5 years ago by fbissey

That's a lot of patches https://anonscm.debian.org/cgit/debian-science/packages/tachyon.git/tree/debian/patches but most of them will probably be handy. Are you up to write a spkg-src?

comment:9 in reply to: ↑ 8 Changed 5 years ago by dimpase

Replying to fbissey:

That's a lot of patches https://anonscm.debian.org/cgit/debian-science/packages/tachyon.git/tree/debian/patches but most of them will probably be handy. Are you up to write a spkg-src?

I have a problem with them at the moment: namely, applying these patches and invoking autoreconf -i -f leads to

src/Makefile.am:33: error: HAVE_LD_VERSION_SCRIPT does not appear in AM_CONDITIONAL

Note that src/Makefile.am has the following lines around line 33:

libtachyon_la_LD_VERSION_SCRIPT=
if HAVE_LD_VERSION_SCRIPT
libtachyon_la_LD_VERSION_SCRIPT+= -Wl,--version-script=$(top_srcdir)/src/tachyon.map
endif

This can be remedied by adding to configure.ac the following:

AM_CONDITIONAL([HAVE_LD_VERSION_SCRIPT],   [blah...])

but I don't quite see what blah... should be. (I put in some random shell call just to see if it helps, and it does, but that's of course not a proper fix).

So this looks like a bug in Debian patches (namely in upstream-rationalization-autotools.patch), which only manifests itself in non-Debian setting.

comment:10 Changed 5 years ago by dimpase

And I also don't get how to configure and run make to create a tachyon executable. All what make install does, it installs headers and various dynamic libs, such as libtachyon-mt-thr.so.0.0.0.

comment:11 Changed 4 years ago by slelievre

  • Cc slelievre added
  • Description modified (diff)
  • Keywords upgrade tachyon added
  • Milestone changed from sage-8.1 to sage-8.7
  • Summary changed from update tachyon to 0.99 to Upgrade to Tachyon 0.99b6

comment:12 Changed 3 years ago by embray

  • Milestone changed from sage-8.7 to sage-8.8

Ticket retargeted after milestone closed (if you don't believe this ticket is appropriate for the Sage 8.8 release please retarget manually)

comment:13 Changed 3 years ago by embray

  • Milestone sage-8.8 deleted

As the Sage-8.8 release milestone is pending, we should delete the sage-8.8 milestone for tickets that are not actively being worked on or that still require significant work to move forward. If you feel that this ticket should be included in the next Sage release at the soonest please set its milestone to the next release milestone (sage-8.9).

comment:14 Changed 3 years ago by gh-timokau

For what it's worth I'm just fixing up aarch64 sage on nixos and I get no doctest failures with tachyon 0.99b2 (the version we ship).

There are some transient timeout failures, but that's it. Probably not related to tachyon.

comment:15 Changed 7 months ago by mjo

  • Cc mjo added

There's officially a new release, v0.99.2:

http://jedi.ks.uiuc.edu/~johns/raytracer/

comment:16 Changed 5 months ago by mkoeppe

  • Cc fbissey arojas added
  • Description modified (diff)
  • Summary changed from Upgrade to Tachyon 0.99b6 to Upgrade to Tachyon 0.99.2

comment:17 Changed 5 months ago by git

  • Commit changed from 8138ccf1ee71785c44efe9df9e87eab7210425d9 to 407cb6218170d791a75070e64515db06322feea4

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

2ba28c7new tachyon 99b6
407cb62build/pkgs/tachyon: Update to 0.99.2, add upstream_url

comment:18 Changed 5 months ago by mkoeppe

  • Description modified (diff)

comment:19 Changed 5 months ago by mkoeppe

Patches need updating or removing

comment:20 Changed 5 months ago by tscrim

  • Cc tscrim added
  • Milestone set to sage-9.6

comment:21 Changed 5 months ago by git

  • Commit changed from 407cb6218170d791a75070e64515db06322feea4 to 6209e8e5903286a51f8bdbfd7fffc829a4e1d617

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

6209e8eremove most patches, adjust some

comment:22 Changed 5 months ago by dimpase

Now it builds (at least on Linux). For tests, there was an option renaming focallength->FOCALDIST. The following patch makes all tests pass:

  • src/sage/interfaces/tachyon.py

    a b written in the sequence they are listed in the examples in this section. 
    261261  The {\bf PROJECTION} keyword must be followed by one of the supported
    262262camera projection mode identifiers {\bf PERSPECTIVE}, {\bf PERSPECTIVE_DOF},
    263263{\bf ORTHOGRAPHIC}, or {\bf FISHEYE}.  The {\bf FISHEYE} projection mode
    264 requires two extra parameters {\bf FOCALLENGTH} and {\bf APERTURE}
     264requires two extra parameters {\bf FOCALDIST} and {\bf APERTURE}
    265265which precede the regular camera options.
    266266
    267267\begin{verbatim}
    268268Camera
    269269  projection perspective_dof
    270   focallength 0.75
     270  FOCALDIST 0.75
    271271  aperture 0.02
    272272  Zoom 0.666667
    273273  Aspectratio 1.000000
  • src/sage/plot/plot3d/tachyon.py

    diff --git a/src/sage/plot/plot3d/tachyon.py b/src/sage/plot/plot3d/tachyon.py
    index 08caf38d67..41b646a80f 100644
    a b angle, right angle):: 
    9292Finally there is the ``projection='perspective_dof'`` option. ::
    9393
    9494    sage: T = Tachyon(xres=800, antialiasing=4, raydepth=10,
    95     ....: projection='perspective_dof', focallength='1.0', aperture='.0025')
     95    ....: projection='perspective_dof', FOCALDIST='1.0', aperture='.0025')
    9696    sage: T.light((0,5,7), 1.0, (1,1,1))
    9797    sage: T.texture('t1', opacity=1, specular=.3)
    9898    sage: T.texture('t2', opacity=1, specular=.3, color=(0,0,1))
    class Tachyon(WithEqualityById, SageObject): 
    186186      or ``'fisheye'``.
    187187    - ``frustum`` - (default ''), otherwise list of four numbers. Only
    188188      used with projection='fisheye'.
    189     - ``focallength`` - (default ''), otherwise a number. Only used
     189    - ``FOCALDIST`` - (default ''), otherwise a number. Only used
    190190      with projection='perspective_dof'.
    191191    - ``aperture`` - (default ''), otherwise a number.  Only used
    192192      with projection='perspective_dof'.
    class Tachyon(WithEqualityById, SageObject): 
    331331    Use of the ``projection='perspective_dof'`` option.  This may not be
    332332    implemented correctly. ::
    333333
    334         sage: T = Tachyon(xres=800,antialiasing=4, raydepth=10, projection='perspective_dof', focallength='1.0', aperture='.0025')
     334        sage: T = Tachyon(xres=800,antialiasing=4, raydepth=10, projection='perspective_dof', FOCALDIST='1.0', aperture='.0025')
    335335        sage: T.light((0,5,7), 1.0, (1,1,1))
    336336        sage: T.texture('t1', opacity=1, specular=.3)
    337337        sage: T.texture('t2', opacity=1, specular=.3, color=(0,0,1))
    class Tachyon(WithEqualityById, SageObject): 
    365365                 look_at=[0, 0, 0],
    366366                 viewdir=None,
    367367                 projection='PERSPECTIVE',
    368                  focallength='',
     368                 FOCALDIST='',
    369369                 aperture='',
    370370                 frustum=''):
    371371        r"""
    class Tachyon(WithEqualityById, SageObject): 
    391391            self._camera_position = (-3, 0, 0) # default value
    392392        self._updir = updir
    393393        self._projection = projection
    394         self._focallength = focallength
     394        self._FOCALDIST = FOCALDIST
    395395        self._aperture = aperture
    396396        self._frustum = frustum
    397397        self._objects = []
    class Tachyon(WithEqualityById, SageObject): 
    624624        camera_out = r"""
    625625           camera
    626626              projection %s""" % (tostr(self._projection))
    627         if self._focallength != '':
     627        if self._FOCALDIST != '':
    628628            camera_out = camera_out + r"""
    629               focallength %s""" % (float(self._focallength))
     629              FOCALDIST %s""" % (float(self._FOCALDIST))
    630630        if self._aperture != '':
    631631            camera_out = camera_out + r"""
    632632              aperture %s""" % (float(self._aperture))

Not sure how to best handle this and older versions of tachyon at the same time.

comment:23 Changed 5 months ago by dimpase

Probably the latter could be accomplished by using a decorator.

comment:24 Changed 4 months ago by mkoeppe

  • Milestone changed from sage-9.6 to sage-9.7

comment:25 Changed 4 months ago by mkoeppe

opensuse-tumbleweed now has a new tachyon, causes failures https://github.com/sagemath/sage/runs/6236170449

comment:26 Changed 4 months ago by mkoeppe

and 0.99.5 is out

Note: See TracTickets for help on using tickets.