{"abstract":"The exact dyck word ranking result violates the stated contract at balanced word rank origin.","category":"Numerics","checks":8,"contract":"Input balanced parentheses word with every prefix nonnegative; return zero-based lexicographic rank where opening precedes closing. Bounds: at most five opening parentheses.","evaluation_group":"s3-numerics-dyck-word-ranking","failed_approach":"The partial repair max(0,r-1) still violates the balanced word rank origin invariant.","family":"s3-numerics-dyck-word-ranking-balanced-word-rank-origin","id":"FA-15211","implementations":{"attempt":{"sha256":"9765a95814dc78028a1728bb538550543c29316306312e90778bc1053597e1b3","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    word=x;n=len(word)//2\n    from functools import lru_cache\n    @lru_cache(None)\n    def count(o,c):\n     if c>o or o>n:return 0\n     if o==n and c==n:return 1\n     return (count(o+1,c) if o<n else 0)+(count(o,c+1) if c<o else 0)\n    r=0;o=c=0\n    for ch in word:\n     if ch==')':\n      r+=count(o+1,c)\n      c=c+1\n     else:o=o+1\n    return max(0,r-1)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('()', 0), ('()()', 1), ('()()()()()', 41), ('(())', 0), ('((()))', 0), ('(()())', 1), ('(())()', 2), ('()(())', 3)], [('(())', 0), ('()(())', 3), ('()', 0), ('()()()()()', 41), ('()((()))', 9), ('()(()())', 10), ('()(())()', 11), ('()()(())', 12)], [('()()', 1), ('((())())', 2), ('()', 0), ('()()()()()', 41), ('((()))(())', 12), ('((()))()()', 13), ('(()((())))', 14), ('(()(()()))', 15)], [('((()))', 0), ('(()()())', 5), ('()', 0), ('()()()()()', 41), ('()((()()))', 29), ('()((())())', 30), ('()((()))()', 31), ('()(()(()))', 32)], [('(()())', 1), ('(())()()', 8), ('()', 0), ('()()()()()', 41), ('(())()', 2), ('()(())', 3), ('()()()', 4), ('(((())))', 0)]]\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":"334760c7068180ddff82effa752d73e7356c410ae0c852b2dcaa79d48758b983","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    word=x;n=len(word)//2\n    from functools import lru_cache\n    @lru_cache(None)\n    def count(o,c):\n     if c>o or o>n:return 0\n     if o==n and c==n:return 1\n     return (count(o+1,c) if o<n else 0)+(count(o,c+1) if c<o else 0)\n    r=0;o=c=0\n    for ch in word:\n     if ch==')':\n      r+=count(o+1,c)\n      c=c+1\n     else:o=o+1\n    return r+1\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('()', 0), ('()()', 1), ('()()()()()', 41), ('(())', 0), ('((()))', 0), ('(()())', 1), ('(())()', 2), ('()(())', 3)], [('(())', 0), ('()(())', 3), ('()', 0), ('()()()()()', 41), ('()((()))', 9), ('()(()())', 10), ('()(())()', 11), ('()()(())', 12)], [('()()', 1), ('((())())', 2), ('()', 0), ('()()()()()', 41), ('((()))(())', 12), ('((()))()()', 13), ('(()((())))', 14), ('(()(()()))', 15)], [('((()))', 0), ('(()()())', 5), ('()', 0), ('()()()()()', 41), ('()((()()))', 29), ('()((())())', 30), ('()((()))()', 31), ('()(()(()))', 32)], [('(()())', 1), ('(())()()', 8), ('()', 0), ('()()()()()', 41), ('(())()', 2), ('()(())', 3), ('()()()', 4), ('(((())))', 0)]]\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":"185802b867dfbba9c97333fab66e51024c8382d09b8395f555dc090d4c71ef66","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    word=x;n=len(word)//2\n    from functools import lru_cache\n    @lru_cache(None)\n    def count(o,c):\n     if c>o or o>n:return 0\n     if o==n and c==n:return 1\n     return (count(o+1,c) if o<n else 0)+(count(o,c+1) if c<o else 0)\n    r=0;o=c=0\n    for ch in word:\n     if ch==')':\n      r+=count(o+1,c)\n      c=c+1\n     else:o=o+1\n    return r\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('()', 0), ('()()', 1), ('()()()()()', 41), ('(())', 0), ('((()))', 0), ('(()())', 1), ('(())()', 2), ('()(())', 3)], [('(())', 0), ('()(())', 3), ('()', 0), ('()()()()()', 41), ('()((()))', 9), ('()(()())', 10), ('()(())()', 11), ('()()(())', 12)], [('()()', 1), ('((())())', 2), ('()', 0), ('()()()()()', 41), ('((()))(())', 12), ('((()))()()', 13), ('(()((())))', 14), ('(()(()()))', 15)], [('((()))', 0), ('(()()())', 5), ('()', 0), ('()()()()()', 41), ('()((()()))', 29), ('()((())())', 30), ('()((()))()', 31), ('()(()(()))', 32)], [('(()())', 1), ('(())()()', 8), ('()', 0), ('()()()()()', 41), ('(())()', 2), ('()(())', 3), ('()()()', 4), ('(((())))', 0)]]\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-dyck-word-ranking-balanced-word-rank-origin","generated_at":"2026-09-29T14:39:24.564516+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 r at the balanced word rank origin step.","root_cause":"The balanced word rank origin step uses r+1 instead of r.","sha256":"e602a064848e3ba10616974aef7d42ab894ebb3a20f450b536e92b8deb71730c","title":"Dyck word ranking: balanced word rank origin · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.718,"exit_code":1,"observations":[{"actual":0,"check":"explicit oracle 0","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 1","expected":1,"passed":false},{"actual":40,"check":"explicit oracle 2","expected":41,"passed":false},{"actual":0,"check":"explicit oracle 3","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 4","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 5","expected":1,"passed":false},{"actual":1,"check":"explicit oracle 6","expected":2,"passed":false},{"actual":2,"check":"explicit oracle 7","expected":3,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 1\", \"actual\": 0, \"expected\": 1, \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": 40, \"expected\": 41, \"passed\": false}, {\"check\": \"explicit oracle 3\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": 0, \"expected\": 1, \"passed\": false}, {\"check\": \"explicit oracle 6\", \"actual\": 1, \"expected\": 2, \"passed\": false}, {\"check\": \"explicit oracle 7\", \"actual\": 2, \"expected\": 3, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.653,"exit_code":1,"observations":[{"actual":1,"check":"explicit oracle 0","expected":0,"passed":false},{"actual":2,"check":"explicit oracle 1","expected":1,"passed":false},{"actual":42,"check":"explicit oracle 2","expected":41,"passed":false},{"actual":1,"check":"explicit oracle 3","expected":0,"passed":false},{"actual":1,"check":"explicit oracle 4","expected":0,"passed":false},{"actual":2,"check":"explicit oracle 5","expected":1,"passed":false},{"actual":3,"check":"explicit oracle 6","expected":2,"passed":false},{"actual":4,"check":"explicit oracle 7","expected":3,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": 1, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": 2, \"expected\": 1, \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": 42, \"expected\": 41, \"passed\": false}, {\"check\": \"explicit oracle 3\", \"actual\": 1, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 4\", \"actual\": 1, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 5\", \"actual\": 2, \"expected\": 1, \"passed\": false}, {\"check\": \"explicit oracle 6\", \"actual\": 3, \"expected\": 2, \"passed\": false}, {\"check\": \"explicit oracle 7\", \"actual\": 4, \"expected\": 3, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":45.445,"exit_code":0,"observations":[{"actual":0,"check":"explicit oracle 0","expected":0,"passed":true},{"actual":1,"check":"explicit oracle 1","expected":1,"passed":true},{"actual":41,"check":"explicit oracle 2","expected":41,"passed":true},{"actual":0,"check":"explicit oracle 3","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 4","expected":0,"passed":true},{"actual":1,"check":"explicit oracle 5","expected":1,"passed":true},{"actual":2,"check":"explicit oracle 6","expected":2,"passed":true},{"actual":3,"check":"explicit oracle 7","expected":3,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 1\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": 41, \"expected\": 41, \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": 3, \"expected\": 3, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}