{"abstract":"The exact rational continued fraction result violates the stated contract at floor partial quotient.","category":"Numerics","checks":8,"contract":"Input [p,q], q>0; canonical simple continued fraction of p/q with last term>1 unless singleton. Bounds: -25<=p<=25 and 1<=q<=17.","evaluation_group":"s3-numerics-rational-continued-fraction","failed_approach":"The partial repair abs(p)//q still violates the floor partial quotient invariant.","family":"s3-numerics-rational-continued-fraction-floor-partial-quotient","id":"FA-14416","implementations":{"attempt":{"sha256":"e12813f2513bfe71c75445edfecc86ddabefa7c8bb906a5ce2c5eec5403653a7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport itertools\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    p,q=x\n    out=[]\n    for _ in range(30):\n     if q==0: break\n     a=abs(p)//q\n     out.append(a)\n     r=p-a*q\n     p,q=q,r\n    if len(out)>1 and out[-1]==1:\n     out[-2]+=1\n     out.pop()\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([-25, 2], [-13, 2]), ([-25, 1], [-25]), ([25, 17], [1, 2, 8]), ([-25, 3], [-9, 1, 2]), ([-25, 4], [-7, 1, 3]), ([-25, 5], [-5]), ([-25, 6], [-5, 1, 5]), ([-25, 7], [-4, 2, 3])], [([-25, 3], [-9, 1, 2]), ([-25, 4], [-7, 1, 3]), ([-25, 1], [-25]), ([25, 17], [1, 2, 8]), ([-24, 1], [-24]), ([-24, 2], [-12]), ([-24, 3], [-8]), ([-24, 4], [-6])], [([-25, 4], [-7, 1, 3]), ([-25, 7], [-4, 2, 3]), ([-25, 1], [-25]), ([25, 17], [1, 2, 8]), ([-23, 1], [-23]), ([-23, 2], [-12, 2]), ([-23, 3], [-8, 3]), ([-23, 4], [-6, 4])], [([-25, 6], [-5, 1, 5]), ([-25, 10], [-3, 2]), ([-25, 1], [-25]), ([25, 17], [1, 2, 8]), ([-22, 1], [-22]), ([-22, 2], [-11]), ([-22, 3], [-8, 1, 2]), ([-22, 4], [-6, 2])], [([-25, 7], [-4, 2, 3]), ([-25, 13], [-2, 13]), ([-25, 1], [-25]), ([25, 17], [1, 2, 8]), ([-21, 1], [-21]), ([-21, 2], [-11, 2]), ([-21, 3], [-7]), ([-21, 4], [-6, 1, 3])]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"explicit oracle %d\" % i, solve(args), expected)\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":"e5671fac4351e4f71cfc0c2e0591b0ec32795cde35e57fe6ea117ed5e8713629","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport itertools\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    p,q=x\n    out=[]\n    for _ in range(30):\n     if q==0: break\n     a=int(Fraction(p,q))\n     out.append(a)\n     r=p-a*q\n     p,q=q,r\n    if len(out)>1 and out[-1]==1:\n     out[-2]+=1\n     out.pop()\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([-25, 2], [-13, 2]), ([-25, 1], [-25]), ([25, 17], [1, 2, 8]), ([-25, 3], [-9, 1, 2]), ([-25, 4], [-7, 1, 3]), ([-25, 5], [-5]), ([-25, 6], [-5, 1, 5]), ([-25, 7], [-4, 2, 3])], [([-25, 3], [-9, 1, 2]), ([-25, 4], [-7, 1, 3]), ([-25, 1], [-25]), ([25, 17], [1, 2, 8]), ([-24, 1], [-24]), ([-24, 2], [-12]), ([-24, 3], [-8]), ([-24, 4], [-6])], [([-25, 4], [-7, 1, 3]), ([-25, 7], [-4, 2, 3]), ([-25, 1], [-25]), ([25, 17], [1, 2, 8]), ([-23, 1], [-23]), ([-23, 2], [-12, 2]), ([-23, 3], [-8, 3]), ([-23, 4], [-6, 4])], [([-25, 6], [-5, 1, 5]), ([-25, 10], [-3, 2]), ([-25, 1], [-25]), ([25, 17], [1, 2, 8]), ([-22, 1], [-22]), ([-22, 2], [-11]), ([-22, 3], [-8, 1, 2]), ([-22, 4], [-6, 2])], [([-25, 7], [-4, 2, 3]), ([-25, 13], [-2, 13]), ([-25, 1], [-25]), ([25, 17], [1, 2, 8]), ([-21, 1], [-21]), ([-21, 2], [-11, 2]), ([-21, 3], [-7]), ([-21, 4], [-6, 1, 3])]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"explicit oracle %d\" % i, solve(args), expected)\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":"eba07eb91b7129c24ed3b0000bde9b1eec8794b17030856b3a0dd0919aff71ec","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport itertools\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    p,q=x\n    out=[]\n    for _ in range(30):\n     if q==0: break\n     a=p//q\n     out.append(a)\n     r=p-a*q\n     p,q=q,r\n    if len(out)>1 and out[-1]==1:\n     out[-2]+=1\n     out.pop()\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([-25, 2], [-13, 2]), ([-25, 1], [-25]), ([25, 17], [1, 2, 8]), ([-25, 3], [-9, 1, 2]), ([-25, 4], [-7, 1, 3]), ([-25, 5], [-5]), ([-25, 6], [-5, 1, 5]), ([-25, 7], [-4, 2, 3])], [([-25, 3], [-9, 1, 2]), ([-25, 4], [-7, 1, 3]), ([-25, 1], [-25]), ([25, 17], [1, 2, 8]), ([-24, 1], [-24]), ([-24, 2], [-12]), ([-24, 3], [-8]), ([-24, 4], [-6])], [([-25, 4], [-7, 1, 3]), ([-25, 7], [-4, 2, 3]), ([-25, 1], [-25]), ([25, 17], [1, 2, 8]), ([-23, 1], [-23]), ([-23, 2], [-12, 2]), ([-23, 3], [-8, 3]), ([-23, 4], [-6, 4])], [([-25, 6], [-5, 1, 5]), ([-25, 10], [-3, 2]), ([-25, 1], [-25]), ([25, 17], [1, 2, 8]), ([-22, 1], [-22]), ([-22, 2], [-11]), ([-22, 3], [-8, 1, 2]), ([-22, 4], [-6, 2])], [([-25, 7], [-4, 2, 3]), ([-25, 13], [-2, 13]), ([-25, 1], [-25]), ([25, 17], [1, 2, 8]), ([-21, 1], [-21]), ([-21, 2], [-11, 2]), ([-21, 3], [-7]), ([-21, 4], [-6, 1, 3])]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"explicit oracle %d\" % i, solve(args), expected)\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":"A deterministic bounded teaching model. Inputs are restricted to the explicit contract; this is not a production algebra library. 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":"s3-numerics-rational-continued-fraction-floor-partial-quotient","generated_at":"2026-09-29T14:39:16.579020+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Exact discrete arithmetic with observable algorithmic state; no floating point approximation is used.","repair":"Use p//q at the floor partial quotient step.","root_cause":"The floor partial quotient step uses int(Fraction(p,q)) instead of p//q.","sha256":"04d1de85ad91d9863fd708c17e67da40e193ebddb0b1a4567f465a353d89bca6","title":"Rational continued fraction: floor partial quotient · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.687,"exit_code":1,"observations":[{"actual":[12,-1,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],"check":"explicit oracle 0","expected":[-13,2],"passed":false},{"actual":[25,-1,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],"check":"explicit oracle 1","expected":[-25],"passed":false},{"actual":[1,2,8],"check":"explicit oracle 2","expected":[1,2,8],"passed":true},{"actual":[8,-1,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],"check":"explicit oracle 3","expected":[-9,1,2],"passed":false},{"actual":[6,-1,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],"check":"explicit oracle 4","expected":[-7,1,3],"passed":false},{"actual":[5,-1,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],"check":"explicit oracle 5","expected":[-5],"passed":false},{"actual":[4,-1,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],"check":"explicit oracle 6","expected":[-5,1,5],"passed":false},{"actual":[3,-1,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],"check":"explicit oracle 7","expected":[-4,2,3],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": [12, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], \"expected\": [-13, 2], \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": [25, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], \"expected\": [-25], \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": [1, 2, 8], \"expected\": [1, 2, 8], \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": [8, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], \"expected\": [-9, 1, 2], \"passed\": false}, {\"check\": \"explicit oracle 4\", \"actual\": [6, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], \"expected\": [-7, 1, 3], \"passed\": false}, {\"check\": \"explicit oracle 5\", \"actual\": [5, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], \"expected\": [-5], \"passed\": false}, {\"check\": \"explicit oracle 6\", \"actual\": [4, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], \"expected\": [-5, 1, 5], \"passed\": false}, {\"check\": \"explicit oracle 7\", \"actual\": [3, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], \"expected\": [-4, 2, 3], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.885,"exit_code":1,"observations":[{"actual":[-12,-2],"check":"explicit oracle 0","expected":[-13,2],"passed":false},{"actual":[-25],"check":"explicit oracle 1","expected":[-25],"passed":true},{"actual":[1,2,8],"check":"explicit oracle 2","expected":[1,2,8],"passed":true},{"actual":[-8,-3],"check":"explicit oracle 3","expected":[-9,1,2],"passed":false},{"actual":[-6,-4],"check":"explicit oracle 4","expected":[-7,1,3],"passed":false},{"actual":[-5],"check":"explicit oracle 5","expected":[-5],"passed":true},{"actual":[-4,-6],"check":"explicit oracle 6","expected":[-5,1,5],"passed":false},{"actual":[-3,-1,-1,-3],"check":"explicit oracle 7","expected":[-4,2,3],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": [-12, -2], \"expected\": [-13, 2], \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": [-25], \"expected\": [-25], \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": [1, 2, 8], \"expected\": [1, 2, 8], \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": [-8, -3], \"expected\": [-9, 1, 2], \"passed\": false}, {\"check\": \"explicit oracle 4\", \"actual\": [-6, -4], \"expected\": [-7, 1, 3], \"passed\": false}, {\"check\": \"explicit oracle 5\", \"actual\": [-5], \"expected\": [-5], \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": [-4, -6], \"expected\": [-5, 1, 5], \"passed\": false}, {\"check\": \"explicit oracle 7\", \"actual\": [-3, -1, -1, -3], \"expected\": [-4, 2, 3], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.779,"exit_code":0,"observations":[{"actual":[-13,2],"check":"explicit oracle 0","expected":[-13,2],"passed":true},{"actual":[-25],"check":"explicit oracle 1","expected":[-25],"passed":true},{"actual":[1,2,8],"check":"explicit oracle 2","expected":[1,2,8],"passed":true},{"actual":[-9,1,2],"check":"explicit oracle 3","expected":[-9,1,2],"passed":true},{"actual":[-7,1,3],"check":"explicit oracle 4","expected":[-7,1,3],"passed":true},{"actual":[-5],"check":"explicit oracle 5","expected":[-5],"passed":true},{"actual":[-5,1,5],"check":"explicit oracle 6","expected":[-5,1,5],"passed":true},{"actual":[-4,2,3],"check":"explicit oracle 7","expected":[-4,2,3],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": [-13, 2], \"expected\": [-13, 2], \"passed\": true}, {\"check\": \"explicit oracle 1\", \"actual\": [-25], \"expected\": [-25], \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": [1, 2, 8], \"expected\": [1, 2, 8], \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": [-9, 1, 2], \"expected\": [-9, 1, 2], \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": [-7, 1, 3], \"expected\": [-7, 1, 3], \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": [-5], \"expected\": [-5], \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": [-5, 1, 5], \"expected\": [-5, 1, 5], \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": [-4, 2, 3], \"expected\": [-4, 2, 3], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}