{"abstract":"The exact best bounded rational result violates the stated contract at scaled numerator floor.","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 abs(p*d)//q still violates the scaled numerator floor invariant.","family":"s3-numerics-best-bounded-rational-scaled-numerator-floor","id":"FA-14996","implementations":{"attempt":{"sha256":"4cf13d9ae89039dc14d22291f58f5221748bc1526a87f5912408b418560d856f","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=abs(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, 5, 2], [-5, 2]), ([-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, 1, 4], [-12, 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, 5, 4], [-7, 3]), ([-12, 1, 7], [-12, 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, 5, 5], [-12, 5]), ([-12, 2, 3], [-6, 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, 5, 6], [-12, 5]), ([-12, 2, 6], [-6, 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":"17e4bd657325f6cc9715f1d1906846b0d555db956694e0641b86db959f83b776","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//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, 5, 2], [-5, 2]), ([-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, 1, 4], [-12, 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, 5, 4], [-7, 3]), ([-12, 1, 7], [-12, 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, 5, 5], [-12, 5]), ([-12, 2, 3], [-6, 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, 5, 6], [-12, 5]), ([-12, 2, 6], [-6, 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-scaled-numerator-floor","generated_at":"2026-09-29T14:39:22.474044+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 scaled numerator floor step uses p//q instead of (p*d)//q.","sha256":"85a7408c61d44cf11150d25352b726eb250d66c83c12ea200ac40f9bf7fd2aba","title":"Best bounded rational: scaled numerator floor · 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":42.979,"exit_code":1,"observations":[{"actual":[2,1],"check":"explicit oracle 0","expected":[-5,2],"passed":false},{"actual":[12,1],"check":"explicit oracle 1","expected":[-12,1],"passed":false},{"actual":[8,7],"check":"explicit oracle 2","expected":[8,7],"passed":true},{"actual":[12,1],"check":"explicit oracle 3","expected":[-12,1],"passed":false},{"actual":[12,1],"check":"explicit oracle 4","expected":[-12,1],"passed":false},{"actual":[12,1],"check":"explicit oracle 5","expected":[-12,1],"passed":false},{"actual":[12,1],"check":"explicit oracle 6","expected":[-12,1],"passed":false},{"actual":[12,1],"check":"explicit oracle 7","expected":[-12,1],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": [2, 1], \"expected\": [-5, 2], \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": [12, 1], \"expected\": [-12, 1], \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": [8, 7], \"expected\": [8, 7], \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": [12, 1], \"expected\": [-12, 1], \"passed\": false}, {\"check\": \"explicit oracle 4\", \"actual\": [12, 1], \"expected\": [-12, 1], \"passed\": false}, {\"check\": \"explicit oracle 5\", \"actual\": [12, 1], \"expected\": [-12, 1], \"passed\": false}, {\"check\": \"explicit oracle 6\", \"actual\": [12, 1], \"expected\": [-12, 1], \"passed\": false}, {\"check\": \"explicit oracle 7\", \"actual\": [12, 1], \"expected\": [-12, 1], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.435,"exit_code":1,"observations":[{"actual":[-2,1],"check":"explicit oracle 0","expected":[-5,2],"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\": [-2, 1], \"expected\": [-5, 2], \"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."}}