{"abstract":"The exact best bounded rational result violates the stated contract at two nearest numerator candidates.","category":"Numerics","checks":8,"contract":"Input [p,q,B], q>0 B>0; nearest rational to p/q with denominator<=B, ties choose smaller rational then denominator.","contract_signature":"x","evaluation_group":"s3-numerics-best-bounded-rational","failed_approach":"The partial repair (a-1,a) still violates the two nearest numerator candidates invariant.","family":"s3-numerics-best-bounded-rational-two-nearest-numerator-candidates","id":"FA-15001","implementations":{"attempt":{"sha256":"793f4f634d5495b8e5f31236514a37badc936e5c469f8fdc21aa0304ee8eeb21","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,B=x;target=Fraction(p,q);candidates=[]\n    for d in range(1,B+1):\n     a=(p*d)//q\n     for n in (a-1,a):\n      r=Fraction(n,d)\n      candidates.append((abs(r-target),r,d))\n    if not candidates:return None\n    best=min(candidates)\n    r=best[1]\n    return [r.numerator,r.denominator]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([-12, 5, 1], [-2, 1]), ([-12, 1, 1], [-12, 1]), ([12, 11, 7], [8, 7]), ([-12, 1, 2], [-12, 1]), ([-12, 1, 3], [-12, 1]), ([-12, 1, 4], [-12, 1]), ([-12, 1, 5], [-12, 1]), ([-12, 1, 6], [-12, 1])], [([-12, 5, 3], [-7, 3]), ([-12, 7, 2], [-3, 2]), ([-12, 1, 1], [-12, 1]), ([12, 11, 7], [8, 7]), ([-12, 3, 4], [-4, 1]), ([-12, 3, 5], [-4, 1]), ([-12, 3, 6], [-4, 1]), ([-12, 3, 7], [-4, 1])], [([-12, 5, 4], [-7, 3]), ([-12, 10, 1], [-1, 1]), ([-12, 1, 1], [-12, 1]), ([12, 11, 7], [8, 7]), ([-12, 5, 7], [-12, 5]), ([-12, 6, 1], [-2, 1]), ([-12, 6, 2], [-2, 1]), ([-12, 6, 3], [-2, 1])], [([-12, 7, 2], [-3, 2]), ([-12, 11, 2], [-1, 1]), ([-12, 1, 1], [-12, 1]), ([12, 11, 7], [8, 7]), ([-12, 8, 3], [-3, 2]), ([-12, 8, 4], [-3, 2]), ([-12, 8, 5], [-3, 2]), ([-12, 8, 6], [-3, 2])], [([-12, 7, 3], [-5, 3]), ([-12, 11, 5], [-1, 1]), ([-12, 1, 1], [-12, 1]), ([12, 11, 7], [8, 7]), ([-12, 10, 6], [-6, 5]), ([-12, 10, 7], [-6, 5]), ([-12, 11, 1], [-1, 1]), ([-12, 11, 2], [-1, 1])]]\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":"0a739db37a315a9f9887a77efddcbc5028c8fa169ce9a6ef4dcbf09cf467dc23","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,B=x;target=Fraction(p,q);candidates=[]\n    for d in range(1,B+1):\n     a=(p*d)//q\n     for n in (a,):\n      r=Fraction(n,d)\n      candidates.append((abs(r-target),r,d))\n    if not candidates:return None\n    best=min(candidates)\n    r=best[1]\n    return [r.numerator,r.denominator]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([-12, 5, 1], [-2, 1]), ([-12, 1, 1], [-12, 1]), ([12, 11, 7], [8, 7]), ([-12, 1, 2], [-12, 1]), ([-12, 1, 3], [-12, 1]), ([-12, 1, 4], [-12, 1]), ([-12, 1, 5], [-12, 1]), ([-12, 1, 6], [-12, 1])], [([-12, 5, 3], [-7, 3]), ([-12, 7, 2], [-3, 2]), ([-12, 1, 1], [-12, 1]), ([12, 11, 7], [8, 7]), ([-12, 3, 4], [-4, 1]), ([-12, 3, 5], [-4, 1]), ([-12, 3, 6], [-4, 1]), ([-12, 3, 7], [-4, 1])], [([-12, 5, 4], [-7, 3]), ([-12, 10, 1], [-1, 1]), ([-12, 1, 1], [-12, 1]), ([12, 11, 7], [8, 7]), ([-12, 5, 7], [-12, 5]), ([-12, 6, 1], [-2, 1]), ([-12, 6, 2], [-2, 1]), ([-12, 6, 3], [-2, 1])], [([-12, 7, 2], [-3, 2]), ([-12, 11, 2], [-1, 1]), ([-12, 1, 1], [-12, 1]), ([12, 11, 7], [8, 7]), ([-12, 8, 3], [-3, 2]), ([-12, 8, 4], [-3, 2]), ([-12, 8, 5], [-3, 2]), ([-12, 8, 6], [-3, 2])], [([-12, 7, 3], [-5, 3]), ([-12, 11, 5], [-1, 1]), ([-12, 1, 1], [-12, 1]), ([12, 11, 7], [8, 7]), ([-12, 10, 6], [-6, 5]), ([-12, 10, 7], [-6, 5]), ([-12, 11, 1], [-1, 1]), ([-12, 11, 2], [-1, 1])]]\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-best-bounded-rational-two-nearest-numerator-candidates","generated_at":"2026-09-29T14:39:22.507819+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.","root_cause":"The two nearest numerator candidates step uses (a,) instead of (a,a+1).","sha256":"b4d9ffb0b661796460f512e76b15647f117d8fb85d526b3fc9a4dd167cd79e9d","title":"Best bounded rational: two nearest numerator candidates · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":41.168,"exit_code":1,"observations":[{"actual":[-3,1],"check":"explicit oracle 0","expected":[-2,1],"passed":false},{"actual":[-12,1],"check":"explicit oracle 1","expected":[-12,1],"passed":true},{"actual":[1,1],"check":"explicit oracle 2","expected":[8,7],"passed":false},{"actual":[-12,1],"check":"explicit oracle 3","expected":[-12,1],"passed":true},{"actual":[-12,1],"check":"explicit oracle 4","expected":[-12,1],"passed":true},{"actual":[-12,1],"check":"explicit oracle 5","expected":[-12,1],"passed":true},{"actual":[-12,1],"check":"explicit oracle 6","expected":[-12,1],"passed":true},{"actual":[-12,1],"check":"explicit oracle 7","expected":[-12,1],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": [-3, 1], \"expected\": [-2, 1], \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": [-12, 1], \"expected\": [-12, 1], \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": [1, 1], \"expected\": [8, 7], \"passed\": false}, {\"check\": \"explicit oracle 3\", \"actual\": [-12, 1], \"expected\": [-12, 1], \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": [-12, 1], \"expected\": [-12, 1], \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": [-12, 1], \"expected\": [-12, 1], \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": [-12, 1], \"expected\": [-12, 1], \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": [-12, 1], \"expected\": [-12, 1], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.044,"exit_code":1,"observations":[{"actual":[-3,1],"check":"explicit oracle 0","expected":[-2,1],"passed":false},{"actual":[-12,1],"check":"explicit oracle 1","expected":[-12,1],"passed":true},{"actual":[1,1],"check":"explicit oracle 2","expected":[8,7],"passed":false},{"actual":[-12,1],"check":"explicit oracle 3","expected":[-12,1],"passed":true},{"actual":[-12,1],"check":"explicit oracle 4","expected":[-12,1],"passed":true},{"actual":[-12,1],"check":"explicit oracle 5","expected":[-12,1],"passed":true},{"actual":[-12,1],"check":"explicit oracle 6","expected":[-12,1],"passed":true},{"actual":[-12,1],"check":"explicit oracle 7","expected":[-12,1],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": [-3, 1], \"expected\": [-2, 1], \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": [-12, 1], \"expected\": [-12, 1], \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": [1, 1], \"expected\": [8, 7], \"passed\": false}, {\"check\": \"explicit oracle 3\", \"actual\": [-12, 1], \"expected\": [-12, 1], \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": [-12, 1], \"expected\": [-12, 1], \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": [-12, 1], \"expected\": [-12, 1], \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": [-12, 1], \"expected\": [-12, 1], \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": [-12, 1], \"expected\": [-12, 1], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}