{"abstract":"Piecewise inverse calibration chooses segments by concentration.","category":"Laboratory measurement reporting","checks":7,"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.","evaluation_group":"model-f8ac4b94ce8b870f","failed_approach":"Using only the first calibration segment extrapolates beyond a knot.","family":"z-laboratory_units-inverse-calibration","id":"FA-12411","implementations":{"attempt":{"sha256":"6e3a6adbeb6ec9c3a1c5b737ef086959f9c2de80c18809249d8698f288157b92","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(knots, signal):\n    if signal < knots[0][1] or signal > knots[-1][1]:\n        return None\n    (x0,y0),(x1,y1) = knots[:2]\n    return str(Fraction(x0)+Fraction((signal-y0)*(x1-x0),y1-y0))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nk=[(0,0),(2*N,4*N),(4*N,12*N)]\ncheck('second segment midpoint', solve(k,8*N), str(3*N))\ncheck('first segment midpoint', solve(k,2*N), str(N))\ncheck('interior knot', solve(k,4*N), str(2*N))\ncheck('upper endpoint', solve(k,12*N), str(4*N))\ncheck('lower endpoint', solve(k,0), '0')\ncheck('below calibration rejected', solve(k,-1), None)\ncheck('above calibration rejected', solve(k,12*N+1), None)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"8da77051745a87b63e9c4c4c5dcd6ac81795e6e8cd849fb3c839fa80ea67f670","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(knots, signal):\n    if signal < knots[0][1] or signal > knots[-1][1]:\n        return None\n    for (x0,y0),(x1,y1) in zip(knots,knots[1:]):\n        if signal <= x1:\n            return str(Fraction(x0)+Fraction((signal-y0)*(x1-x0),y1-y0))\n    return str(knots[-1][0])\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nk=[(0,0),(2*N,4*N),(4*N,12*N)]\ncheck('second segment midpoint', solve(k,8*N), str(3*N))\ncheck('first segment midpoint', solve(k,2*N), str(N))\ncheck('interior knot', solve(k,4*N), str(2*N))\ncheck('upper endpoint', solve(k,12*N), str(4*N))\ncheck('lower endpoint', solve(k,0), '0')\ncheck('below calibration rejected', solve(k,-1), None)\ncheck('above calibration rejected', solve(k,12*N+1), None)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"163957cfe859c4513990b776387d66848164cf07115ecd911aae81f23ff0dae4","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(knots, signal):\n    if signal < knots[0][1] or signal > knots[-1][1]:\n        return None\n    for (x0,y0),(x1,y1) in zip(knots,knots[1:]):\n        if signal <= y1:\n            return str(Fraction(x0)+Fraction((signal-y0)*(x1-x0),y1-y0))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nk=[(0,0),(2*N,4*N),(4*N,12*N)]\ncheck('second segment midpoint', solve(k,8*N), str(3*N))\ncheck('first segment midpoint', solve(k,2*N), str(N))\ncheck('interior knot', solve(k,4*N), str(2*N))\ncheck('upper endpoint', solve(k,12*N), str(4*N))\ncheck('lower endpoint', solve(k,0), '0')\ncheck('below calibration rejected', solve(k,-1), None)\ncheck('above calibration rejected', solve(k,12*N+1), None)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"z-laboratory_units-inverse-calibration","generated_at":"2026-09-29T14:38:56.685353+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic synthetic laboratory reporting model isolates a software metadata contract; it is not a clinical procedure.","repair":"Locate the signal interval, then invert that segment using exact interpolation.","root_cause":"Measured signal is compared against the concentration axis.","sha256":"68b707f37e69de78e0d3f18ff96d7ef8a5fa6497c8d4a1068a78def02dbe2660","title":"Piecewise inverse calibration chooses segments by concentration · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":44.77,"exit_code":1,"observations":[{"actual":"4","check":"second segment midpoint","expected":"3","passed":false},{"actual":"1","check":"first segment midpoint","expected":"1","passed":true},{"actual":"2","check":"interior knot","expected":"2","passed":true},{"actual":"6","check":"upper endpoint","expected":"4","passed":false},{"actual":"0","check":"lower endpoint","expected":"0","passed":true},{"actual":null,"check":"below calibration rejected","expected":null,"passed":true},{"actual":null,"check":"above calibration rejected","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"second segment midpoint\", \"actual\": \"4\", \"expected\": \"3\", \"passed\": false}, {\"check\": \"first segment midpoint\", \"actual\": \"1\", \"expected\": \"1\", \"passed\": true}, {\"check\": \"interior knot\", \"actual\": \"2\", \"expected\": \"2\", \"passed\": true}, {\"check\": \"upper endpoint\", \"actual\": \"6\", \"expected\": \"4\", \"passed\": false}, {\"check\": \"lower endpoint\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"below calibration rejected\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"above calibration rejected\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.95,"exit_code":1,"observations":[{"actual":"4","check":"second segment midpoint","expected":"3","passed":false},{"actual":"1","check":"first segment midpoint","expected":"1","passed":true},{"actual":"2","check":"interior knot","expected":"2","passed":true},{"actual":"4","check":"upper endpoint","expected":"4","passed":true},{"actual":"0","check":"lower endpoint","expected":"0","passed":true},{"actual":null,"check":"below calibration rejected","expected":null,"passed":true},{"actual":null,"check":"above calibration rejected","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"second segment midpoint\", \"actual\": \"4\", \"expected\": \"3\", \"passed\": false}, {\"check\": \"first segment midpoint\", \"actual\": \"1\", \"expected\": \"1\", \"passed\": true}, {\"check\": \"interior knot\", \"actual\": \"2\", \"expected\": \"2\", \"passed\": true}, {\"check\": \"upper endpoint\", \"actual\": \"4\", \"expected\": \"4\", \"passed\": true}, {\"check\": \"lower endpoint\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"below calibration rejected\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"above calibration rejected\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.369,"exit_code":0,"observations":[{"actual":"3","check":"second segment midpoint","expected":"3","passed":true},{"actual":"1","check":"first segment midpoint","expected":"1","passed":true},{"actual":"2","check":"interior knot","expected":"2","passed":true},{"actual":"4","check":"upper endpoint","expected":"4","passed":true},{"actual":"0","check":"lower endpoint","expected":"0","passed":true},{"actual":null,"check":"below calibration rejected","expected":null,"passed":true},{"actual":null,"check":"above calibration rejected","expected":null,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"second segment midpoint\", \"actual\": \"3\", \"expected\": \"3\", \"passed\": true}, {\"check\": \"first segment midpoint\", \"actual\": \"1\", \"expected\": \"1\", \"passed\": true}, {\"check\": \"interior knot\", \"actual\": \"2\", \"expected\": \"2\", \"passed\": true}, {\"check\": \"upper endpoint\", \"actual\": \"4\", \"expected\": \"4\", \"passed\": true}, {\"check\": \"lower endpoint\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"below calibration rejected\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"above calibration rejected\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}