The instruments that couldn’t count past sixty

← All field notes

Our frame-rate meter could not count past about sixty, which is how a five-block performance plan died in an afternoon. Catching that turned out to be the easy half. The same meter had a second defect sitting under the first, still lying a day later, and by the time we were done every instrument we owned had wanted an audit.

The cap is the loud defect and the one you can explain at a dinner table. The display’s refresh sync holds the number down, so the meter reports 60.0 while the machine is truly rendering thousands of frames a second, and every “we hold 60” anyone ever wrote down was the ceiling talking. Lift the sync, time the frame off the raw clock, read a real number. Fixed, we thought, and moved on to the next thing.

The lie underneath the lie

The meter is also a trailing average. It reports roughly the last second of frames smoothed together, never the frame in front of it. That is a reasonable thing for a debug readout to do and a terrible thing to grade with, because a test scene sampled for a couple of seconds gives you barely two distinct values to look at. Averaging a pair of already-smoothed numbers smooths nothing. It just launders the spread into something that looks like a measurement.

We knew about the cap by then. We had written it up, built the replacement timer, shipped a change off the back of it. The smoothing never came up, because a defect you have already named feels like a defect you have already handled.

Sixty, sixty-one, forty-nine

One of the frame-rate floors that gates our test scenes had been going red intermittently for a stretch, on unchanged code. The theory was contention: other work sharing the machine, stealing frames, tripping a threshold that was fine really. So we ran the gate on its own, with nothing else competing, and it passed. Noise confirmed, suspicion closed.

Run in isolation three more times, the same gate produced 60, then 61, then 49, against a floor of 50.

A flaky gate passing once in isolation is not a disproof. It is a coin landing heads.

That spread is not a threshold set slightly too high. It is a race: the scene gets graded before it has settled, and which side of a one-second trailing average the sample happens to land on decides the verdict. No floor value fixes a race. You can lower the bar until the coin almost always comes up green and you have still built a test whose answer is decided by timing rather than by the game. The gate now waits for the scene to settle and reads a real frame period, which is the same shape of fix as the meter itself got, arrived at a day late through a different door.

We had met the general case years earlier, when a performance check failed against an empty scene because it read the speedometer before the world had warmed up. Knowing a lesson and recognising it wearing different clothes are separate skills.

The part that is uncomfortable to write down

Here is the actual failure, and it is not the meter’s.

We spent that entire session demanding that instruments be able to fail. Refusing a report that narrated a mystery over a number it had already printed. Refusing to accept documentation as a substitute for a probe. Insisting, over and over, that a measurement which cannot come out the other way is not a measurement. And then, at the first opportunity to be right cheaply, we accepted a single run as proof, because the answer it gave us was the answer we wanted.

The discipline was there; it was just aimed outward. Every instrument in the room got audited except the one reasoning about them, and the tell was that the conclusion flattered us. A check that only ever comes out green is a check that verifies nothing, which is a rule we wrote down long ago after a corpse-decay test passed cleanly past a real bug. One green run in isolation is that same vacuum, dressed as evidence.

Everything with a number on it wanted checking

Once we started looking, the fleet did not hold up well. A gate meant to time how long a scene takes to open was timing a whole world being rebuilt underneath it, so the number it printed was true and answered a question nobody asked. Our profiler was charging the frame for the act of measuring the frame, which made the instrument a term in its own reading. A scaling report printed a cost, then three sections later called that same cost unmeasured, and the phantom unknown authorized real work on a question already sitting on disk. Those last two are told properly in the arc that halved the frame; what matters here is the pattern they make together.

When an ordinary tool breaks, you lose data, and losing data announces itself. When a measuring tool breaks, it keeps producing numbers, and those numbers get believed, planned against, and built on for weeks before anyone thinks to hold them up to the light. The creature diagnosis survived as long as it did partly because the one instrument that could have falsified it was blind in exactly the range where the answer lived. It was never going to be argued out of the plan. It could only be measured out.

The clamped meter is still in the engine. It still reads 60.0 in a scene running twenty times that fast, still averages the last second into a shape that hides its own spread, and we have not tried to fix any of it, because none of it was ever broken for its actual job. It is a debug readout, and it is a fine one. What was broken was that we asked it questions it had no way to answer, then wrote the answers down.

Keep reading

Concept art · pre‑alpha