{"abstract":"Empty regions on the first row or column pick up border colours from the opposite edge, so territory becomes dame or changes owner.","category":"Go territory scoring","checks":8,"contract":"Input [board, komi_tenths]. Area = own stones + empty regions whose orthogonal border touches only that colour. Return [black_area, white_area, result] where result is \"B+x.y\" / \"W+x.y\" after subtracting komi from black, or \"Draw\".","contract_signature":"x","evaluation_group":"w2-go-territory-scoring-tt-area","failed_approach":"Adding the lower bound for rows only still lets column -1 wrap to the right edge.","family":"w2-go-territory-scoring-tt-area-edge-wraparound-in-region-flood","id":"FA-82841","implementations":{"attempt":{"sha256":"0ea2dbce93f0cf34dde107563207e379b6522776421177b15ac88e5be33bab8c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    board, komi = x\n    n = len(board)\n    m = len(board[0])\n    b = sum(row.count('B') for row in board)\n    w = sum(row.count('W') for row in board)\n    seen = set()\n    for r in range(n):\n        for c in range(m):\n            if board[r][c] != '.' or (r, c) in seen:\n                continue\n            stack = [(r, c)]\n            seen.add((r, c))\n            size = 0\n            border = set()\n            while stack:\n                i, j = stack.pop()\n                size += 1\n                for di, dj in ((1, 0), (-1, 0), (0, 1), (0, -1)):\n                    a, d = i + di, j + dj\n                    if 0 <= a < n and d < m:\n                        v = board[a][d]\n                        if v == '.':\n                            if (a, d) not in seen:\n                                seen.add((a, d))\n                                stack.append((a, d))\n                        else:\n                            border.add(v)\n            if border == {'B'}:\n                b += size\n            elif border == {'W'}:\n                w += size\n    diff = b * 10 - w * 10 - komi\n    if diff > 0:\n        res = 'B+%d.%d' % (diff // 10, diff % 10)\n    elif diff < 0:\n        res = 'W+%d.%d' % ((-diff) // 10, (-diff) % 10)\n    else:\n        res = 'Draw'\n    return [b, w, res]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[['.B.', 'B.B', '.B.'], 65], [9, 0, 'B+2.5']], [[['WBWWB', 'BB.B.', 'WBWB.', 'WBWBB'], -5], [12, 7, 'B+5.5']], [[['.B.', '.WW', 'BBB', 'WW.'], 65], [4, 4, 'W+6.5']], [[['.WBB', 'BW..', '..B.'], 35], [4, 2, 'W+1.5']], [[['BW.B', '.WWW', 'B.BB', 'WBB.', 'BW.W'], -5], [8, 7, 'B+1.5']], [[['BWBB.', '.B..B', 'BW..B', 'W.BBW', '...BB'], 65], [13, 4, 'B+2.5']], [[['W..B.', 'BB.BB', 'B..B.', 'BBB..', 'B.BBB'], 60], [19, 1, 'B+12.0']], [[['.BBBW.', 'WBBBB.', '.WBB..', 'BBB...', 'BBW..B', '..BW.W'], 70], [18, 6, 'B+5.0']]], [[[['WB.B', 'B.B.', '.B..', 'B...'], -5], [15, 1, 'B+14.5']], [[['W..BBB', 'BWB.W.', '.WWWWW', 'W.WBWW'], -5], [6, 13, 'W+6.5']], [[['W..B', '...B', 'WWWW'], 0], [2, 5, 'W+3.0']], [[['W...', 'WBWB', 'WWBW', 'BBB.'], 5], [6, 6, 'W+0.5']], [[['WW..', 'WWW.', 'BWWW'], 65], [1, 11, 'W+16.5']], [[['WWB', 'W.W', 'B.W', 'B..', '..B'], 35], [4, 5, 'W+4.5']], [[['BB..', '...W', 'BBBW'], 65], [5, 2, 'W+3.5']], [[['W..', 'W.B', '.WB', 'WWW', 'B..'], -5], [3, 7, 'W+3.5']]], [[[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 70], [10, 11, 'W+8.0']], [[['.BBBW.', 'WBBBB.', '.WBB..', 'BBB...', 'BBW..B', '..BW.W'], 70], [18, 6, 'B+5.0']], [[['WWW.W', '..BWW', 'B.BWB', 'W.B..', '.W.WB', 'WW.W.'], 5], [6, 15, 'W+9.5']], [[['.W.', 'BBW', '..B', 'BWW'], 65], [4, 5, 'W+7.5']], [[['.W..', 'WWBB', 'WWWW'], 75], [2, 8, 'W+13.5']], [[['.BBW.', 'WBWBW', '.WWW.', '.WB.B', 'BBW.W'], 35], [8, 11, 'W+6.5']], [[['.W...', '.BBB.', 'WWBBW', '.BB.B', 'WB..W', 'B..BB'], 60], [12, 6, 'Draw']], [[['.W.', '.WW', '.W.', 'BWB'], 70], [2, 6, 'W+11.0']]], [[[['WWW.W', '..BWW', 'B.BWB', 'W.B..', '.W.WB', 'WW.W.'], 5], [6, 15, 'W+9.5']], [[['.W.', '.WW', '.W.', 'BWB'], 70], [2, 6, 'W+11.0']], [[['.WB', 'W.B', 'WB.', 'WB.', 'B..', 'B.B'], 5], [12, 5, 'B+6.5']], [[['WBB', 'BWW', '.BB', 'W..'], 75], [5, 4, 'W+6.5']], [[['..WWB', 'B.B..', '.W.W.', '..BB.', '....B', '...BB'], 60], [8, 4, 'W+2.0']], [[['BBBB.B', '....B.', '.....W', 'BBW..B'], 70], [10, 2, 'B+1.0']], [[['.B.B.', '.BW.W', '....B', 'B..BW', '.BB..', 'W.W..'], -5], [8, 5, 'B+3.5']], [[['...W.W', '.WB.W.', 'W..W..', 'BWW.WW', '.WWW.W', 'BW....'], 0], [3, 25, 'W+22.0']]], [[[['.B.', 'B.B', '.B.'], 65], [9, 0, 'B+2.5']], [[['BBBB.B', '....B.', '.....W', 'BBW..B'], 70], [10, 2, 'B+1.0']], [[['WWW', '.WW', '.WW', 'WWW', 'WWW', 'W.W'], 65], [0, 18, 'W+24.5']], [[['W..', 'W.B', '.WB', 'WWW', 'B..'], -5], [3, 7, 'W+3.5']], [[['WWW', '..B', 'WBW'], 75], [2, 5, 'W+10.5']], [[['.WWW.', 'WW.BB', '.WB..', 'B.W.W', '.WW..', 'W.WWW'], 60], [4, 16, 'W+18.0']], [[['..B', '..W', 'BWB', 'B.B', 'B.W'], 70], [6, 3, 'W+4.0']], [[['.WBB..', 'WWWB.B', 'BWWW.W', 'WW.BB.', 'BW.W.W'], -5], [8, 14, 'W+5.5']]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"area score 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":"ae62fd680c942a00d45a5e3064d9628bc04fff01f0539cc80beaf963773090bb","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    board, komi = x\n    n = len(board)\n    m = len(board[0])\n    b = sum(row.count('B') for row in board)\n    w = sum(row.count('W') for row in board)\n    seen = set()\n    for r in range(n):\n        for c in range(m):\n            if board[r][c] != '.' or (r, c) in seen:\n                continue\n            stack = [(r, c)]\n            seen.add((r, c))\n            size = 0\n            border = set()\n            while stack:\n                i, j = stack.pop()\n                size += 1\n                for di, dj in ((1, 0), (-1, 0), (0, 1), (0, -1)):\n                    a, d = i + di, j + dj\n                    if a < n and d < m:\n                        v = board[a][d]\n                        if v == '.':\n                            if (a, d) not in seen:\n                                seen.add((a, d))\n                                stack.append((a, d))\n                        else:\n                            border.add(v)\n            if border == {'B'}:\n                b += size\n            elif border == {'W'}:\n                w += size\n    diff = b * 10 - w * 10 - komi\n    if diff > 0:\n        res = 'B+%d.%d' % (diff // 10, diff % 10)\n    elif diff < 0:\n        res = 'W+%d.%d' % ((-diff) // 10, (-diff) % 10)\n    else:\n        res = 'Draw'\n    return [b, w, res]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[['.B.', 'B.B', '.B.'], 65], [9, 0, 'B+2.5']], [[['WBWWB', 'BB.B.', 'WBWB.', 'WBWBB'], -5], [12, 7, 'B+5.5']], [[['.B.', '.WW', 'BBB', 'WW.'], 65], [4, 4, 'W+6.5']], [[['.WBB', 'BW..', '..B.'], 35], [4, 2, 'W+1.5']], [[['BW.B', '.WWW', 'B.BB', 'WBB.', 'BW.W'], -5], [8, 7, 'B+1.5']], [[['BWBB.', '.B..B', 'BW..B', 'W.BBW', '...BB'], 65], [13, 4, 'B+2.5']], [[['W..B.', 'BB.BB', 'B..B.', 'BBB..', 'B.BBB'], 60], [19, 1, 'B+12.0']], [[['.BBBW.', 'WBBBB.', '.WBB..', 'BBB...', 'BBW..B', '..BW.W'], 70], [18, 6, 'B+5.0']]], [[[['WB.B', 'B.B.', '.B..', 'B...'], -5], [15, 1, 'B+14.5']], [[['W..BBB', 'BWB.W.', '.WWWWW', 'W.WBWW'], -5], [6, 13, 'W+6.5']], [[['W..B', '...B', 'WWWW'], 0], [2, 5, 'W+3.0']], [[['W...', 'WBWB', 'WWBW', 'BBB.'], 5], [6, 6, 'W+0.5']], [[['WW..', 'WWW.', 'BWWW'], 65], [1, 11, 'W+16.5']], [[['WWB', 'W.W', 'B.W', 'B..', '..B'], 35], [4, 5, 'W+4.5']], [[['BB..', '...W', 'BBBW'], 65], [5, 2, 'W+3.5']], [[['W..', 'W.B', '.WB', 'WWW', 'B..'], -5], [3, 7, 'W+3.5']]], [[[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 70], [10, 11, 'W+8.0']], [[['.BBBW.', 'WBBBB.', '.WBB..', 'BBB...', 'BBW..B', '..BW.W'], 70], [18, 6, 'B+5.0']], [[['WWW.W', '..BWW', 'B.BWB', 'W.B..', '.W.WB', 'WW.W.'], 5], [6, 15, 'W+9.5']], [[['.W.', 'BBW', '..B', 'BWW'], 65], [4, 5, 'W+7.5']], [[['.W..', 'WWBB', 'WWWW'], 75], [2, 8, 'W+13.5']], [[['.BBW.', 'WBWBW', '.WWW.', '.WB.B', 'BBW.W'], 35], [8, 11, 'W+6.5']], [[['.W...', '.BBB.', 'WWBBW', '.BB.B', 'WB..W', 'B..BB'], 60], [12, 6, 'Draw']], [[['.W.', '.WW', '.W.', 'BWB'], 70], [2, 6, 'W+11.0']]], [[[['WWW.W', '..BWW', 'B.BWB', 'W.B..', '.W.WB', 'WW.W.'], 5], [6, 15, 'W+9.5']], [[['.W.', '.WW', '.W.', 'BWB'], 70], [2, 6, 'W+11.0']], [[['.WB', 'W.B', 'WB.', 'WB.', 'B..', 'B.B'], 5], [12, 5, 'B+6.5']], [[['WBB', 'BWW', '.BB', 'W..'], 75], [5, 4, 'W+6.5']], [[['..WWB', 'B.B..', '.W.W.', '..BB.', '....B', '...BB'], 60], [8, 4, 'W+2.0']], [[['BBBB.B', '....B.', '.....W', 'BBW..B'], 70], [10, 2, 'B+1.0']], [[['.B.B.', '.BW.W', '....B', 'B..BW', '.BB..', 'W.W..'], -5], [8, 5, 'B+3.5']], [[['...W.W', '.WB.W.', 'W..W..', 'BWW.WW', '.WWW.W', 'BW....'], 0], [3, 25, 'W+22.0']]], [[[['.B.', 'B.B', '.B.'], 65], [9, 0, 'B+2.5']], [[['BBBB.B', '....B.', '.....W', 'BBW..B'], 70], [10, 2, 'B+1.0']], [[['WWW', '.WW', '.WW', 'WWW', 'WWW', 'W.W'], 65], [0, 18, 'W+24.5']], [[['W..', 'W.B', '.WB', 'WWW', 'B..'], -5], [3, 7, 'W+3.5']], [[['WWW', '..B', 'WBW'], 75], [2, 5, 'W+10.5']], [[['.WWW.', 'WW.BB', '.WB..', 'B.W.W', '.WW..', 'W.WWW'], 60], [4, 16, 'W+18.0']], [[['..B', '..W', 'BWB', 'B.B', 'B.W'], 70], [6, 3, 'W+4.0']], [[['.WBB..', 'WWWB.B', 'BWWW.W', 'WW.BB.', 'BW.W.W'], -5], [8, 14, 'W+5.5']]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"area score 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-tt-area-edge-wraparound-in-region-flood","generated_at":"2026-09-29T14:50:15.932888+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 in-board test only checks the upper bounds, so row -1 and column -1 index the last row and column through Python negative indexing.","sha256":"bbae8b5f92d1fe76ee208c6ba4e415a77db720870e4bdefcd805c8ec48d18e02","title":"Area flood fill leaks across the top and left board edges · 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.912,"exit_code":1,"observations":[{"actual":[11,0,"B+4.5"],"check":"area score case 0","expected":[9,0,"B+2.5"],"passed":false},{"actual":[12,7,"B+5.5"],"check":"area score case 1","expected":[12,7,"B+5.5"],"passed":true},{"actual":[4,4,"W+6.5"],"check":"area score case 2","expected":[4,4,"W+6.5"],"passed":true},{"actual":[4,2,"W+1.5"],"check":"area score case 3","expected":[4,2,"W+1.5"],"passed":true},{"actual":[8,7,"B+1.5"],"check":"area score case 4","expected":[8,7,"B+1.5"],"passed":true},{"actual":[13,4,"B+2.5"],"check":"area score case 5","expected":[13,4,"B+2.5"],"passed":true},{"actual":[19,1,"B+12.0"],"check":"area score case 6","expected":[19,1,"B+12.0"],"passed":true},{"actual":[16,6,"B+3.0"],"check":"area score case 7","expected":[18,6,"B+5.0"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"area score case 0\", \"actual\": [11, 0, \"B+4.5\"], \"expected\": [9, 0, \"B+2.5\"], \"passed\": false}, {\"check\": \"area score case 1\", \"actual\": [12, 7, \"B+5.5\"], \"expected\": [12, 7, \"B+5.5\"], \"passed\": true}, {\"check\": \"area score case 2\", \"actual\": [4, 4, \"W+6.5\"], \"expected\": [4, 4, \"W+6.5\"], \"passed\": true}, {\"check\": \"area score case 3\", \"actual\": [4, 2, \"W+1.5\"], \"expected\": [4, 2, \"W+1.5\"], \"passed\": true}, {\"check\": \"area score case 4\", \"actual\": [8, 7, \"B+1.5\"], \"expected\": [8, 7, \"B+1.5\"], \"passed\": true}, {\"check\": \"area score case 5\", \"actual\": [13, 4, \"B+2.5\"], \"expected\": [13, 4, \"B+2.5\"], \"passed\": true}, {\"check\": \"area score case 6\", \"actual\": [19, 1, \"B+12.0\"], \"expected\": [19, 1, \"B+12.0\"], \"passed\": true}, {\"check\": \"area score case 7\", \"actual\": [16, 6, \"B+3.0\"], \"expected\": [18, 6, \"B+5.0\"], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.274,"exit_code":1,"observations":[{"actual":[14,0,"B+7.5"],"check":"area score case 0","expected":[9,0,"B+2.5"],"passed":false},{"actual":[12,7,"B+5.5"],"check":"area score case 1","expected":[12,7,"B+5.5"],"passed":true},{"actual":[4,4,"W+6.5"],"check":"area score case 2","expected":[4,4,"W+6.5"],"passed":true},{"actual":[4,2,"W+1.5"],"check":"area score case 3","expected":[4,2,"W+1.5"],"passed":true},{"actual":[8,7,"B+1.5"],"check":"area score case 4","expected":[8,7,"B+1.5"],"passed":true},{"actual":[13,4,"B+2.5"],"check":"area score case 5","expected":[13,4,"B+2.5"],"passed":true},{"actual":[19,1,"B+12.0"],"check":"area score case 6","expected":[19,1,"B+12.0"],"passed":true},{"actual":[16,6,"B+3.0"],"check":"area score case 7","expected":[18,6,"B+5.0"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"area score case 0\", \"actual\": [14, 0, \"B+7.5\"], \"expected\": [9, 0, \"B+2.5\"], \"passed\": false}, {\"check\": \"area score case 1\", \"actual\": [12, 7, \"B+5.5\"], \"expected\": [12, 7, \"B+5.5\"], \"passed\": true}, {\"check\": \"area score case 2\", \"actual\": [4, 4, \"W+6.5\"], \"expected\": [4, 4, \"W+6.5\"], \"passed\": true}, {\"check\": \"area score case 3\", \"actual\": [4, 2, \"W+1.5\"], \"expected\": [4, 2, \"W+1.5\"], \"passed\": true}, {\"check\": \"area score case 4\", \"actual\": [8, 7, \"B+1.5\"], \"expected\": [8, 7, \"B+1.5\"], \"passed\": true}, {\"check\": \"area score case 5\", \"actual\": [13, 4, \"B+2.5\"], \"expected\": [13, 4, \"B+2.5\"], \"passed\": true}, {\"check\": \"area score case 6\", \"actual\": [19, 1, \"B+12.0\"], \"expected\": [19, 1, \"B+12.0\"], \"passed\": true}, {\"check\": \"area score case 7\", \"actual\": [16, 6, \"B+3.0\"], \"expected\": [18, 6, \"B+5.0\"], \"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."}}