{"abstract":"The exact dyck word ranking result violates the stated contract at closing depth update.","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.","contract_signature":"x","evaluation_group":"s3-numerics-dyck-word-ranking","failed_approach":"The partial repair o+1 still violates the closing depth update invariant.","family":"s3-numerics-dyck-word-ranking-closing-depth-update","id":"FA-15201","implementations":{"attempt":{"sha256":"9d1675a567882579d60ff50780ee0066aae081a30cc0aec988356cf6fb80c47f","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=o+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 = [[('(())(())', 7), ('()', 0), ('()()()()()', 41), ('(())', 0), ('()()', 1), ('((()))', 0), ('(()())', 1), ('(())()', 2)], [('(())()()', 8), ('()()()()', 13), ('()', 0), ('()()()()()', 41), ('()((()))', 9), ('()(()())', 10), ('()(())()', 11), ('()()(())', 12)], [('()()(())', 12), ('((())())()', 11), ('()', 0), ('()()()()()', 41), ('((()))(())', 12), ('((()))()()', 13), ('(()((())))', 14), ('(()(()()))', 15)], [('()()()()', 13), ('(()()(()))', 18), ('()', 0), ('()()()()()', 41), ('()((()()))', 29), ('()((())())', 30), ('()((()))()', 31), ('()(()(()))', 32)], [('((())(()))', 9), ('(()())(())', 21), ('()', 0), ('()()()()()', 41), ('(()())', 1), ('(())()', 2), ('()(())', 3), ('()()()', 4)]]\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":"ff7eb206349da1a03c9f07cbd14265b57bd4377b31a74614ea642d0e7111ffd0","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\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 = [[('(())(())', 7), ('()', 0), ('()()()()()', 41), ('(())', 0), ('()()', 1), ('((()))', 0), ('(()())', 1), ('(())()', 2)], [('(())()()', 8), ('()()()()', 13), ('()', 0), ('()()()()()', 41), ('()((()))', 9), ('()(()())', 10), ('()(())()', 11), ('()()(())', 12)], [('()()(())', 12), ('((())())()', 11), ('()', 0), ('()()()()()', 41), ('((()))(())', 12), ('((()))()()', 13), ('(()((())))', 14), ('(()(()()))', 15)], [('()()()()', 13), ('(()()(()))', 18), ('()', 0), ('()()()()()', 41), ('()((()()))', 29), ('()((())())', 30), ('()((()))()', 31), ('()(()(()))', 32)], [('((())(()))', 9), ('(()())(())', 21), ('()', 0), ('()()()()()', 41), ('(()())', 1), ('(())()', 2), ('()(())', 3), ('()()()', 4)]]\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-closing-depth-update","generated_at":"2026-09-29T14:39:24.532509+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 closing depth update step uses c instead of c+1.","sha256":"d1a0c6954cc53a1dca7993e45d9b49814c8ef809dee59c4f07ebe317e8f0d256","title":"Dyck word ranking: closing depth update · 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":43.263,"exit_code":1,"observations":[{"actual":5,"check":"explicit oracle 0","expected":7,"passed":false},{"actual":0,"check":"explicit oracle 1","expected":0,"passed":true},{"actual":36,"check":"explicit oracle 2","expected":41,"passed":false},{"actual":0,"check":"explicit oracle 3","expected":0,"passed":true},{"actual":1,"check":"explicit oracle 4","expected":1,"passed":true},{"actual":0,"check":"explicit oracle 5","expected":0,"passed":true},{"actual":1,"check":"explicit oracle 6","expected":1,"passed":true},{"actual":2,"check":"explicit oracle 7","expected":2,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": 5, \"expected\": 7, \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": 36, \"expected\": 41, \"passed\": false}, {\"check\": \"explicit oracle 3\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": 2, \"expected\": 2, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.548,"exit_code":1,"observations":[{"actual":8,"check":"explicit oracle 0","expected":7,"passed":false},{"actual":0,"check":"explicit oracle 1","expected":0,"passed":true},{"actual":48,"check":"explicit oracle 2","expected":41,"passed":false},{"actual":0,"check":"explicit oracle 3","expected":0,"passed":true},{"actual":1,"check":"explicit oracle 4","expected":1,"passed":true},{"actual":0,"check":"explicit oracle 5","expected":0,"passed":true},{"actual":1,"check":"explicit oracle 6","expected":1,"passed":true},{"actual":2,"check":"explicit oracle 7","expected":2,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": 8, \"expected\": 7, \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": 48, \"expected\": 41, \"passed\": false}, {\"check\": \"explicit oracle 3\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": 2, \"expected\": 2, \"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."}}