Experimenting with filesystems

Since macOS Sierra introduced the new Apple filesystem (APFS), designed by no other than Dominic Gianpaolo (of BeOS fame), I thought I’d give it a try. So I created an APFS volume on an external 3G hard disk, copied a few pictures on it, and started playing with it.

APFS runs FSCK every time???

It mostly worked, although it comes with dire warnings, and you have to pass an insane option to the diskutil commands to get rid of it:

ddd@Marypuce Pictures> diskutil apfs list
WARNING:  You are using a pre-release version of the Apple File System called
          APFS which is meant for evaluation and development purposes only.
          Files stored on APFS volumes may not be accessible in future releases
          of macOS.  You should back up all of your data before using APFS and
          regularly back up data while using APFS, including before upgrading
          to future releases of macOS.

But things quickly went south as soon as I disconnected and reconnected the disk. It did not mount instantly, because an fsck process (File System Check) was running. Once this completed, I could see my disk, but it took minutes. So I tried ejecting the disk again. And sure enough, I had fsck running again next time I mounted the disk.

So I decided to try something else. I installed ZFS for OSX. I had only heard praises about ZFS being so great and this and that, so I thought it would be interesting.

ZFS can’t remount an external disk without some black magic?

Again, things went smoothly. Well, mostly. You have to activate some special option for the disk to “look like” HFS+ if you want Photos to be able to use it.

But again, things went south as soon as I disconnected the disk from one machine to put it in another one. I did something terribly wrong, you see: I ejected the disk on one Mac, and attached it to another. And I got this helpful little error message:

sudo zfs mount PhotosZFS
cannot open 'PhotosZFS': pool I/O is currently suspended

It looks like this is a standard issue with ZFS. You have to do some magic to export or import your ZFS pools. Something that I could understand. What I cannot understand is this response, from a guy with nickname ilovezfs:

I see in IRC that the disk was actually disconnected and reconnected while the pool was imported. Given that this is a single partition pool, not a raidz or mirror vdev, there is no reason to expect the pool to continue to function after the device has been disconnected and reconnected without exporting it first. At that point, your only choice is to reboot.

So now you have this supposedly enterprise-grade, secure, checksummed, snapshotting, almost magical filesystem, but unmounting a disk and reconnecting it to another computer is so verboten there is no reason to expect the pool to continue to function? Well, yes, there is: every other filesystem on earth does that right. And suggesting the fix is to reboot? Give me a break.

I’ll try ZFS again in 10 years, when it knows how to deal with external disks and does not loose 350GB of data on its first day of operation.


macOS Sierra Mail bug

This week, I started using macOS Sierra. Overall, like iOS 10, it’s another one of these Apple releases of late where what you gain is not extraordinarily compelling, but you discover as you go various things that you lost for no good reason.

Here is one I found today. Apparently, macOS Sierra cannot send mail with picture attachments. That seems like a pretty big one. (Update: It apparently depends on the machine, see at end).

If I send a picture with attachment from a machine running OSX 10.11, here is what I see in my Inbox in macOS Sierra:

Screen Shot 2016-10-06 at 12.38.09.png

So far, so good. Notice that the mail was sent to an Exchange server.

But now, let’s send an e-mail with a picture, this time from macOS Sierra. Here is what it looks like in my Inbox:

Screen Shot 2016-10-06 at 12.39.44.png

Now, something is obviously missing. In Outlook, I see some weird message telling me that the attachment was removed:

Screen Shot 2016-10-06 at 12.40.09.png

What is really curious is that it seems to depend on the server being used, not on the client. If I send the same kind of e-mail to a Google Mail account, then it looks like this, with a large empty box at the top, and then my picture attachment lost at the bottom (still not good, but at least, the picture is not entirely lost) :

Screen Shot 2016-10-06 at 12.42.46.png

I filed a bug report with Apple on this. It seems pretty major to me, and I really wonder how they could have missed it. Is there something special with my setup? Do you see the same thing?

Update: I tried sending an e-mail with attachment from another Mac also running macOS Sierra, and I have no problem at all… except that the aspect ratio of the picture is all wrong on Outlook. So the problem is not with every instance of macOS Sierra, which is good news for Apple and bad news for the Apple Mail developers (bugs that don’t always happen are harder to figure out).

The bogus “interpretations” of quantum mechanics

I’ve not written on this blog for a long time. A talk in Mouans-Sartoux yesterday prompted me to write this rant about what I will (demonstrably) call bogus interpretations of quantum mechanics. Specifically the “dead and alive cat” myth.

Schrödinger’s cat

One of the most iconic thought experiments used to explain quantum mechanics is called Schrödinger’s cat. And it is usually illustrated the way Wikipedia illustrates it, with a superposition of cats, one dead and one alive:


The article of Wikipedia on the topic is quite clear that the cat may be simultaneously both alive and dead (emphasis mine):

The scenario presents a cat that may be simultaneously both alive and dead,[2][3][4][5][6][7][8] a state known as a quantum superposition, as a result of being linked to a random subatomic event that may or may not occur.

In other words, in this way of presenting the experiment, the entangled state of the cat is ontological. It is reality. In that interpretation, the cat is both alive and dead before you open the box.

This is wrong. And I can prove it.

Schrödinger’s cat experiment doesn’t change if the box is made of glass

I can’t possibly be the first person to notice that Schrödinger’s cat experiment does not change a bit if the box in which the cat resides is made of glass.

Let me illustrate. Let’s say that the radioactive particle killing the cat has a half-life of one hour. In other words, in one hour, half of the particles disintegrate, the other half does not.

Let’s start by doing the original experiment, with a sealed metal box. After one hour, we don’t know if the cat is dead. It has a 50% chance of being dead, 50% chance of being alive. This is the now famous entangled state of the cat, the cat being “simultaneously both alive and dead”. When we open the box, the traditional phraseology is that the wave function “collapses” and we have a cat that is either dead or alive.

But if we instead use a glass box, we can then observe the cat along the way. We see a dead cat, or a live cat, never an entangled state. Yet the outcome of the experiment is exactly the same. After one hour, we have 50% chances of the cat being dead, and 50% of chances of the cat being alive.

If you don’t trust me, simply imagine that you have 1000 boxes with a cat inside. After one hour, you will have roughly 500 dead cats, and 500 cats that are still alive. Yet you can observe any cat at any time in this experiment, and I am pretty positive that it will never be a “cat cloud”, a bizarro superposition of a live cat and a dead one. The “simultaneously both alive and dead” cat is a myth.

Quantum mechanics is what physics become when you build it on statistics

What this tells us is that quantum mechanics does not describe what is. It describes what we know. Since you don’t know when individual particles will disintegrate, you cannot predict ahead of time which cats will be alive, which ones will be dead. What you can predict however is the statistical distribution.

And that’s what quantum mechanics does. It helps us rephrase all of physics with statistical distributions. It is a better way to model a world where everything is not as predictable as the trajectory of planets, but where we can still observe and count events.

The collapse of the wave function is nothing mysterious. It is simply the way our knowledge evolves, the way statistical distributions change as we perform experiments and get results. Before you open the box, you have 50% chances of a dead cat, and 50% of a live cat. That’s the “state” not of the universe, but of your knowledge. After you open the box, you have either a dead cat, or a live cat, and your knowledge of the world has “collapsed” onto one of these two statistical distributions.

There is a large number of widespread quantum myths

Presenting quantum mechanics as mysterious, even bizarre, is appealing since it makes the story interesting to tell. It attracts attention. And it also puts physicists who understand these things above mere mortals who can’t.

But the result is the multiplication of widespread quantum myths. Like the idea that quantum mechanics only applies at a small scale (emphasis mine):

Atoms on a small scale behave like nothing on a large scale, for they satisfy the laws of quantum mechanics.

Another example is the question “why is the wave function complex?” Clearly, this seem problematic to many. But if you see quantum mechanics as a statistical description of what we know, the problem goes away.

Restarting a Blogmax “private” blog

Back when I was working for HP, I was using Blogmax to build a daily blog of my activities. That was quite useful as a self-reference, but also helped my team members follow what I was doing (I was the only one working from France, most of the team being in the US).

When I started Taodyne, I stopped doing that because a) we were all in the same room, b) we did not necessarily want to publicise everything we were doing, and c) I didn’t have the time. I now really regret it, as this would have been very interesting to me as a searchable archive.

So I’ve decided to restart a private blog. Not private in the sense that it’s hidden or that you can’t read it, but in the sense that it’s really notes for myself. If they happen to be useful for someone else, good. But be warned, it’s unlikely my private blog will be of any interest to you. I insert a reference here so that Google starts indexing it🙂

5 ways Tao3D is so much better than HTML5

It’s the ultimate showdown. On the left side, the current contender, the web. Thousands of developers building exciting new technologies using JavaScript, HTML5 and mashed potatoes. On the right side, a tiny French startup with Tao3D, a brand new way to describe documents. Guess who wins? (TL;DR: You know the web has to win. But why?)




Why are there new Javascript frameworks every day?

At Google I/O 2015, Google announced Polymer 1.0, a “modern web API” according to the web site. To me, it looks a bit like AngularJS mixed with Bootstrap.js, except it’s entirely different. Google also recently bought Firebase which looks to me a bit like Ionic, except of course it’s entirely different. And just now, I discovered Famous, which seems a bit similar to Reveal.js along with Three.js, except of course it’s entirely different.

Don’t get me wrong, I’m all in favor of competition, and there is something unique about all these frameworks. But this proliferation also demonstrates that there’s something seriously wrong with the web today. And I’d like to explain what it is.


Reason #5: HTML5 is way too verbose

Consider the Hello Famous on the Famous front page. It’s a whole 38 lines of JavaScript just to make a single picture spin. What the Hulk? In Tao3D, it only takes 4 lines. Four tiny miserable lines on one side, vs. 38 with today’s leading web technologies? We are not talking about a mere 2x or 3x factor, but practically 10x. And it’s not an exception either. On a slightly more complex clock animation, Tao3D is 33x shorter than JavaScript. Don’t you want to save your carpal tunnel from premature death?

Due to limitations with WordPress and code colorization, I have to ask you to read the rest on the Taodyne web site.

Shader-based text animations

With shaders, it is possible to create interesting text animations.

The code

The following code lets you create a dancing script by using a vertex shader to move the y coordinate up and down over time, and use a fragment shader to create colorization effects:

import BlackAndWhiteThemes

theme "WhiteOnBlack"
base_slide "Dancing script",

    contents 0,
        // Create a shader transforming a sphere
            vertex_shader <>
            fragment_shader <>
        shader_set time := page_time mod 60

        text_box 0, 0, 0.6*slide_width, slide_height,
            align 0.5
            vertical_align 0.5
            color "#F4B63C"
            font "Tangerine", 120, bold
            shader_set parms := 0.8, 0.03
            paragraph "Fun text effects, 50 lines of code"
            color "white"
            font "Arial", 60
            shader_set parms := 0.3, 0.01
            paragraph "Animate text easily with Tao3D!!!"

            color "lightblue"
            font "Courier", 20
            align 1.0
            shader_set parms := 0.2, 0.7
            paragraph "http://bit.ly/1HWCGvd"

Going further

This technique is extremely powerful. By adjusting the shader, you can easily get effects such as fuzzy text, text with punched holes inside, flaming text, glowing text, and so on.

Christophe de Dinechin