How does KataGo define the dead string?
KataGo computes the pass-alive string in order to force to finish the game if someone refusing pass.
https://github.com/lightvector/KataGo/blob/6e41a3693f47eaaba6afa55ba23418b76a0675c8/cpp/game/board.cpp#L1808-L1814
Seem the pass-alive also help to remove the dead strings. But I don't really understand these code. It just simply think that the string is dead if it is sounded by pass-alive string? Or others? I need some help.
I don’t focus on pass-alive. What did I ask for is how to define dead string.
Strings are marked as pass-dead in a region if the region is fully surrounded by pass-alive groups of the opponent and there is <=1 strictly interior point (all points but 1 are adjacent to a pass alive group instead of being internal to the region). Then (except for absurdly unlikely superko stuff), it is provable that the opponent cannot make 2 eyes - because an eye must be an interior point, and there is only zero or one interior points.
Thanks! Follow your suggestion, I remove the dead strings on the almost games. But still some cases are weird, like this
(;FF[4]GM[1]SZ[9]PB[weights-1]PW[weights-1]HA[0]KM[7]RU[koPOSITIONALscoreAREAtaxNONEsui0]RE[W+8]C[startTurnIdx=14,initTurnNum=0,gameHash=6F371ECC4B20F08B522B3420EC539363,gtype=normal];B[fd];W[dg];B[ef];W[eg];B[fg];W[fh];B[df];W[gg];B[ff];W[eb];B[ec];W[cg];B[db];W[fb];B[cf]C[0.83 0.17 0.00 1.6 v=100 weight=0.00];W[gc]C[0.82 0.18 0.00 1.6 v=100 weight=0.00];B[hd]C[0.84 0.16 0.00 1.9 v=100 weight=0.00];W[dc]C[0.85 0.15 0.00 2.2 v=100 weight=0.00];B[cc]C[0.83 0.17 0.00 2.3 v=600 weight=1.32];W[gd]C[0.81 0.19 0.00 1.7 v=486 weight=0.00];B[he]C[0.81 0.19 0.00 1.7 v=230 weight=0.00];W[dd]C[0.80 0.20 0.00 1.3 v=600 weight=0.90];B[cb]C[0.81 0.19 0.00 1.5 v=512 weight=0.00];W[cd]C[0.93 0.07 0.00 6.1 v=100 weight=0.00];B[ed]C[0.96 0.04 0.00 8.9 v=600 weight=0.75];W[bd]C[0.95 0.05 0.00 7.7 v=600 weight=0.92];B[ab]C[0.97 0.03 0.00 9.4 v=600 weight=1.03];W[bf]C[0.97 0.03 0.00 7.8 v=430 weight=0.00];B[be]C[0.98 0.02 0.00 8.1 v=313 weight=0.00];W[bc]C[0.96 0.04 0.00 8.9 v=545 weight=1.08];B[bb]C[0.98 0.02 0.00 11.4 v=590 weight=1.16];W[ce]C[0.96 0.04 0.00 9.6 v=590 weight=0.86];B[bg]C[0.98 0.02 0.00 10.2 v=497 weight=0.00];W[ae]C[0.98 0.02 0.00 11.3 v=249 weight=0.00];B[ch]C[0.98 0.02 0.00 11.3 v=248 weight=0.00];W[eh]C[0.98 0.02 0.00 10.3 v=147 weight=0.00];B[ah]C[0.97 0.03 0.00 12.1 v=100 weight=0.00];W[ac]C[0.98 0.02 0.00 11.4 v=100 weight=0.00];B[hg]C[0.98 0.02 0.00 11.5 v=100 weight=0.00];W[hh]C[0.97 0.03 0.00 10.8 v=100 weight=0.00];B[gf]C[0.99 0.01 0.00 7.7 v=497 weight=0.68];W[gh]C[0.99 0.01 0.00 6.3 v=415 weight=0.00];B[af]C[0.99 0.01 0.00 8.2 v=497 weight=1.65];W[ag]C[1.00 0.00 0.00 5.1 v=337 weight=0.00];B[hb]C[1.00 0.00 0.00 5.1 v=336 weight=0.00];W[bh]C[0.97 0.03 0.00 4.4 v=227 weight=0.22];B[gb]C[1.00 0.00 0.00 4.5 v=163 weight=0.00];W[ee]C[0.99 0.01 0.00 4.2 v=510 weight=0.57];B[fe]C[1.00 0.00 0.00 4.6 v=164 weight=0.00];W[fc]C[1.00 0.00 0.00 4.5 v=161 weight=0.00];B[ge]C[1.00 0.00 0.00 4.6 v=100 weight=0.00];W[hc]C[0.99 0.01 0.00 8.2 v=184 weight=0.17];B[ic]C[1.00 0.00 0.00 9.2 v=352 weight=0.27];W[ig]C[1.00 0.00 0.00 8.2 v=242 weight=0.00];B[hf]C[1.00 0.00 0.00 8.2 v=210 weight=0.00];W[de]C[1.00 0.00 0.00 10.1 v=100 weight=0.00];B[ie]C[1.00 0.00 0.00 9.5 v=131 weight=0.13];W[bg]C[1.00 0.00 0.00 6.4 v=100 weight=0.00];B[ea]C[1.00 0.00 0.00 6.7 v=128 weight=0.07];W[ih]C[1.00 0.00 0.00 6.5 v=100 weight=0.00];B[]C[1.00 0.00 0.00 6.5 v=100 weight=0.00];W[]C[1.00 0.00 0.00 8.0 v=100 weight=0.00 result=W+8])
The white string in the black region is dead. But all black string is not pass-alive. The white string should not be considered as a dead string in this case.
(;FF[4]GM[1]SZ[9]PB[weights-1]PW[weights-1]HA[0]KM[7.5]RU[koPOSITIONALscoreAREAtaxNONEsui0]RE[W+10.5]C[startTurnIdx=7,initTurnNum=0,gameHash=DBF0BDCAC83EFE8E89E259D2BEC49070,gtype=normal];B[ec];W[ee];B[cc];W[eg];B[ge];W[fd];B[gg];W[ce]C[0.95 0.05 0.00 2.7 v=100 weight=0.00];B[df]C[0.89 0.11 0.00 2.9 v=600 weight=1.03];W[de]C[0.87 0.13 0.00 2.4 v=473 weight=0.00];B[ef]C[0.87 0.13 0.00 2.4 v=251 weight=0.00];W[ff]C[0.86 0.14 0.00 2.2 v=217 weight=0.00];B[fg]C[0.81 0.19 0.00 1.8 v=100 weight=0.00];W[fc]C[0.80 0.20 0.00 1.7 v=100 weight=0.00];B[fb]C[0.81 0.19 0.00 1.7 v=100 weight=0.00];W[gb]C[0.79 0.21 0.00 1.5 v=100 weight=0.00];B[eb]C[0.77 0.23 0.00 1.2 v=100 weight=0.00];W[bc]C[0.74 0.26 0.00 0.9 v=100 weight=0.00];B[bd]C[0.65 0.35 0.00 0.4 v=100 weight=0.00];W[cb]C[0.66 0.34 0.00 0.7 v=600 weight=2.02];B[bb]C[0.72 0.28 0.00 1.5 v=600 weight=0.92];W[dc]C[0.75 0.25 0.00 1.0 v=100 weight=0.00];B[cd]C[0.81 0.19 0.00 1.5 v=100 weight=0.00];W[dg]C[0.87 0.13 0.00 1.9 v=600 weight=1.14];B[fe]C[0.90 0.10 0.00 2.1 v=500 weight=0.00];W[db]C[0.88 0.12 0.00 2.4 v=183 weight=0.00];B[ed]C[0.93 0.07 0.00 3.7 v=600 weight=1.10];W[dd]C[0.95 0.05 0.00 3.5 v=100 weight=0.00];B[cf]C[0.95 0.05 0.00 3.5 v=100 weight=0.00];W[be]C[0.95 0.05 0.00 3.9 v=600 weight=1.37];B[gc]C[0.97 0.03 0.00 4.3 v=484 weight=0.00];W[bg]C[0.99 0.01 0.00 3.6 v=248 weight=0.00];B[eh]C[0.99 0.01 0.00 3.7 v=234 weight=0.00];W[dh]C[0.98 0.02 0.00 3.4 v=496 weight=0.52];B[ac]C[0.99 0.01 0.00 4.0 v=318 weight=0.00];W[ae]C[0.98 0.02 0.00 3.7 v=459 weight=0.49];B[fh]C[0.99 0.01 0.00 4.1 v=345 weight=0.00];W[fa]C[1.00 0.00 0.00 3.8 v=104 weight=0.00];B[gd]C[1.00 0.00 0.00 6.2 v=406 weight=0.37];W[ea]C[1.00 0.00 0.00 4.1 v=347 weight=0.00];B[hb]C[1.00 0.00 0.00 4.3 v=311 weight=0.00];W[cg]C[1.00 0.00 0.00 3.9 v=164 weight=0.00];B[ga]C[1.00 0.00 0.00 4.2 v=166 weight=0.12];W[bf]C[1.00 0.00 0.00 4.6 v=100 weight=0.00];B[da]C[1.00 0.00 0.00 5.6 v=165 weight=0.11];W[ca]C[1.00 0.00 0.00 5.3 v=100 weight=0.00];B[gf]C[1.00 0.00 0.00 5.3 v=100 weight=0.00];W[di]C[1.00 0.00 0.00 5.4 v=100 weight=0.00];B[ef]C[1.00 0.00 0.00 4.3 v=100 weight=0.00];W[ea]C[1.00 0.00 0.00 3.9 v=125 weight=0.09];B[ei]C[1.00 0.00 0.00 4.5 v=100 weight=0.00];W[df]C[1.00 0.00 0.00 4.3 v=100 weight=0.00];B[fa]C[1.00 0.00 0.00 4.3 v=100 weight=0.00];W[da]C[1.00 0.00 0.00 4.1 v=119 weight=0.07];B[ii]C[1.00 0.00 0.00 4.5 v=183 weight=0.12];W[ff]C[1.00 0.00 0.00 4.4 v=100 weight=0.00];B[ad]C[1.00 0.00 0.00 4.5 v=100 weight=0.00];W[ba]C[1.00 0.00 0.00 4.4 v=100 weight=0.00];B[ef]C[1.00 0.00 0.00 5.0 v=161 weight=0.11];W[ah]C[1.00 0.00 0.00 4.4 v=132 weight=0.00];B[ff]C[1.00 0.00 0.00 4.4 v=100 weight=0.00];W[bh]C[1.00 0.00 0.00 4.4 v=112 weight=0.05];B[hc]C[1.00 0.00 0.00 4.5 v=100 weight=0.00];W[ab]C[1.00 0.00 0.00 4.5 v=100 weight=0.00];B[]C[1.00 0.00 0.00 4.4 v=100 weight=0.00];W[ih]C[1.00 0.00 0.00 4.4 v=106 weight=0.05];B[af]C[1.00 0.00 0.00 4.5 v=106 weight=0.05];W[hg]C[1.00 0.00 0.00 4.5 v=100 weight=0.00];B[]C[1.00 0.00 0.00 4.5 v=100 weight=0.00];W[]C[1.00 0.00 0.00 10.0 v=100 weight=0.00 result=W+10.5])
Two white stones is in the black region. We know that the stones are dead. All region belongs to black, But no rules tell us the white is dead. How does KataGo compute this area.
KataGo version: 1.9.2 Weights: kata1-b40c256-s9854456576-d2405111631
In your first case, you are correct. White's group is not scored as dead because black's stone are not pass alive. And black's two stones at the bottom are not scored as dead because the region that contains them has more than one interior point. So the game is scored like this, and W+8 is the correct result.

The second case is similar. Again both players fail to score some regions. So this is the scoring, and W+10.5 is the correct result.
