FAILURE MAP
← Case archive

FA-12431 / Laboratory measurement reporting / Open access

Rounding moves an unquantifiable result above the reporting threshold · case 01

Rounding moves an unquantifiable result above the reporting threshold.

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

ROOT CAUSE

Qualification compares rounded displayed concentration instead of original concentration.

VERIFIED REPAIR

Classify against exact decimal concentration before independently formatting the value.

Unsuccessful approach: Using a strict greater-than comparison misclassifies values exactly at the limit.

Case contract

Return [Q or BELOW, value rounded to one decimal using ROUND_HALF_UP]. Q means exact value >= limit. Inputs are ordinary unsigned base-ten decimal strings without exponent notation, at most six fractional digits, and numeric values from zero through 1000000000000 inclusive. Inputs outside this bounded synthetic model are not supported.

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 decimal import Decimal, ROUND_HALF_UP
N = 1
observations = []
def solve(value, limit):
    v=Decimal(value)
    display=v.quantize(Decimal('0.1'),rounding=ROUND_HALF_UP)
    return ['Q' if display >= Decimal(limit) else 'BELOW',str(display)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('rounds up to limit but remains below', solve(f'{N}.96',str(N+1)), ['BELOW',f'{N+1}.0'])
check('exact limit qualifies', solve(str(N),str(N)), ['Q',f'{N}.0'])
check('above limit qualifies', solve(f'{N}.04',str(N)), ['Q',f'{N}.0'])
check('well below limit', solve('0.1',str(N)), ['BELOW','0.1'])
check('zero at zero threshold', solve('0','0'), ['Q','0.0'])
check('rounding tie formatting', solve(f'{N}.05',str(N)), ['Q',f'{N}.1'])
check('supported upper value boundary', solve('1000000000000','1000000000000'), ['Q','1000000000000.0'])
check('six-place rounding across upper display boundary', solve('999999999999.999999','1000000000000'), ['BELOW','1000000000000.0'])
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
rounds up to limit but remains below['Q', '2.0']['BELOW', '2.0']Failed
exact limit qualifies['Q', '1.0']['Q', '1.0']Passed
above limit qualifies['Q', '1.0']['Q', '1.0']Passed
well below limit['BELOW', '0.1']['BELOW', '0.1']Passed
zero at zero threshold['Q', '0.0']['Q', '0.0']Passed
rounding tie formatting['Q', '1.1']['Q', '1.1']Passed
supported upper value boundary['Q', '1000000000000.0']['Q', '1000000000000.0']Passed
six-place rounding across upper display boundary['Q', '1000000000000.0']['BELOW', '1000000000000.0']Failed

SHA-256 / ec6b52418c8dd618f47bb70d15010bd2cf82937fe5f96f69495f6384c57187d2

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from decimal import Decimal, ROUND_HALF_UP
N = 1
observations = []
def solve(value, limit):
    v=Decimal(value)
    display=v.quantize(Decimal('0.1'),rounding=ROUND_HALF_UP)
    return ['Q' if v > Decimal(limit) else 'BELOW',str(display)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('rounds up to limit but remains below', solve(f'{N}.96',str(N+1)), ['BELOW',f'{N+1}.0'])
check('exact limit qualifies', solve(str(N),str(N)), ['Q',f'{N}.0'])
check('above limit qualifies', solve(f'{N}.04',str(N)), ['Q',f'{N}.0'])
check('well below limit', solve('0.1',str(N)), ['BELOW','0.1'])
check('zero at zero threshold', solve('0','0'), ['Q','0.0'])
check('rounding tie formatting', solve(f'{N}.05',str(N)), ['Q',f'{N}.1'])
check('supported upper value boundary', solve('1000000000000','1000000000000'), ['Q','1000000000000.0'])
check('six-place rounding across upper display boundary', solve('999999999999.999999','1000000000000'), ['BELOW','1000000000000.0'])
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
rounds up to limit but remains below['BELOW', '2.0']['BELOW', '2.0']Passed
exact limit qualifies['BELOW', '1.0']['Q', '1.0']Failed
above limit qualifies['Q', '1.0']['Q', '1.0']Passed
well below limit['BELOW', '0.1']['BELOW', '0.1']Passed
zero at zero threshold['BELOW', '0.0']['Q', '0.0']Failed
rounding tie formatting['Q', '1.1']['Q', '1.1']Passed
supported upper value boundary['BELOW', '1000000000000.0']['Q', '1000000000000.0']Failed
six-place rounding across upper display boundary['BELOW', '1000000000000.0']['BELOW', '1000000000000.0']Passed

SHA-256 / d8ff6486cf83eb4ee88706f6334fbc2a4dcccf2e12288a18ee121b2cdcee87c5

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
from decimal import Decimal, ROUND_HALF_UP
N = 1
observations = []
def solve(value, limit):
    v=Decimal(value)
    display=v.quantize(Decimal('0.1'),rounding=ROUND_HALF_UP)
    return ['Q' if v >= Decimal(limit) else 'BELOW',str(display)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('rounds up to limit but remains below', solve(f'{N}.96',str(N+1)), ['BELOW',f'{N+1}.0'])
check('exact limit qualifies', solve(str(N),str(N)), ['Q',f'{N}.0'])
check('above limit qualifies', solve(f'{N}.04',str(N)), ['Q',f'{N}.0'])
check('well below limit', solve('0.1',str(N)), ['BELOW','0.1'])
check('zero at zero threshold', solve('0','0'), ['Q','0.0'])
check('rounding tie formatting', solve(f'{N}.05',str(N)), ['Q',f'{N}.1'])
check('supported upper value boundary', solve('1000000000000','1000000000000'), ['Q','1000000000000.0'])
check('six-place rounding across upper display boundary', solve('999999999999.999999','1000000000000'), ['BELOW','1000000000000.0'])
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
rounds up to limit but remains below['BELOW', '2.0']['BELOW', '2.0']Passed
exact limit qualifies['Q', '1.0']['Q', '1.0']Passed
above limit qualifies['Q', '1.0']['Q', '1.0']Passed
well below limit['BELOW', '0.1']['BELOW', '0.1']Passed
zero at zero threshold['Q', '0.0']['Q', '0.0']Passed
rounding tie formatting['Q', '1.1']['Q', '1.1']Passed
supported upper value boundary['Q', '1000000000000.0']['Q', '1000000000000.0']Passed
six-place rounding across upper display boundary['BELOW', '1000000000000.0']['BELOW', '1000000000000.0']Passed

SHA-256 / 2d1b7b8cf324c6521dba2685dcb50ece961ed0332afc4c12b3b028036cc5768b

Verification & scope

Bounded decimal reporting model, zero through 10^12 with at most six fractional digits; 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.855286+00:00.

Case digest / b3eb3f5a795c3c64e4147cfc70b706cf4fe519aefc8f688c620c2fa88e1471c0