Florian Wesch

info-beamer pi 0.9.6 released

Posted Jul 25 2016 by Florian Wesch

This release updates the library LuaJIT used by info-beamer. The version used in 0.9.5 could result in wrong numerical results in some cases. If you're using 0.9.5 you should upgrade.

Another update

This update only fixes a problem that was introduced in 0.9.5. So if you're updating from an older version, be sure to have a look at the 0.9.5 release itself. All new features are described there.

The problem

It's only been a week since the last release but the problem justifies a new version to be released: info-beamer has been using LuaJIT instead of the official Lua runtime. Mostly for performance reasons, but also for its awesome features. LuaJIT 2.1 is still in development but has been pretty stable in the past which resulted in info-beamer using this branch instead of the older 2.0 branch.

But bugs happen and sometimes they are not easily noticable and only hit under special circumstances.

JIT optimizations

LuaJIT is obviously a JIT (just in time) compiler. So it tries to detect executions patterns and paths and begins to translate them to machine code once it decides that this might be worth the effort. One of those optimizations steps is constant folding. As a human it's easy to detect that this:

num_pixels_in_hd = 1920 * 1080

is eqivalent to

num_pixels_in_hd = 2073600

A JIT compiler can detect such patterns as well and will (in that small example) remove one unnecessary multiplication. In the LuaJIT version used in info-beamer 0.9.5 there's a small bug related to constant folding: Any expression like this:

a = x * -1     or     a = x / -1

is optimized into

a = -x

Unfortunately while doing that it accidentally corrupted the result as it was saved but then overwritten by recursivly calling the constant folding optimization again. This somehow reminds me a bit of the bug in the DAO. We're lucky that the fix is easy this time:

   } else if (n == -1.0) {  /* x o -1 ==> -x */
+    IRRef op1 = fins->op1;
+    fins->op2 = (IRRef1)lj_ir_ksimd(J, LJ_KSIMD_NEG);  /* Modifies fins. */
+    fins->op1 = op1;
     fins->o = IR_NEG;
-    fins->op2 = (IRRef1)lj_ir_ksimd(J, LJ_KSIMD_NEG);
     return RETRYFOLD;
   } else [...]

Nothing else was added or changed in 0.9.6 compared to 0.9.5 so you should upgrade now if you're using 0.9.5.


info-beamer.com offers the most advanced digital signage platform for the Raspberry Pi. Fully hosted, programmable and easy to use. Learn more...

Get started for free!

Trying out the best digital signage solution for the Raspberry Pi is totally free: Use one device and 1GB of storage completely free of charge. No credit card required.

Follow @infobeamer on twitter to get notified of new blog posts and other related info-beamer news. It's very low traffic so just give it a try.

You can also subscribe to the RSS Feed RSS feed.

Share this post:

Share using Twitter

Questions or comments?
Get in contact!