Build1 publisher3 min readPublished
A negative control is the one harness check that fires on a result you wanted
A dev.to post reports ten bugs in one measurement harness, every one of them flattering and none found by reading the code. The three checks that eventually caught them cost a few lines each to write.
The Engineer · Build desk

What happened
- The author of a dev.to post says he built a measurement harness and found ten bugs in it, that every one made his results look better than they were, and that reading the code found none of them.
- An editable install of a src-layout package resolved imports back to the original checkout, so mutations written to a temp copy never executed and three targets scored 0.000.
- Running mutants concurrently produced three different results across four runs on the one target doing real async I/O, and an improvement had already been recorded from that data.
- A reader, Ahmet Ozel, supplied the check the harness lacked: a negative control, a deliberately vacuous case whose score should come back near zero.
- The author calls the canary swap the cheapest check on the list and says to write it before writing any measurement code at all.
Compiled by The EngineerSomething wrong?How this is made
Why it matters
- constraint A negative control only tests the bottom of the scoring scale, so a harness that clears all three checks still has an untested ceiling.
- capability With the control in place there is one position in the harness where a high number triggers investigation, so an optimistic bug gets debugged for the same reason a pessimistic one always did.
- exposure A team that treats either check as covering the other still ships numbers from a harness that can be executing the wrong file or racing itself, and neither failure announces itself in the output.
- decision A delta measured under concurrent execution cannot be separated from noise after the fact, so the choice is to re-run scoring serially rather than reason about the data already collected.
The asymmetry sits in the trigger for debugging. A number you dislike gets read line by line. A number you like gets recorded. Debugging is triggered by surprise, and a pleasing result is not surprising [2]. So every pass over the code strips out more unflattering bugs than flattering ones, and by the author's account the instrument drifts one way while nothing in the workflow is watching for it [3]. "That is the whole mechanism. It does not require anyone to be dishonest, which is why being careful does not fix it," he wrote [4].
The canary swap replaces the module under test with the string "this is not valid python" and asserts that the suite fails [5]. What it proves is narrow: the swap reached the interpreter [5]. It does not prove the change was isolated, that scoring is correct, or that a valid change would also have reached the interpreter [6]. It has a hole, too. Unparseable text has a different byte length from the original, so it invalidates Python's bytecode cache, and the author's canary passed while a same-length mutation was silently ignored [7]. The cache did exactly what it was built to do. Vinh Nguyen found that failure, and a canary that preserves byte size closes it [8][9].
The determinism gate is the second check: score the same target three times, serially, and require byte-identical output [13]. It proves runs are isolated from each other and nothing more. "Three identical runs of the wrong file are still perfectly deterministic," he wrote [14]. On the async target, four runs produced three distinct results, so at most two of the four agreed [16].
The negative control inverts the direction of the alarm. Everywhere else a high score is good and a low one prompts investigation; on a suite that asserts nothing, a high score is the failure, which the author argues gives you the one place in a harness where a flattering result is the surprising one [20]. Building it has a constraint. A near-zero score is also what you get when nothing loaded, which is what the editable-install bug produced, so the control has to assert separately that the suite passes on clean source, that the module imported and executed, and that the other checks still fire [21]. His did not come back at zero. It scored 7 of 51, about 14 percent of the scale, which he attributes to calibration: `assert x is not None` is a real detector, just an extremely narrow one [22][23].
The evidence is one harness and one author's tally. The post links a longer write-up listing all ten bugs and the direction each one pushed, and does not reproduce that list [24]. For the same drift to be a property of your harness, two things have to hold: the score has to be monotone, so higher looks like better work, and the decision to investigate has to depend on whether the number surprised you. Both hold for every eval harness I have written, including the ones where I also wrote the code being scored. In my view the negative control is the check to add first, because it is the only one of the three that fires on a result you wanted.
What to watch
- The linked longer write-up listing all ten bugs and the direction each pushed would show whether every bug was flattering or only the ones that changed a result.
- Whether the byte-size-preserving canary catches mutations the unparseable swap misses on non-editable installs and other Python layouts.
- Whether any of the remaining checks in the list tests the top of the scoring range, which the negative control does not.