FA-12411 / Laboratory measurement reporting / Open access
Piecewise inverse calibration chooses segments by concentration · case 01
Piecewise inverse calibration chooses segments by concentration.
ROOT CAUSE
Measured signal is compared against the concentration axis.
VERIFIED REPAIR
Locate the signal interval, then invert that segment using exact interpolation.
Unsuccessful approach: Using only the first calibration segment extrapolates beyond a knot.
Case contract
Knots are strictly increasing concentration and signal integer pairs. Return exact Fraction concentration for an in-range signal; otherwise None. At least two knots.
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(knots, signal):
if signal < knots[0][1] or signal > knots[-1][1]:
return None
for (x0,y0),(x1,y1) in zip(knots,knots[1:]):
if signal <= x1:
return str(Fraction(x0)+Fraction((signal-y0)*(x1-x0),y1-y0))
return str(knots[-1][0])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
k=[(0,0),(2*N,4*N),(4*N,12*N)]
check('second segment midpoint', solve(k,8*N), str(3*N))
check('first segment midpoint', solve(k,2*N), str(N))
check('interior knot', solve(k,4*N), str(2*N))
check('upper endpoint', solve(k,12*N), str(4*N))
check('lower endpoint', solve(k,0), '0')
check('below calibration rejected', solve(k,-1), None)
check('above calibration rejected', solve(k,12*N+1), None)
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 |
|---|---|---|---|
| second segment midpoint | 4 | 3 | Failed |
| first segment midpoint | 1 | 1 | Passed |
| interior knot | 2 | 2 | Passed |
| upper endpoint | 4 | 4 | Passed |
| lower endpoint | 0 | 0 | Passed |
| below calibration rejected | None | None | Passed |
| above calibration rejected | None | None | Passed |
SHA-256 / 8da77051745a87b63e9c4c4c5dcd6ac81795e6e8cd849fb3c839fa80ea67f670
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(knots, signal):
if signal < knots[0][1] or signal > knots[-1][1]:
return None
(x0,y0),(x1,y1) = knots[:2]
return str(Fraction(x0)+Fraction((signal-y0)*(x1-x0),y1-y0))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
k=[(0,0),(2*N,4*N),(4*N,12*N)]
check('second segment midpoint', solve(k,8*N), str(3*N))
check('first segment midpoint', solve(k,2*N), str(N))
check('interior knot', solve(k,4*N), str(2*N))
check('upper endpoint', solve(k,12*N), str(4*N))
check('lower endpoint', solve(k,0), '0')
check('below calibration rejected', solve(k,-1), None)
check('above calibration rejected', solve(k,12*N+1), None)
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 |
|---|---|---|---|
| second segment midpoint | 4 | 3 | Failed |
| first segment midpoint | 1 | 1 | Passed |
| interior knot | 2 | 2 | Passed |
| upper endpoint | 6 | 4 | Failed |
| lower endpoint | 0 | 0 | Passed |
| below calibration rejected | None | None | Passed |
| above calibration rejected | None | None | Passed |
SHA-256 / 6e3a6adbeb6ec9c3a1c5b737ef086959f9c2de80c18809249d8698f288157b92
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(knots, signal):
if signal < knots[0][1] or signal > knots[-1][1]:
return None
for (x0,y0),(x1,y1) in zip(knots,knots[1:]):
if signal <= y1:
return str(Fraction(x0)+Fraction((signal-y0)*(x1-x0),y1-y0))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
k=[(0,0),(2*N,4*N),(4*N,12*N)]
check('second segment midpoint', solve(k,8*N), str(3*N))
check('first segment midpoint', solve(k,2*N), str(N))
check('interior knot', solve(k,4*N), str(2*N))
check('upper endpoint', solve(k,12*N), str(4*N))
check('lower endpoint', solve(k,0), '0')
check('below calibration rejected', solve(k,-1), None)
check('above calibration rejected', solve(k,12*N+1), None)
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 |
|---|---|---|---|
| second segment midpoint | 3 | 3 | Passed |
| first segment midpoint | 1 | 1 | Passed |
| interior knot | 2 | 2 | Passed |
| upper endpoint | 4 | 4 | Passed |
| lower endpoint | 0 | 0 | Passed |
| below calibration rejected | None | None | Passed |
| above calibration rejected | None | None | Passed |
SHA-256 / 163957cfe859c4513990b776387d66848164cf07115ecd911aae81f23ff0dae4
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.685353+00:00.
Case digest / 68b707f37e69de78e0d3f18ff96d7ef8a5fa6497c8d4a1068a78def02dbe2660