This hour is four things that went wrong. I am not going to explain any of them until the end.
Written by people who were good at their jobs. Reviewed, tested, signed off by somebody.
So the question is not who was careless.
The question is what these four have in common.
Write your guess down now. You have about twenty minutes.
watch · no notes yet
One number gets calculated. It is 271.
It gets written into a box built to hold values up to 255. Eight bits. Eight actual wires.
What came out the other side?
Nothing was reported. Nothing was logged.
ariane 5 · flight 501 · 4 june 1996
The rocket was fine. The engines were fine. The guidance code had flown successfully for fifteen years.
Ariane 5 just flew faster than Ariane 4.
A number holding sideways velocity was copied into a box that holds up to 32767.
Nothing checked. Forty seconds after lift-off the vehicle destroyed itself, with about $370M aboard.
Most software keeps time by counting seconds since 1970. One counter. Thirty-two wires.
The leftmost wire is the one that decides whether the number is negative.
Every bit changed at once, the sign bit came on, and the machine now believes it is 1901. It did not stop. It did not warn anybody. It carries on doing its job.
Not a rocket, not thirty years ago. Open an editor and type this in.
Note what it does not do. There is no clever arithmetic here. The first thing it does is store a number and read it straight back.
Before I run it, what should the first line print?
// tenth.c #include <stdio.h> int main(void) { float a = 0.1f; printf("stored 0.1, got back %.20f\n", a); float sum = 0.0f; for (int i = 0; i < 10; i++) sum += 0.1f; printf("ten of them = %.20f\n", sum); printf("is that 1.0? %s\n", (sum == 1.0f) ? "yes" : "no"); return 0; }
Line one performs no arithmetic at all. It stores a number and reads it back, and the number has already changed.
Then ten of them add up to something that is not one.
Off by fifteen billionths, silently, before you have done a single calculation. Add it up ten times and the error adds up too.
Two minutes. Talk to the person next to you.
into a box that stops at 255
into a box that stops at 32767
into a box that stops in 2038
into a box with no room for it at all
It is one problem, four times.
No crash, no exception, no warning, no red light anywhere.
Each machine took a wrong value and carried on working, perfectly happily, until somebody else noticed much later.
The phone booted a thousand times before it didn't.
The rocket flew for thirty-seven seconds.
The clock is still ticking now.
Every addition was performed correctly. Every copy, every increment, correct.
Check the arithmetic in all four and it is faultless. And in the fourth one there was barely any arithmetic to get wrong.
So none of these were calculation failures.
Which leaves the uncomfortable question. If the sums were right and the machines were working, what exactly broke?
Not the number. The way the number was written down, and what that choice quietly costs.
For the next eleven hours, before we build a single circuit.