{"abstract":"The exact stern brocot path result violates the stated contract at root termination.","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 p==1 and q==1 and len(out)>0 still violates the root termination invariant.","family":"s3-numerics-stern-brocot-path-root-termination","id":"FA-14516","implementations":{"attempt":{"sha256":"1de9c9b036216d357e3f50d701e3b4ae1d7273d72e8ed77aa04f66b0d52a0113","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==1 and q==1 and len(out)>0: 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, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([1, 18], 'LLLLLLLLLLLLLLLLL'), ([1, 19], 'LLLLLLLLLLLLLLLLLL'), ([1, 20], 'LLLLLLLLLLLLLLLLLLL'), ([1, 21], 'LLLLLLLLLLLLLLLLLLLL'), ([1, 22], 'LLLLLLLLLLLLLLLLLLLLL')], [([1, 4], 'LLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([2, 21], 'LLLLLLLLLLR'), ([2, 23], 'LLLLLLLLLLLR'), ([3, 1], 'RR'), ([3, 2], 'RL'), ([3, 4], 'LRR')], [([1, 5], 'LLLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([3, 23], 'LLLLLLLRL'), ([4, 1], 'RRR'), ([4, 3], 'RLL'), ([4, 5], 'LRRR'), ([4, 7], 'LRLL')], [([1, 6], 'LLLLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([5, 6], 'LRRRR'), ([5, 7], 'LRRL'), ([5, 8], 'LRLR'), ([5, 9], 'LRLLL'), ([5, 11], 'LLRRRR')]]\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":"33a82428f8e39e0ab85eb56fd7d22ff381cd7bd2da8d628c8ea655473f19d3b5","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==1 or q==1: 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, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([1, 18], 'LLLLLLLLLLLLLLLLL'), ([1, 19], 'LLLLLLLLLLLLLLLLLL'), ([1, 20], 'LLLLLLLLLLLLLLLLLLL'), ([1, 21], 'LLLLLLLLLLLLLLLLLLLL'), ([1, 22], 'LLLLLLLLLLLLLLLLLLLLL')], [([1, 4], 'LLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([2, 21], 'LLLLLLLLLLR'), ([2, 23], 'LLLLLLLLLLLR'), ([3, 1], 'RR'), ([3, 2], 'RL'), ([3, 4], 'LRR')], [([1, 5], 'LLLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([3, 23], 'LLLLLLLRL'), ([4, 1], 'RRR'), ([4, 3], 'RLL'), ([4, 5], 'LRRR'), ([4, 7], 'LRLL')], [([1, 6], 'LLLLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([5, 6], 'LRRRR'), ([5, 7], 'LRRL'), ([5, 8], 'LRLR'), ([5, 9], 'LRLLL'), ([5, 11], 'LLRRRR')]]\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":"84bb3c89ea808859befa9e960bb49c6622392d1f3e5c5789d095bcf13241caa6","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, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([1, 18], 'LLLLLLLLLLLLLLLLL'), ([1, 19], 'LLLLLLLLLLLLLLLLLL'), ([1, 20], 'LLLLLLLLLLLLLLLLLLL'), ([1, 21], 'LLLLLLLLLLLLLLLLLLLL'), ([1, 22], 'LLLLLLLLLLLLLLLLLLLLL')], [([1, 4], 'LLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([2, 21], 'LLLLLLLLLLR'), ([2, 23], 'LLLLLLLLLLLR'), ([3, 1], 'RR'), ([3, 2], 'RL'), ([3, 4], 'LRR')], [([1, 5], 'LLLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([3, 23], 'LLLLLLLRL'), ([4, 1], 'RRR'), ([4, 3], 'RLL'), ([4, 5], 'LRRR'), ([4, 7], 'LRLL')], [([1, 6], 'LLLLL'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([5, 6], 'LRRRR'), ([5, 7], 'LRRL'), ([5, 8], 'LRLR'), ([5, 9], 'LRLLL'), ([5, 11], 'LLRRRR')]]\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-root-termination","generated_at":"2026-09-29T14:39:17.730664+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 root termination step.","root_cause":"The root termination step uses p==1 or q==1 instead of p==q.","sha256":"f2a2fe32b7d8a1399d715708811e8b064afe7cf022ebcbe252ad2262649c5bff","title":"Stern brocot path: root termination · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":46.622,"exit_code":1,"observations":[{"actual":"L","check":"explicit oracle 0","expected":"L","passed":true},{"actual":"RLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL","check":"explicit oracle 1","expected":"","passed":false},{"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":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": \"L\", \"expected\": \"L\", \"passed\": true}, {\"check\": \"explicit oracle 1\", \"actual\": \"RLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL\", \"expected\": \"\", \"passed\": false}, {\"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\": false}\n"},"broken":{"elapsed_ms":46.291,"exit_code":1,"observations":[{"actual":"","check":"explicit oracle 0","expected":"L","passed":false},{"actual":"","check":"explicit oracle 1","expected":"","passed":true},{"actual":"R","check":"explicit oracle 2","expected":"RLLLLLLLLLLLLLLLLLLLLLL","passed":false},{"actual":"","check":"explicit oracle 3","expected":"LL","passed":false},{"actual":"","check":"explicit oracle 4","expected":"LLL","passed":false},{"actual":"","check":"explicit oracle 5","expected":"LLLL","passed":false},{"actual":"","check":"explicit oracle 6","expected":"LLLLL","passed":false},{"actual":"","check":"explicit oracle 7","expected":"LLLLLL","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": \"\", \"expected\": \"L\", \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": \"R\", \"expected\": \"RLLLLLLLLLLLLLLLLLLLLLL\", \"passed\": false}, {\"check\": \"explicit oracle 3\", \"actual\": \"\", \"expected\": \"LL\", \"passed\": false}, {\"check\": \"explicit oracle 4\", \"actual\": \"\", \"expected\": \"LLL\", \"passed\": false}, {\"check\": \"explicit oracle 5\", \"actual\": \"\", \"expected\": \"LLLL\", \"passed\": false}, {\"check\": \"explicit oracle 6\", \"actual\": \"\", \"expected\": \"LLLLL\", \"passed\": false}, {\"check\": \"explicit oracle 7\", \"actual\": \"\", \"expected\": \"LLLLLL\", \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.88,"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"}