{"abstract":"The exact best bounded rational result violates the stated contract at denominator bound inclusion.","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 range(2,B+2) still violates the denominator bound inclusion invariant.","family":"s3-numerics-best-bounded-rational-denominator-bound-inclusion","id":"FA-14991","implementations":{"attempt":{"sha256":"ec9ba459a9867ad0679fc8a069f5d8f9c1f3e6c45a8e05737790bfb184395f49","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(2,B+2):\n     a=(p*d)//q\n     for n in (a,a+1):\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, 1, 1], [-12, 1]), ([-12, 5, 1], [-2, 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, 2, 1], [-6, 1]), ([-12, 7, 1], [-2, 1]), ([-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, 3, 1], [-4, 1]), ([-12, 7, 6], [-7, 4]), ([-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, 4, 1], [-3, 1]), ([-12, 9, 2], [-3, 2]), ([-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, 5, 1], [-2, 1]), ([-12, 10, 4], [-5, 4]), ([-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":"24aa6c975157819f53fa9b998da7336de887e2c1ce38a0a6444da000b6f17850","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):\n     a=(p*d)//q\n     for n in (a,a+1):\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, 1, 1], [-12, 1]), ([-12, 5, 1], [-2, 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, 2, 1], [-6, 1]), ([-12, 7, 1], [-2, 1]), ([-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, 3, 1], [-4, 1]), ([-12, 7, 6], [-7, 4]), ([-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, 4, 1], [-3, 1]), ([-12, 9, 2], [-3, 2]), ([-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, 5, 1], [-2, 1]), ([-12, 10, 4], [-5, 4]), ([-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-denominator-bound-inclusion","generated_at":"2026-09-29T14:39:22.470498+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 denominator bound inclusion step uses range(1,B) instead of range(1,B+1).","sha256":"39b69af94144cf2e37ec26364d6be3ef369a88d414767a2f10e2a19d8a23f0e3","title":"Best bounded rational: denominator bound inclusion · 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.458,"exit_code":1,"observations":[{"actual":[-12,1],"check":"explicit oracle 0","expected":[-12,1],"passed":true},{"actual":[-5,2],"check":"explicit oracle 1","expected":[-2,1],"passed":false},{"actual":[9,8],"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\": [-12, 1], \"expected\": [-12, 1], \"passed\": true}, {\"check\": \"explicit oracle 1\", \"actual\": [-5, 2], \"expected\": [-2, 1], \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": [9, 8], \"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":40.212,"exit_code":1,"observations":[{"actual":null,"check":"explicit oracle 0","expected":[-12,1],"passed":false},{"actual":null,"check":"explicit oracle 1","expected":[-2,1],"passed":false},{"actual":[7,6],"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\": null, \"expected\": [-12, 1], \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": null, \"expected\": [-2, 1], \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": [7, 6], \"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."}}