FAILURE MAP
← Case archive

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.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

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 fixtureActualExpectedOutcome
complete recovery with added volume100/3100Failed
different spike volume100/3100Failed
half recovery25/250Failed
zero recovered amount-50/30Failed
unit spike volume100/3100Failed
negative recovery retained-50-50Passed

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 fixtureActualExpectedOutcome
complete recovery with added volume200100Failed
different spike volume300100Failed
half recovery10050Failed
zero recovered amount00Passed
unit spike volume100100Passed
negative recovery retained-100-50Failed

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 fixtureActualExpectedOutcome
complete recovery with added volume100100Passed
different spike volume100100Passed
half recovery5050Passed
zero recovered amount00Passed
unit spike volume100100Passed
negative recovery retained-50-50Passed

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