Gnugo scoring bug

This page documents a Gnugo scoring bug, present in gnugo 3.8 and also in the 3.9.1 development version. Look at the 1934 Oteai game between Kubomatsu Katsukiyo and Onoda Chiyotaro. The sgf. The final position:

The game is over, this is the place where the official game record stops, and it gives the result B+7. Various sources on the net differ slightly and give B+6 or B+7 or B+8. Let us ask Gnugo.

$ gnugo --score estimate -l ko.sgf
Black wins by 1.5 points

Not very accurate, but this is only an estimate. Ask for a more precise result.

$ gnugo --score finish -l ko.sgf
262 black (X) move N5
263 white (O) move F15
264 black (X) move D15
265 white (O) move N6
266 black (X) move F14
267 white (O) move E15
268 black (X) move F13
269 white (O) move N5
270 black (X) move T6
271 white (O) move T4
272 black (X) move A13
273 white (O) move A10
274 black (X) move M2
275 white (O) move O1
276 black (X) move M10
277 white (O) move N10
278 black (X) move N12
279 white (O) move Q14
280 black (X) move O10
281 white (O) move D10
282 black (X) move N8
283 white (O) move O8
284 black (X) move PASS
285 white (O) move PASS
Black wins by 35.0 points
Result from file: B+7.0
GNU Go result and result from file are different

Funny. Basically the only point to settle is the result of the ko at N5/N6. But W finds a ko threat that gives away 28 points, the entire chain at F12. Bad.

The docs tell us that --score aftermath is even better, but it gives precisely the same output in this case.