FA-12421 / Laboratory measurement reporting / Open access
Spike recovery subtracts an undiluted baseline from a diluted sample · case 01
Spike recovery subtracts an undiluted baseline from a diluted sample.
ROOT CAUSE
Original concentration is subtracted from a mixture concentration without accounting for the added spike volume.
VERIFIED REPAIR
Calculate recovered amount after scaling both mixture and baseline by their own volumes.
Unsuccessful approach: Correcting baseline dilution but dividing by spike concentration instead of spike amount leaves a volume-dependent bias.
Case contract
Return exact percent recovery: 100*(measured*(sample_volume+spike_volume)-baseline*sample_volume)/(spike_concentration*spike_volume). Positive volumes and spike concentration; all values integers.
Why this case matters
A deterministic synthetic laboratory reporting model isolates a software metadata contract; it is not a clinical procedure.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(measured, baseline, sample_volume, spike_volume, spike_concentration):
return str(Fraction(100*(measured-baseline),spike_concentration))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('complete recovery with added volume', solve(4*N,2*N,2,2,6*N), '100')
check('different spike volume', solve(4*N,2*N,3,3,6*N), '100')
check('half recovery', solve(3*N,2*N,2,2,8*N), '50')
check('zero recovered amount', solve(N,2*N,2,2,6*N), '0')
check('unit spike volume', solve(4*N,2*N,1,1,6*N), '100')
check('negative recovery retained', solve(0,2*N,2,2,4*N), '-50')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| complete recovery with added volume | 100/3 | 100 | Failed |
| different spike volume | 100/3 | 100 | Failed |
| half recovery | 25/2 | 50 | Failed |
| zero recovered amount | -50/3 | 0 | Failed |
| unit spike volume | 100/3 | 100 | Failed |
| negative recovery retained | -50 | -50 | Passed |
SHA-256 / a9a78d194de8884baa00ea31f1c86cab92e8c6e94b0f276551f779f6ddbc331c
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(measured, baseline, sample_volume, spike_volume, spike_concentration):
return str(Fraction(100*(measured*(sample_volume+spike_volume)-baseline*sample_volume),spike_concentration))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('complete recovery with added volume', solve(4*N,2*N,2,2,6*N), '100')
check('different spike volume', solve(4*N,2*N,3,3,6*N), '100')
check('half recovery', solve(3*N,2*N,2,2,8*N), '50')
check('zero recovered amount', solve(N,2*N,2,2,6*N), '0')
check('unit spike volume', solve(4*N,2*N,1,1,6*N), '100')
check('negative recovery retained', solve(0,2*N,2,2,4*N), '-50')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| complete recovery with added volume | 200 | 100 | Failed |
| different spike volume | 300 | 100 | Failed |
| half recovery | 100 | 50 | Failed |
| zero recovered amount | 0 | 0 | Passed |
| unit spike volume | 100 | 100 | Passed |
| negative recovery retained | -100 | -50 | Failed |
SHA-256 / f5ff488c796e17a16a86cdea0f22d5130df29de2baf037c01289eae1ad3347e6
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(measured, baseline, sample_volume, spike_volume, spike_concentration):
return str(Fraction(100*(measured*(sample_volume+spike_volume)-baseline*sample_volume),spike_concentration*spike_volume))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('complete recovery with added volume', solve(4*N,2*N,2,2,6*N), '100')
check('different spike volume', solve(4*N,2*N,3,3,6*N), '100')
check('half recovery', solve(3*N,2*N,2,2,8*N), '50')
check('zero recovered amount', solve(N,2*N,2,2,6*N), '0')
check('unit spike volume', solve(4*N,2*N,1,1,6*N), '100')
check('negative recovery retained', solve(0,2*N,2,2,4*N), '-50')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| complete recovery with added volume | 100 | 100 | Passed |
| different spike volume | 100 | 100 | Passed |
| half recovery | 50 | 50 | Passed |
| zero recovered amount | 0 | 0 | Passed |
| unit spike volume | 100 | 100 | Passed |
| negative recovery retained | -50 | -50 | Passed |
SHA-256 / 15b97ee2352a6769382a14e69581c4f58025614ab644c4e24f2a30c279f12c8c
Verification & scope
Synthetic integer/rational fixtures only; no instrument validation or clinical interpretation. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:38:56.822740+00:00.
Case digest / f11436046712f362b0b09c90a6f0979c2c282c0389263fb9f23648d602f27f4d