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:  sage9.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: 
Description (last modified by )
We currently are shipping a 12 years old tachyon (0.98.9).
0.99.2 was released Dec 2021. http://jedi.ks.uiuc.edu/~johns/raytracer/files/
This is also needed to make Sage work on arm64/aarch64, see #23687.
Many distributions are still on 0.99.beta6  https://repology.org/project/tachyon/versions
In Debian:
Change History (26)
comment:1 Changed 5 years ago by
 Branch set to public/23712
 Commit set to 8138ccf1ee71785c44efe9df9e87eab7210425d9
comment:2 followup: ↓ 3 Changed 5 years ago by
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
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 sageongentoo 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 sageongentoo.
comment:4 Changed 5 years ago by
This is what I get with ptestlong:
sage t long warnlong 45.7 src/sage/plot/plot3d/parametric_plot3d.py # 1 doctest failed sage t long warnlong 45.7 src/sage/plot/plot3d/implicit_plot3d.py # 6 doctests failed sage t long warnlong 45.7 src/sage/plot/plot3d/platonic.py # 1 doctest failed sage t long warnlong 45.7 src/sage/graphs/generic_graph.py # 9 doctests failed sage t long warnlong 45.7 src/sage/plot/plot3d/parametric_surface.pyx # 3 doctests failed sage t long warnlong 45.7 src/sage/plot/plot3d/implicit_surface.pyx # 1 doctest failed sage t long warnlong 45.7 src/sage/plot/plot3d/tachyon.py # 21 doctests failed sage t long warnlong 45.7 src/sage/combinat/tiling.py # 1 doctest failed sage t long warnlong 45.7 src/sage/numerical/sdp.pyx # 9 doctests failed sage t long warnlong 45.7 src/sage/numerical/backends/cvxopt_sdp_backend.pyx # 7 doctests failed sage t long warnlong 45.7 src/sage/geometry/polyhedron/backend_normaliz.py # 2 doctests failed sage t long warnlong 45.7 src/sage/plot/plot3d/index_face_set.pyx # 1 doctest failed sage t long warnlong 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 warnlong 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/sagedev/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 515, in _run self.compile_and_execute(example, compiler, test.globs) File "/home/dima/Sage/sagedev/local/lib/python2.7/sitepackages/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/sagedev/local/lib/python2.7/sitepackages/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/sagedev/local/lib/python2.7/sitepackages/sage/repl/rich_output/backend_doctest.py", line 209, in displa y_immediately self.validate(rich_output) File "/home/dima/Sage/sagedev/local/lib/python2.7/sitepackages/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
In fact, ldd says that tachyon is not linked to libpng  no wonder it cannot do PNG.
comment:6 Changed 5 years ago by
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
Probably. The linking problem would also explain why I don't see those failures in sog.
comment:8 followup: ↓ 9 Changed 5 years ago by
That's a lot of patches https://anonscm.debian.org/cgit/debianscience/packages/tachyon.git/tree/debian/patches but most of them will probably be handy. Are you up to write a spkgsrc
?
comment:9 in reply to: ↑ 8 Changed 5 years ago by
Replying to fbissey:
That's a lot of patches https://anonscm.debian.org/cgit/debianscience/packages/tachyon.git/tree/debian/patches but most of them will probably be handy. Are you up to write a
spkgsrc
?
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,versionscript=$(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 upstreamrationalizationautotools.patch
), which only manifests itself in nonDebian setting.
comment:10 Changed 5 years ago by
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 libtachyonmtthr.so.0.0.0
.
comment:11 Changed 4 years ago by
 Cc slelievre added
 Description modified (diff)
 Keywords upgrade tachyon added
 Milestone changed from sage8.1 to sage8.7
 Summary changed from update tachyon to 0.99 to Upgrade to Tachyon 0.99b6
comment:12 Changed 3 years ago by
 Milestone changed from sage8.7 to sage8.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
 Milestone sage8.8 deleted
As the Sage8.8 release milestone is pending, we should delete the sage8.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 (sage8.9).
comment:14 Changed 3 years ago by
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:16 Changed 5 months ago by
 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
 Commit changed from 8138ccf1ee71785c44efe9df9e87eab7210425d9 to 407cb6218170d791a75070e64515db06322feea4
comment:18 Changed 5 months ago by
 Description modified (diff)
comment:19 Changed 5 months ago by
Patches need updating or removing
comment:20 Changed 5 months ago by
 Cc tscrim added
 Milestone set to sage9.6
comment:21 Changed 5 months ago by
 Commit changed from 407cb6218170d791a75070e64515db06322feea4 to 6209e8e5903286a51f8bdbfd7fffc829a4e1d617
Branch pushed to git repo; I updated commit sha1. New commits:
6209e8e  remove most patches, adjust some

comment:22 Changed 5 months ago by
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. 261 261 The {\bf PROJECTION} keyword must be followed by one of the supported 262 262 camera projection mode identifiers {\bf PERSPECTIVE}, {\bf PERSPECTIVE_DOF}, 263 263 {\bf ORTHOGRAPHIC}, or {\bf FISHEYE}. The {\bf FISHEYE} projection mode 264 requires two extra parameters {\bf FOCAL LENGTH} and {\bf APERTURE}264 requires two extra parameters {\bf FOCALDIST} and {\bf APERTURE} 265 265 which precede the regular camera options. 266 266 267 267 \begin{verbatim} 268 268 Camera 269 269 projection perspective_dof 270 focallength0.75270 FOCALDIST 0.75 271 271 aperture 0.02 272 272 Zoom 0.666667 273 273 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):: 92 92 Finally there is the ``projection='perspective_dof'`` option. :: 93 93 94 94 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') 96 96 sage: T.light((0,5,7), 1.0, (1,1,1)) 97 97 sage: T.texture('t1', opacity=1, specular=.3) 98 98 sage: T.texture('t2', opacity=1, specular=.3, color=(0,0,1)) … … class Tachyon(WithEqualityById, SageObject): 186 186 or ``'fisheye'``. 187 187  ``frustum``  (default ''), otherwise list of four numbers. Only 188 188 used with projection='fisheye'. 189  `` focallength``  (default ''), otherwise a number. Only used189  ``FOCALDIST``  (default ''), otherwise a number. Only used 190 190 with projection='perspective_dof'. 191 191  ``aperture``  (default ''), otherwise a number. Only used 192 192 with projection='perspective_dof'. … … class Tachyon(WithEqualityById, SageObject): 331 331 Use of the ``projection='perspective_dof'`` option. This may not be 332 332 implemented correctly. :: 333 333 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') 335 335 sage: T.light((0,5,7), 1.0, (1,1,1)) 336 336 sage: T.texture('t1', opacity=1, specular=.3) 337 337 sage: T.texture('t2', opacity=1, specular=.3, color=(0,0,1)) … … class Tachyon(WithEqualityById, SageObject): 365 365 look_at=[0, 0, 0], 366 366 viewdir=None, 367 367 projection='PERSPECTIVE', 368 focallength='',368 FOCALDIST='', 369 369 aperture='', 370 370 frustum=''): 371 371 r""" … … class Tachyon(WithEqualityById, SageObject): 391 391 self._camera_position = (3, 0, 0) # default value 392 392 self._updir = updir 393 393 self._projection = projection 394 self._ focallength = focallength394 self._FOCALDIST = FOCALDIST 395 395 self._aperture = aperture 396 396 self._frustum = frustum 397 397 self._objects = [] … … class Tachyon(WithEqualityById, SageObject): 624 624 camera_out = r""" 625 625 camera 626 626 projection %s""" % (tostr(self._projection)) 627 if self._ focallength!= '':627 if self._FOCALDIST != '': 628 628 camera_out = camera_out + r""" 629 focallength %s""" % (float(self._focallength))629 FOCALDIST %s""" % (float(self._FOCALDIST)) 630 630 if self._aperture != '': 631 631 camera_out = camera_out + r""" 632 632 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
Probably the latter could be accomplished by using a decorator.
comment:24 Changed 4 months ago by
 Milestone changed from sage9.6 to sage9.7
comment:25 Changed 4 months ago by
opensusetumbleweed now has a new tachyon, causes failures https://github.com/sagemath/sage/runs/6236170449
comment:26 Changed 4 months ago by
and 0.99.5 is out
None of our 4 patches does apply. I do not know if they should be removed or rebased.
New commits:
new tachyon 99b6