{"abstract":"The exact stern brocot path result violates the stated contract at right 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.","contract_signature":"x","evaluation_group":"s3-numerics-stern-brocot-path","failed_approach":"The partial repair p-q-1 still violates the right residual invariant.","family":"s3-numerics-stern-brocot-path-right-residual","id":"FA-14536","implementations":{"attempt":{"sha256":"ed03c1331f4a0e9d7e55c8504a7df4b93fdd061c6af402fa06e40cbf9a06f607","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-1\n    return ''.join(out)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([2, 1], 'R'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([1, 2], 'L'), ([1, 3], 'LL'), ([1, 4], 'LLL'), ([1, 5], 'LLLL'), ([1, 6], 'LLLLL')], [([2, 3], 'LR'), ([2, 7], 'LLLR'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([1, 18], 'LLLLLLLLLLLLLLLLL'), ([1, 19], 'LLLLLLLLLLLLLLLLLL'), ([1, 20], 'LLLLLLLLLLLLLLLLLLL'), ([1, 21], 'LLLLLLLLLLLLLLLLLLLL')], [([2, 5], 'LLR'), ([2, 13], 'LLLLLLR'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([2, 21], 'LLLLLLLLLLR'), ([2, 23], 'LLLLLLLLLLLR'), ([3, 1], 'RR'), ([3, 2], 'RL')], [([2, 7], 'LLLR'), ([2, 19], 'LLLLLLLLLR'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([3, 23], 'LLLLLLLRL'), ([4, 1], 'RRR'), ([4, 3], 'RLL'), ([4, 5], 'LRRR')], [([2, 9], 'LLLLR'), ([3, 1], 'RR'), ([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":"12f248acb61ba027b0ffdb749218c3db8b3b3a3e3e6b42c82b299592ddb8d083","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 = [[([2, 1], 'R'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([1, 2], 'L'), ([1, 3], 'LL'), ([1, 4], 'LLL'), ([1, 5], 'LLLL'), ([1, 6], 'LLLLL')], [([2, 3], 'LR'), ([2, 7], 'LLLR'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([1, 18], 'LLLLLLLLLLLLLLLLL'), ([1, 19], 'LLLLLLLLLLLLLLLLLL'), ([1, 20], 'LLLLLLLLLLLLLLLLLLL'), ([1, 21], 'LLLLLLLLLLLLLLLLLLLL')], [([2, 5], 'LLR'), ([2, 13], 'LLLLLLR'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([2, 21], 'LLLLLLLLLLR'), ([2, 23], 'LLLLLLLLLLLR'), ([3, 1], 'RR'), ([3, 2], 'RL')], [([2, 7], 'LLLR'), ([2, 19], 'LLLLLLLLLR'), ([1, 1], ''), ([24, 23], 'RLLLLLLLLLLLLLLLLLLLLLL'), ([3, 23], 'LLLLLLLRL'), ([4, 1], 'RRR'), ([4, 3], 'RLL'), ([4, 5], 'LRRR')], [([2, 9], 'LLLLR'), ([3, 1], 'RR'), ([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-right-residual","generated_at":"2026-09-29T14:39:17.818394+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 right residual step uses p%q instead of p-q.","sha256":"26b24a5008cca86126d1e2101d002b2b08ffee8dfe23378067c4b3dc7c247a59","title":"Stern brocot path: right residual · 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.095,"exit_code":1,"observations":[{"actual":"RLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL","check":"explicit oracle 0","expected":"R","passed":false},{"actual":"","check":"explicit oracle 1","expected":"","passed":true},{"actual":"RLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL","check":"explicit oracle 2","expected":"RLLLLLLLLLLLLLLLLLLLLLL","passed":false},{"actual":"L","check":"explicit oracle 3","expected":"L","passed":true},{"actual":"LL","check":"explicit oracle 4","expected":"LL","passed":true},{"actual":"LLL","check":"explicit oracle 5","expected":"LLL","passed":true},{"actual":"LLLL","check":"explicit oracle 6","expected":"LLLL","passed":true},{"actual":"LLLLL","check":"explicit oracle 7","expected":"LLLLL","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": \"RLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL\", \"expected\": \"R\", \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": \"RLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL\", \"expected\": \"RLLLLLLLLLLLLLLLLLLLLLL\", \"passed\": false}, {\"check\": \"explicit oracle 3\", \"actual\": \"L\", \"expected\": \"L\", \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": \"LL\", \"expected\": \"LL\", \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": \"LLL\", \"expected\": \"LLL\", \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": \"LLLL\", \"expected\": \"LLLL\", \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": \"LLLLL\", \"expected\": \"LLLLL\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.582,"exit_code":1,"observations":[{"actual":"RLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL","check":"explicit oracle 0","expected":"R","passed":false},{"actual":"","check":"explicit oracle 1","expected":"","passed":true},{"actual":"RLLLLLLLLLLLLLLLLLLLLLL","check":"explicit oracle 2","expected":"RLLLLLLLLLLLLLLLLLLLLLL","passed":true},{"actual":"L","check":"explicit oracle 3","expected":"L","passed":true},{"actual":"LL","check":"explicit oracle 4","expected":"LL","passed":true},{"actual":"LLL","check":"explicit oracle 5","expected":"LLL","passed":true},{"actual":"LLLL","check":"explicit oracle 6","expected":"LLLL","passed":true},{"actual":"LLLLL","check":"explicit oracle 7","expected":"LLLLL","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": \"RLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL\", \"expected\": \"R\", \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": \"RLLLLLLLLLLLLLLLLLLLLLL\", \"expected\": \"RLLLLLLLLLLLLLLLLLLLLLL\", \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": \"L\", \"expected\": \"L\", \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": \"LL\", \"expected\": \"LL\", \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": \"LLL\", \"expected\": \"LLL\", \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": \"LLLL\", \"expected\": \"LLLL\", \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": \"LLLLL\", \"expected\": \"LLLLL\", \"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."}}