{"abstract":"The exact stern brocot path result violates the stated contract at left residual.","category":"Numerics","checks":8,"contract":"Input reduced positive [p,q]; return run-expanded L/R path from 1/1. Bounds: 1<=p,q<=24.","evaluation_group":"s3-numerics-stern-brocot-path","failed_approach":"The partial repair q-p-1 still violates the left residual invariant.","family":"s3-numerics-stern-brocot-path-left-residual","id":"FA-14526","implementations":{"attempt":{"sha256":"bd8af4ecf61b9a948de16cc71117803d9e5da27cf8c803668b3be68546b798ea","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(100):\n     if p==q: break\n     if p<q:\n      out.append('L')\n      q=q-p-1\n     else:\n      out.append('R')\n      p=p-q\n    return ''.join(out)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([1, 2], 'L'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([1, 3], 'LL'), ([1, 4], 'LLL'), ([1, 5], 'LLLL'), ([1, 6], 'LLLLL'), ([1, 7], 'LLLLLL')], [([1, 3], 'LL'), ([1, 5], 'LLLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([1, 18], 'LLLLLLLLLLLLLLLLL'), ([1, 19], 'LLLLLLLLLLLLLLLLLL'), ([1, 20], 'LLLLLLLLLLLLLLLLLLL'), ([1, 21], 'LLLLLLLLLLLLLLLLLLLL')], [([1, 4], 'LLL'), ([1, 8], 'LLLLLLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([2, 21], 'LLLLLLLLLLR'), ([2, 23], 'LLLLLLLLLLLR'), ([3, 1], 'RR'), ([3, 2], 'RL')], [([1, 5], 'LLLL'), ([1, 11], 'LLLLLLLLLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([3, 23], 'LLLLLLLRL'), ([4, 1], 'RRR'), ([4, 3], 'RLL'), ([4, 5], 'LRRR')], [([1, 6], 'LLLLL'), ([1, 14], 'LLLLLLLLLLLLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([5, 6], 'LRRRR'), ([5, 7], 'LRRL'), ([5, 8], 'LRLR'), ([5, 9], 'LRLLL')]]\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":"07b5732c7dfbeea114a62179b3835faaa3bcf282175f24d23b3b8d5f8944fe9f","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(100):\n     if p==q: break\n     if p<q:\n      out.append('L')\n      q=q%p\n     else:\n      out.append('R')\n      p=p-q\n    return ''.join(out)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([1, 2], 'L'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([1, 3], 'LL'), ([1, 4], 'LLL'), ([1, 5], 'LLLL'), ([1, 6], 'LLLLL'), ([1, 7], 'LLLLLL')], [([1, 3], 'LL'), ([1, 5], 'LLLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([1, 18], 'LLLLLLLLLLLLLLLLL'), ([1, 19], 'LLLLLLLLLLLLLLLLLL'), ([1, 20], 'LLLLLLLLLLLLLLLLLLL'), ([1, 21], 'LLLLLLLLLLLLLLLLLLLL')], [([1, 4], 'LLL'), ([1, 8], 'LLLLLLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([2, 21], 'LLLLLLLLLLR'), ([2, 23], 'LLLLLLLLLLLR'), ([3, 1], 'RR'), ([3, 2], 'RL')], [([1, 5], 'LLLL'), ([1, 11], 'LLLLLLLLLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([3, 23], 'LLLLLLLRL'), ([4, 1], 'RRR'), ([4, 3], 'RLL'), ([4, 5], 'LRRR')], [([1, 6], 'LLLLL'), ([1, 14], 'LLLLLLLLLLLLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([5, 6], 'LRRRR'), ([5, 7], 'LRRL'), ([5, 8], 'LRLR'), ([5, 9], 'LRLLL')]]\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":"046af283613ae17e6dee39cec8bd528a022cb4eb3129b56c3b7720e18f3353e5","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(100):\n     if p==q: break\n     if p<q:\n      out.append('L')\n      q=q-p\n     else:\n      out.append('R')\n      p=p-q\n    return ''.join(out)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([1, 2], 'L'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([1, 3], 'LL'), ([1, 4], 'LLL'), ([1, 5], 'LLLL'), ([1, 6], 'LLLLL'), ([1, 7], 'LLLLLL')], [([1, 3], 'LL'), ([1, 5], 'LLLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([1, 18], 'LLLLLLLLLLLLLLLLL'), ([1, 19], 'LLLLLLLLLLLLLLLLLL'), ([1, 20], 'LLLLLLLLLLLLLLLLLLL'), ([1, 21], 'LLLLLLLLLLLLLLLLLLLL')], [([1, 4], 'LLL'), ([1, 8], 'LLLLLLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([2, 21], 'LLLLLLLLLLR'), ([2, 23], 'LLLLLLLLLLLR'), ([3, 1], 'RR'), ([3, 2], 'RL')], [([1, 5], 'LLLL'), ([1, 11], 'LLLLLLLLLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([3, 23], 'LLLLLLLRL'), ([4, 1], 'RRR'), ([4, 3], 'RLL'), ([4, 5], 'LRRR')], [([1, 6], 'LLLLL'), ([1, 14], 'LLLLLLLLLLLLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([5, 6], 'LRRRR'), ([5, 7], 'LRRL'), ([5, 8], 'LRLR'), ([5, 9], 'LRLLL')]]\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-stern-brocot-path-left-residual","generated_at":"2026-09-29T14:39:17.815557+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 q-p at the left residual step.","root_cause":"The left residual step uses q%p instead of q-p.","sha256":"fa44c770da4ca108e3fffef05e642c47bb43186ed384195126a56cdc60928545","title":"Stern brocot path: left residual · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.557,"exit_code":1,"observations":[{"actual":"LRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR","check":"explicit oracle 0","expected":"L","passed":false},{"actual":"","check":"explicit oracle 1","expected":"","passed":true},{"actual":"RLLLLLLLLLLL","check":"explicit oracle 2","expected":"RLLLLLLLLLLLLLLLLLLLLLL","passed":false},{"actual":"L","check":"explicit oracle 3","expected":"LL","passed":false},{"actual":"LLRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR","check":"explicit oracle 4","expected":"LLL","passed":false},{"actual":"LL","check":"explicit oracle 5","expected":"LLLL","passed":false},{"actual":"LLLRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR","check":"explicit oracle 6","expected":"LLLLL","passed":false},{"actual":"LLL","check":"explicit oracle 7","expected":"LLLLLL","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": \"LRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\", \"expected\": \"L\", \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": \"RLLLLLLLLLLL\", \"expected\": \"RLLLLLLLLLLLLLLLLLLLLLL\", \"passed\": false}, {\"check\": \"explicit oracle 3\", \"actual\": \"L\", \"expected\": \"LL\", \"passed\": false}, {\"check\": \"explicit oracle 4\", \"actual\": \"LLRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\", \"expected\": \"LLL\", \"passed\": false}, {\"check\": \"explicit oracle 5\", \"actual\": \"LL\", \"expected\": \"LLLL\", \"passed\": false}, {\"check\": \"explicit oracle 6\", \"actual\": \"LLLRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\", \"expected\": \"LLLLL\", \"passed\": false}, {\"check\": \"explicit oracle 7\", \"actual\": \"LLL\", \"expected\": \"LLLLLL\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.161,"exit_code":1,"observations":[{"actual":"LRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR","check":"explicit oracle 0","expected":"L","passed":false},{"actual":"","check":"explicit oracle 1","expected":"","passed":true},{"actual":"RLRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR","check":"explicit oracle 2","expected":"RLLLLLLLLLLLLLLLLLLLLLL","passed":false},{"actual":"LRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR","check":"explicit oracle 3","expected":"LL","passed":false},{"actual":"LRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR","check":"explicit oracle 4","expected":"LLL","passed":false},{"actual":"LRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR","check":"explicit oracle 5","expected":"LLLL","passed":false},{"actual":"LRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR","check":"explicit oracle 6","expected":"LLLLL","passed":false},{"actual":"LRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR","check":"explicit oracle 7","expected":"LLLLLL","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": \"LRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\", \"expected\": \"L\", \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": \"RLRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\", \"expected\": \"RLLLLLLLLLLLLLLLLLLLLLL\", \"passed\": false}, {\"check\": \"explicit oracle 3\", \"actual\": \"LRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\", \"expected\": \"LL\", \"passed\": false}, {\"check\": \"explicit oracle 4\", \"actual\": \"LRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\", \"expected\": \"LLL\", \"passed\": false}, {\"check\": \"explicit oracle 5\", \"actual\": \"LRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\", \"expected\": \"LLLL\", \"passed\": false}, {\"check\": \"explicit oracle 6\", \"actual\": \"LRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\", \"expected\": \"LLLLL\", \"passed\": false}, {\"check\": \"explicit oracle 7\", \"actual\": \"LRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\", \"expected\": \"LLLLLL\", \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.662,"exit_code":0,"observations":[{"actual":"L","check":"explicit oracle 0","expected":"L","passed":true},{"actual":"","check":"explicit oracle 1","expected":"","passed":true},{"actual":"RLLLLLLLLLLLLLLLLLLLLLL","check":"explicit oracle 2","expected":"RLLLLLLLLLLLLLLLLLLLLLL","passed":true},{"actual":"LL","check":"explicit oracle 3","expected":"LL","passed":true},{"actual":"LLL","check":"explicit oracle 4","expected":"LLL","passed":true},{"actual":"LLLL","check":"explicit oracle 5","expected":"LLLL","passed":true},{"actual":"LLLLL","check":"explicit oracle 6","expected":"LLLLL","passed":true},{"actual":"LLLLLL","check":"explicit oracle 7","expected":"LLLLLL","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": \"L\", \"expected\": \"L\", \"passed\": true}, {\"check\": \"explicit oracle 1\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": \"RLLLLLLLLLLLLLLLLLLLLLL\", \"expected\": \"RLLLLLLLLLLLLLLLLLLLLLL\", \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": \"LL\", \"expected\": \"LL\", \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": \"LLL\", \"expected\": \"LLL\", \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": \"LLLL\", \"expected\": \"LLLL\", \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": \"LLLLL\", \"expected\": \"LLLLL\", \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": \"LLLLLL\", \"expected\": \"LLLLLL\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}