{"abstract":"Chains in atari appear to have several liberties.","category":"Go territory scoring","checks":8,"contract":"Input [board, row, col]. Return [colour, chain_size, distinct_orthogonal_empty_liberties]; an empty point gives [\".\", 0, 0].","contract_signature":"x","evaluation_group":"w2-go-territory-scoring-chain-liberties","failed_approach":"Counting just one diagonal direction still inflates liberties.","family":"w2-go-territory-scoring-chain-liberties-diagonal-liberties","id":"FA-83091","implementations":{"attempt":{"sha256":"72e56e7ac55eb77eba181baef17c9a814cacddc5ed6c2cad1d6d96b8f7e53284","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    board, r, c = x\n    n = len(board)\n    m = len(board[0])\n    col = board[r][c]\n    if col == '.':\n        return ['.', 0, 0]\n    chain = [(r, c)]\n    k = 0\n    while k < len(chain):\n        i, j = chain[k]\n        k += 1\n        for p, q in ((i + 1, j), (i - 1, j), (i, j + 1), (i, j - 1)):\n            if 0 <= p < n and 0 <= q < m and board[p][q] == col and (p, q) not in chain:\n                chain.append((p, q))\n    libs = set()\n    for i, j in chain:\n        for p, q in ((i, j - 1), (i, j + 1), (i - 1, j), (i + 1, j), (i + 1, j + 1), (i - 1, j - 1)):\n            if 0 <= p < n and 0 <= q < m and board[p][q] == '.':\n                libs.add((p, q))\n    return [col, len(chain), len(libs)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[['B..W', 'B..W', 'B..W', 'B..W'], 3, 0], ['B', 4, 4]], [[['B..W', 'B..W', 'B..W', 'B..W'], 3, 3], ['W', 4, 4]], [[['B..W', 'B..W', 'B..W', 'B..W'], 3, 2], ['.', 0, 0]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 3, 2], ['W', 4, 4]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 3, 1], ['B', 4, 4]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 1, 1], ['B', 4, 4]], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 2, 2], ['B', 1, 2]], [[['B.W', '...', 'W.B'], 2, 2], ['B', 1, 2]]], [[[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 3, 3], ['W', 6, 4]], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 3, 1], ['W', 6, 4]], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 1, 2], ['B', 7, 6]], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 1, 1], ['.', 0, 0]], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 1, 1], ['B', 1, 4]], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 2, 2], ['B', 1, 2]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 2, 1], ['W', 1, 2]], [[['.....', '.BBB.', '.B.B.', '.BBB.', '.....'], 3, 3], ['B', 8, 13]]], [[[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 4, 3], ['.', 0, 0]], [[['W....', '.....', '.....', '.....', '....B'], 4, 4], ['B', 1, 2]], [[['W....', '.....', '.....', '.....', '....B'], 0, 0], ['W', 1, 2]], [[['W....', '.....', '.....', '.....', '....B'], 1, 0], ['.', 0, 0]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 2, 1], ['W', 1, 2]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 4, 0], ['B', 1, 1]], [[['B.W', '...', 'W.B'], 0, 2], ['W', 1, 2]], [[['BW..W', 'W..WW', 'W..W.', '.WWW.', '.W.BW'], 4, 1], ['W', 8, 9]]], [[[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 0, 2], ['.', 0, 0]], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 3, 0], ['B', 12, 4]], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 3, 2], ['B', 12, 4]], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 0, 1], ['B', 12, 4]], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 2, 2], ['.', 0, 0]], [[['WWW', 'W.W', 'WWW'], 2, 1], ['W', 8, 1]], [[['.B...', 'B....', '.....', '....W', '...W.'], 0, 1], ['B', 1, 3]], [[['....', 'W.BW', '....'], 1, 3], ['W', 1, 2]]], [[[['WWW', 'W.W', 'WWW'], 0, 2], ['W', 8, 1]], [[['WWW', 'W.W', 'WWW'], 1, 1], ['.', 0, 0]], [[['B.W', '...', 'W.B'], 0, 0], ['B', 1, 2]], [[['B.W', '...', 'W.B'], 0, 2], ['W', 1, 2]], [[['B.W', '...', 'W.B'], 2, 2], ['B', 1, 2]], [[['B.W', '...', 'W.B'], 1, 2], ['.', 0, 0]], [[['.....', '.BBB.', '.B.B.', '.BBB.', '.....'], 3, 3], ['B', 8, 13]], [[['..B..', 'B....', 'BB.BB', 'W...W'], 1, 0], ['B', 3, 4]]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"chain case %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":"a640ce57f934866e3f0d4b2ea40d1a06f2c049826435ddfcd7291f36e7467a80","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    board, r, c = x\n    n = len(board)\n    m = len(board[0])\n    col = board[r][c]\n    if col == '.':\n        return ['.', 0, 0]\n    chain = [(r, c)]\n    k = 0\n    while k < len(chain):\n        i, j = chain[k]\n        k += 1\n        for p, q in ((i + 1, j), (i - 1, j), (i, j + 1), (i, j - 1)):\n            if 0 <= p < n and 0 <= q < m and board[p][q] == col and (p, q) not in chain:\n                chain.append((p, q))\n    libs = set()\n    for i, j in chain:\n        for p, q in ((i, j - 1), (i, j + 1), (i - 1, j), (i + 1, j), (i - 1, j - 1), (i - 1, j + 1), (i + 1, j - 1), (i + 1, j + 1)):\n            if 0 <= p < n and 0 <= q < m and board[p][q] == '.':\n                libs.add((p, q))\n    return [col, len(chain), len(libs)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[['B..W', 'B..W', 'B..W', 'B..W'], 3, 0], ['B', 4, 4]], [[['B..W', 'B..W', 'B..W', 'B..W'], 3, 3], ['W', 4, 4]], [[['B..W', 'B..W', 'B..W', 'B..W'], 3, 2], ['.', 0, 0]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 3, 2], ['W', 4, 4]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 3, 1], ['B', 4, 4]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 1, 1], ['B', 4, 4]], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 2, 2], ['B', 1, 2]], [[['B.W', '...', 'W.B'], 2, 2], ['B', 1, 2]]], [[[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 3, 3], ['W', 6, 4]], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 3, 1], ['W', 6, 4]], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 1, 2], ['B', 7, 6]], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 1, 1], ['.', 0, 0]], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 1, 1], ['B', 1, 4]], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 2, 2], ['B', 1, 2]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 2, 1], ['W', 1, 2]], [[['.....', '.BBB.', '.B.B.', '.BBB.', '.....'], 3, 3], ['B', 8, 13]]], [[[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 4, 3], ['.', 0, 0]], [[['W....', '.....', '.....', '.....', '....B'], 4, 4], ['B', 1, 2]], [[['W....', '.....', '.....', '.....', '....B'], 0, 0], ['W', 1, 2]], [[['W....', '.....', '.....', '.....', '....B'], 1, 0], ['.', 0, 0]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 2, 1], ['W', 1, 2]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 4, 0], ['B', 1, 1]], [[['B.W', '...', 'W.B'], 0, 2], ['W', 1, 2]], [[['BW..W', 'W..WW', 'W..W.', '.WWW.', '.W.BW'], 4, 1], ['W', 8, 9]]], [[[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 0, 2], ['.', 0, 0]], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 3, 0], ['B', 12, 4]], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 3, 2], ['B', 12, 4]], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 0, 1], ['B', 12, 4]], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 2, 2], ['.', 0, 0]], [[['WWW', 'W.W', 'WWW'], 2, 1], ['W', 8, 1]], [[['.B...', 'B....', '.....', '....W', '...W.'], 0, 1], ['B', 1, 3]], [[['....', 'W.BW', '....'], 1, 3], ['W', 1, 2]]], [[[['WWW', 'W.W', 'WWW'], 0, 2], ['W', 8, 1]], [[['WWW', 'W.W', 'WWW'], 1, 1], ['.', 0, 0]], [[['B.W', '...', 'W.B'], 0, 0], ['B', 1, 2]], [[['B.W', '...', 'W.B'], 0, 2], ['W', 1, 2]], [[['B.W', '...', 'W.B'], 2, 2], ['B', 1, 2]], [[['B.W', '...', 'W.B'], 1, 2], ['.', 0, 0]], [[['.....', '.BBB.', '.B.B.', '.BBB.', '.....'], 3, 3], ['B', 8, 13]], [[['..B..', 'B....', 'BB.BB', 'W...W'], 1, 0], ['B', 3, 4]]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"chain case %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":"Small rectangular toy boards given as strings of B, W and dot; a bounded teaching model of one scoring or bookkeeping rule, not a complete rules engine or server implementation. 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":"w2-go-territory-scoring-chain-liberties-diagonal-liberties","generated_at":"2026-09-29T14:50:18.349155+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Go servers and scoring tools compute this value automatically; a wrong answer changes a game result.","root_cause":"The liberty scan uses the eight-neighbourhood.","sha256":"8e51799ed4c4e6834dee32df8a3b517b7462c452c249da826cf2fdd389103fe8","title":"Diagonal empty points are counted as liberties · 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":40.132,"exit_code":1,"observations":[{"actual":["B",4,4],"check":"chain case 0","expected":["B",4,4],"passed":true},{"actual":["W",4,4],"check":"chain case 1","expected":["W",4,4],"passed":true},{"actual":[".",0,0],"check":"chain case 2","expected":[".",0,0],"passed":true},{"actual":["W",4,4],"check":"chain case 3","expected":["W",4,4],"passed":true},{"actual":["B",4,4],"check":"chain case 4","expected":["B",4,4],"passed":true},{"actual":["B",4,4],"check":"chain case 5","expected":["B",4,4],"passed":true},{"actual":["B",1,3],"check":"chain case 6","expected":["B",1,2],"passed":false},{"actual":["B",1,3],"check":"chain case 7","expected":["B",1,2],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"chain case 0\", \"actual\": [\"B\", 4, 4], \"expected\": [\"B\", 4, 4], \"passed\": true}, {\"check\": \"chain case 1\", \"actual\": [\"W\", 4, 4], \"expected\": [\"W\", 4, 4], \"passed\": true}, {\"check\": \"chain case 2\", \"actual\": [\".\", 0, 0], \"expected\": [\".\", 0, 0], \"passed\": true}, {\"check\": \"chain case 3\", \"actual\": [\"W\", 4, 4], \"expected\": [\"W\", 4, 4], \"passed\": true}, {\"check\": \"chain case 4\", \"actual\": [\"B\", 4, 4], \"expected\": [\"B\", 4, 4], \"passed\": true}, {\"check\": \"chain case 5\", \"actual\": [\"B\", 4, 4], \"expected\": [\"B\", 4, 4], \"passed\": true}, {\"check\": \"chain case 6\", \"actual\": [\"B\", 1, 3], \"expected\": [\"B\", 1, 2], \"passed\": false}, {\"check\": \"chain case 7\", \"actual\": [\"B\", 1, 3], \"expected\": [\"B\", 1, 2], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":57.361,"exit_code":1,"observations":[{"actual":["B",4,4],"check":"chain case 0","expected":["B",4,4],"passed":true},{"actual":["W",4,4],"check":"chain case 1","expected":["W",4,4],"passed":true},{"actual":[".",0,0],"check":"chain case 2","expected":[".",0,0],"passed":true},{"actual":["W",4,4],"check":"chain case 3","expected":["W",4,4],"passed":true},{"actual":["B",4,4],"check":"chain case 4","expected":["B",4,4],"passed":true},{"actual":["B",4,4],"check":"chain case 5","expected":["B",4,4],"passed":true},{"actual":["B",1,3],"check":"chain case 6","expected":["B",1,2],"passed":false},{"actual":["B",1,3],"check":"chain case 7","expected":["B",1,2],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"chain case 0\", \"actual\": [\"B\", 4, 4], \"expected\": [\"B\", 4, 4], \"passed\": true}, {\"check\": \"chain case 1\", \"actual\": [\"W\", 4, 4], \"expected\": [\"W\", 4, 4], \"passed\": true}, {\"check\": \"chain case 2\", \"actual\": [\".\", 0, 0], \"expected\": [\".\", 0, 0], \"passed\": true}, {\"check\": \"chain case 3\", \"actual\": [\"W\", 4, 4], \"expected\": [\"W\", 4, 4], \"passed\": true}, {\"check\": \"chain case 4\", \"actual\": [\"B\", 4, 4], \"expected\": [\"B\", 4, 4], \"passed\": true}, {\"check\": \"chain case 5\", \"actual\": [\"B\", 4, 4], \"expected\": [\"B\", 4, 4], \"passed\": true}, {\"check\": \"chain case 6\", \"actual\": [\"B\", 1, 3], \"expected\": [\"B\", 1, 2], \"passed\": false}, {\"check\": \"chain case 7\", \"actual\": [\"B\", 1, 3], \"expected\": [\"B\", 1, 2], \"passed\": false}], \"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."}}