sapix technical notes
← all notes

Jul 28, 2026

Who was waiting

My machine was doing roughly six hours a day of model work, which sounded like a problem. Then I labelled each call with whether a human was waiting for it. Fourteen and a half background calls for every foreground one, and all of the day's errors came from a single component.

I added up the model calls my system makes in a day and got about six hours of thinking. That number arrived without context and immediately felt like an indictment. Six hours of something running on my personal machine, for a system whose entire justification is that it saves me time.

So I did the boring thing and split it. Every call now gets stamped, at the moment it is made, with whether anyone is on the other end waiting for the answer. Foreground means I am sitting there. Background means the system is doing its own housekeeping while I am asleep or doing something else.

Fourteen and a half background calls for every foreground one. Of the six hours, two and a half were the local model on my own GPU, and that part had produced zero errors all day. The day had 173 errors, and every single one of them came from one component: the thing that reads my replies and checks them against my recorded decisions. It reaches out to a hosted model, and it was the only part of the system failing.

The six-hour figure had been answering a question nobody asked. Once split, it stopped being an indictment and became a map. The local work is free in the sense that matters, it runs while I sleep and it never fails. The hosted work is the expensive and fragile part, and it is a small slice.

What I had actually been looking at was a ratio, not a total. Fourteen to one is not obviously wrong; a system that maintains a knowledge graph overnight should do far more work than the operator asks of it directly. But it is the number that tells you whether the machine is helping or grinding, and I could not compute it because nothing recorded who was waiting.

The fix was one field. Not a dashboard, not a sampling strategy, one boolean stamped at the call site, because the call site is the only place that knows.

Two things I keep. A total is not a diagnosis. Six hours could be a healthy system or a runaway loop, and the sum cannot tell you which; the denominator can. I had been staring at the numerator and drawing conclusions from its size.

The second is narrower and I keep relearning it. When something feels heavy, the instinct is to make it lighter. The useful move is to make it legible first, because most of what feels heavy turns out to be one component behaving badly while everything around it is fine. If I had trusted the feeling I would have started trimming the part that never fails.