A dice-driven image generator sends each job to a GPU machine on the local network: write a JSON order, copy it over, invoke the renderer, collect the result. A full read-through of the code during a debugging day turned up that the order file was never removed on either end. The remote folder held 8,938 of them. The local temp directory held 1,000.

Nothing broke, which is why it grew

The files were small and the folder was not one the renderer scanned, so the accumulation had no visible effect over the ten or so production phases that produced it. The remote machine was someone else's working environment, under version control with the order pattern ignored, so the repository there stayed clean while the directory did not. The local copy was fixed with a finally-clause unlink. The remote invocation gained a delete chained onto the render command, after a check with a dummy file that the extra command did not disturb the JSON the renderer prints to stdout.

The already-accumulated files were left alone at first, because deleting on another machine was a decision for its owner. Once that was given, the count was verified (8,938 matching files, zero tracked by git, the generation line stopped with an empty queue), and the delete took the folder from 8,953 files to 15. The first real test of the chained delete was the first image of the next phase, and that phase ran a thousand images with zero orders left behind.

The other findings from the same read

A face with weight zero had been appearing in rolls: 266 of 3,000 for one shape in a prior phase. The weighting function clamped with max(1, w), so zero became one. It now clamps at zero and the statistics code calls the same function. A negative prompt had been recorded in every job for ten phases and had never been sent, because the backend configuration documented that at a guidance scale of 1.0 the negative is zeroed out and the generator did not include it in orders anyway. That one was reported rather than changed; what to do with ten phases of misleading records was not the debugger's call.

Eleven fixes in total were verified in an isolated copy with a dummy backend before touching the live line. Nine were reproduced first. The two that were not were display and logging changes.