A Library of Eyes in Go Author: Thomas Wolf, Matthew Pratola Dept of Mathematics Brock University Presented by: Xiaozhen Niu 1 Outline Introduction Bend-4-in-the-corner Positions Position Generation Position Evaluation Unusual Positions Influence of External Liberties Summary 2 Introduction Eye evaluation is important for life and death problem Goal: generate a library of monolithic eyes positions with stored solutions 3 Bend-4-in-the-corner Positions Definition Bend-4-type positions Characterization 4 Definition If for a regular position, passing belongs to the best moves of both sides then either: Position is unconditional dead, seki or alive, called settled Position is not settled, having a ko status, now it is called calm 5 Bend-4-type Positions Three properties: Initial position does not have a koforbidden point Defender is not unconditionally dead Passing is the single best move for defender 6 Best First Moves Bend-4-type positions have more than one solutions: If playing elsewhere is beneficial then the single best move for attacker is to pass If playing elsewhere is not beneficial, or attacker is asked to kill, then it should play the move leads to ko 7 Characterization Four types of bend-4 positions: 8 Characterization (2) 9 Position Generation Unique representations of three cases of eyes: In the corner On the edge In the centre Norm-locating procedure use shift, rotation and reflection repeatedly for a store position when encountering a new position 10 Generation Use 64 bit hash code (Zobrist) to identify a monolithic eye position (made from White and Black is the attacker) Start with three eyes of size 1 and increasing successively (around 200 million positions of size up to 11) 11 Generation (2) The generation includes 4 steps: At first all internally empty eyes All possible legal combinations of white stones are generated All possible legal combinations of black stones are generated Positions including one or more ko-fights will be generated once for each empty potential ko point 12 Observations Growth factors (Log (Number of positions)) are remarkably constant according to size The number of positions only grow little by adding white stones The number of extra positions due to initial ko grows faster then other numbers, and it’s highest for corner eyes 13 Position Evaluation Use program GoTools, performs binary alpha-beta search To answer whether a position is at least “worth one eye” so that it could live if it had another “eye”, evaluate two cases The eye on its own One extra external 1-point eye being attached Status of eyes often depend on the number of external liberties Computations are done for 0 to 31 external liberties for two cases 14 Observations 15 Observations A large proportion of all eyes are unconditionally alive (do not need to store). Only store a small fraction of all eyes The larger the eye, the more likely the status and/or the best move depend on the number of external liberties and the more records are needed for the eye 16 Optimizations In evaluating, eye size n either keep its size, or it shrinks. Any smaller eye can be evaluated by using stored information Evaluate eyes with many interior stones first and then empty ones later In theory each case would be evaluated 128 times (2x2x32), but it can always be sped up Consistency check: White must not do worse when having more external liberties or extra external eyes 17 Efficiency Monolithic eye database is a single read-only file A module in GoTools norm-transforms any monolithic eye encountered during a computation by performing a rotation, reflection and shift Generates a hash code, look up the entry and decode the information (status and moves) Time saving, but loading a large database is slow! 18 Unusual Positions Calm positions: a position is not settled, and passing is one of the best move for both sides Include: Bend-4-type Eyes of size 5, 6, 7… 19 Eyes of Size 5 4 such positions All have exactly 1 external liberty and the status is that White needs 1 external ko-threat to live 20 Eyes of Size 6 Two types of calm positions of size 6, one is in diagram 8 where White needs 1 ko-threat to live. In second type Black needs one ko-threat to kill 21 Eyes of Size 7 Black needs exactly 1 external ko-threat to kill 22 Eyes of Size 8 Black needs exactly 1 external ko-threat to kill 23 Eyes of Size 9 14: Black need 2 ko-threats to kill. 15: White needs an extra eye and 1 ko-threat to live. 16: with 2 or 0 external liberties it is calm (Black needs 2 or 1ko-threats). But with 1 external liberty it’s not calm for 1 ko-threat 24 Eyes of Size 10 17,18: Black needs 2 ko-threats; 19: Black needs 1 kothreat; 20: White needs 1 ko-threat 25 Eyes of Size 11 21: Black needs 3 ko-threats to kill. 1 external liberty it’s not calm, 0 external liberty is calm with Black needs 2 ko-threats; 22: Black needs 2 ko-threats; 23: Black needs 1 ko-threat; 24: White needs 1 ko-threat 26 Influence of External Liberties Solution strategy depends on the number of external liberties The more external liberties, the more ambitious aim White can try, i.e. a complete win instead of a ko 27 Choices of Best Moves For 1 or 2 external liberties, Black plays a1 or d3 is equivalent (both needs 1 ko-threat) 28 Choices of Best Moves (2) With 3 external liberties: d3 is better (needs 1 ko-threat) than a1 (needs 2 ko-threats) Values of passes: d3 (1 ko-threat and 4 passes of White) or a1 (2 ko-threat and 2 passes of White)? 29 Choices of Best Moves (3) 4 external liberties: Black d3 is unconditional loss whereas a1 at least leads to a ko (needs 3 ko-threats) 30 Summary Cover monolithic eyes of size up to 11 All possible internal configurations of stones of both sides are considered Each eye is evaluated and the best status/moves are provided If results in ko, the number of ko-threats are determined 31