{"abstract":"The exact dyck word ranking result violates the stated contract at skipped opening subtree.","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 count(o,c) still violates the skipped opening subtree invariant.","family":"s3-numerics-dyck-word-ranking-skipped-opening-subtree","id":"FA-15196","implementations":{"attempt":{"sha256":"1ee50d1916428346c3d4c5f70dc2a37c4233094c46f87a6930238b5bf47f4656","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,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), ('()()()()()', 41), ('(())', 0), ('()()', 1), ('((()))', 0), ('(()())', 1), ('(())()', 2), ('()(())', 3)], [('(())', 0), ('((()))', 0), ('()', 0), ('()()()()()', 41), ('()((()))', 9), ('()(()())', 10), ('()(())()', 11), ('()()(())', 12)], [('()()', 1), ('()(())', 3), ('()', 0), ('()()()()()', 41), ('((()))(())', 12), ('((()))()()', 13), ('(()((())))', 14), ('(()(()()))', 15)], [('((()))', 0), ('((()()))', 1), ('()', 0), ('()()()()()', 41), ('()((()()))', 29), ('()((())())', 30), ('()((()))()', 31), ('()(()(()))', 32)], [('(()())', 1), ('(()(()))', 4), ('()', 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":"c20de48cac46e20c5a5870a89aff9e2cf174fcdcf57a97b672a6f9d6f842e575","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,c+1)\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), ('()()()()()', 41), ('(())', 0), ('()()', 1), ('((()))', 0), ('(()())', 1), ('(())()', 2), ('()(())', 3)], [('(())', 0), ('((()))', 0), ('()', 0), ('()()()()()', 41), ('()((()))', 9), ('()(()())', 10), ('()(())()', 11), ('()()(())', 12)], [('()()', 1), ('()(())', 3), ('()', 0), ('()()()()()', 41), ('((()))(())', 12), ('((()))()()', 13), ('(()((())))', 14), ('(()(()()))', 15)], [('((()))', 0), ('((()()))', 1), ('()', 0), ('()()()()()', 41), ('()((()()))', 29), ('()((())())', 30), ('()((()))()', 31), ('()(()(()))', 32)], [('(()())', 1), ('(()(()))', 4), ('()', 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":"ab4d8a4c887bc13cea3edda5e7b43f48b04fb2534f85bc36cff6d757e3885a6e","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), ('()()()()()', 41), ('(())', 0), ('()()', 1), ('((()))', 0), ('(()())', 1), ('(())()', 2), ('()(())', 3)], [('(())', 0), ('((()))', 0), ('()', 0), ('()()()()()', 41), ('()((()))', 9), ('()(()())', 10), ('()(())()', 11), ('()()(())', 12)], [('()()', 1), ('()(())', 3), ('()', 0), ('()()()()()', 41), ('((()))(())', 12), ('((()))()()', 13), ('(()((())))', 14), ('(()(()()))', 15)], [('((()))', 0), ('((()()))', 1), ('()', 0), ('()()()()()', 41), ('()((()()))', 29), ('()((())())', 30), ('()((()))()', 31), ('()(()(()))', 32)], [('(()())', 1), ('(()(()))', 4), ('()', 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-skipped-opening-subtree","generated_at":"2026-09-29T14:39:24.346536+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 count(o+1,c) at the skipped opening subtree step.","root_cause":"The skipped opening subtree step uses count(o,c+1) instead of count(o+1,c).","sha256":"11ae488e94f1084d76c18ac3687ad41220d3c35a4a181f7ac451225b1e067f21","title":"Dyck word ranking: skipped opening subtree · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":44.386,"exit_code":1,"observations":[{"actual":1,"check":"explicit oracle 0","expected":0,"passed":false},{"actual":64,"check":"explicit oracle 1","expected":41,"passed":false},{"actual":2,"check":"explicit oracle 2","expected":0,"passed":false},{"actual":3,"check":"explicit oracle 3","expected":1,"passed":false},{"actual":3,"check":"explicit oracle 4","expected":0,"passed":false},{"actual":5,"check":"explicit oracle 5","expected":1,"passed":false},{"actual":6,"check":"explicit oracle 6","expected":2,"passed":false},{"actual":7,"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\": 64, \"expected\": 41, \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": 2, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 3\", \"actual\": 3, \"expected\": 1, \"passed\": false}, {\"check\": \"explicit oracle 4\", \"actual\": 3, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 5\", \"actual\": 5, \"expected\": 1, \"passed\": false}, {\"check\": \"explicit oracle 6\", \"actual\": 6, \"expected\": 2, \"passed\": false}, {\"check\": \"explicit oracle 7\", \"actual\": 7, \"expected\": 3, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.986,"exit_code":1,"observations":[{"actual":1,"check":"explicit oracle 0","expected":0,"passed":false},{"actual":23,"check":"explicit oracle 1","expected":41,"passed":false},{"actual":2,"check":"explicit oracle 2","expected":0,"passed":false},{"actual":2,"check":"explicit oracle 3","expected":1,"passed":false},{"actual":3,"check":"explicit oracle 4","expected":0,"passed":false},{"actual":4,"check":"explicit oracle 5","expected":1,"passed":false},{"actual":4,"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\": 23, \"expected\": 41, \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": 2, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 3\", \"actual\": 2, \"expected\": 1, \"passed\": false}, {\"check\": \"explicit oracle 4\", \"actual\": 3, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 5\", \"actual\": 4, \"expected\": 1, \"passed\": false}, {\"check\": \"explicit oracle 6\", \"actual\": 4, \"expected\": 2, \"passed\": false}, {\"check\": \"explicit oracle 7\", \"actual\": 4, \"expected\": 3, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.545,"exit_code":0,"observations":[{"actual":0,"check":"explicit oracle 0","expected":0,"passed":true},{"actual":41,"check":"explicit oracle 1","expected":41,"passed":true},{"actual":0,"check":"explicit oracle 2","expected":0,"passed":true},{"actual":1,"check":"explicit oracle 3","expected":1,"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\": 41, \"expected\": 41, \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": 1, \"expected\": 1, \"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"}