Google
 

Introduction

See the file format description page for a list of the files and the formats of each. This page will take a look into the files to help make that more formal description easier to understand. The Positions section will go into detail about how to make the zobrist code from a board position, then we briefly show how this relates to the Scored Positions. Note: to view the data files some php scripts that have not been publicly released (at time of writing, Jan 2011) are used; in both cases they do nothing more than load the binary format and output it as ascii.

Positions

The entries in the positions file are not neccessarily in any order, but it just so happens that the first few entries appear to be the start of an actual game, so let's view them. I'm using this command:

php read_position_dat.php input_positions.dat | head -72
which gives the following output:
31846ceb8015dc92:0: who=W
from_sgf=0
 . . . . . . . . .
 . . . . . . . . .
 . . . . . . . . .
 . . . # . . . . .
 . . . . . . . . .
 . . . . . . . . .
 . . . . . . . . .
 . . . . . . . . .
 . . . . . . . . .

161229a425c1a6ab:0: who=B
from_sgf=0
 . . . . . . . . .
 . . . . . . . . .
 . . . . . . O . .
 . . . # . . . . .
 . . . . . . . . .
 . . . . . . . . .
 . . . . . . . . .
 . . . . . . . . .
 . . . . . . . . .

0f6dba75177f4751:0: who=W
from_sgf=0
 . . . . . . . . .
 . . . . . . . . .
 . . . . . . O . .
 . . . # . . . . .
 . . . . . . . . .
 . . . . . # . . .
 . . . . . . . . .
 . . . . . . . . .
 . . . . . . . . .

c26fdb58178900b1:0: who=B
from_sgf=0
 . . . . . . . . .
 . . . . . . . . .
 . . . . . . O . .
 . . . # . . . . .
 . . . . . . . . .
 . . . . . # . . .
 . . O . . . . . .
 . . . . . . . . .
 . . . . . . . . .

56a292a15dcb1e4b:0: who=W
from_sgf=0
 . . . . . . . . .
 . . . . . . . . .
 . . . . . . O . .
 . . . # . . . . .
 . . . . . . . . .
 . . # . . # . . .
 . . O . . . . . .
 . . . . . . . . .
 . . . . . . . . .

01aabb68f67d3dea:0: who=B
from_sgf=0
 . . . . . . . . .
 . . . . . . . . .
 . . . . . . O . .
 . . . # . . . . .
 . . . . . . . . .
 . . # . . # . . .
 . . O . . . O . .
 . . . . . . . . .
 . . . . . . . . .

The "who=W" means white to move next. "from_sgf=0" means it has not come from a SGF file (or, more precisely, it means we haven't recorded its source file).

Move One

Let's look at the first entry in more detail. It has a zobrist code of 31846ceb8015dc92. (The ":0" is the tie-breaker, but it will always be zero currently.) The board position is a single stone at the (4,4) point:

 . . . . . . . . .   0  1  2  3  4  5  6  7  8
 . . . . . . . . .   9 10 11 12 13 14 15 16 17
 . . . . . . . . .  18 19 20 21 22 23 24 25 26
 . . . # . . . . .  27 28 29 30 31 32 33 34 35
 . . . . . . . . .  36 37 38 39 40 41 42 43 44
 . . . . . . . . .  45 46 47 48 49 50 51 52 53
 . . . . . . . . .  54 55 56 57 58 59 60 61 62
 . . . . . . . . .  63 64 65 66 67 68 69 70 71
 . . . . . . . . .  72 73 74 75 76 77 78 79 80
(4,4) is index 30. But allowing for rotation it might also be 32, 48 or 50. If we look in zobrist_board_81.dat for those 4 lines, first column:

3064b6ca5d58205017
3255982aaeb97bc562
4831846ceb8015dc92
505c6453dd79306f8a

The lowest one is used. Therefore, internally, it is actually seeing the board as:

 . . . . . . . . .
 . . . . . . . . .
 . . . . . . . . .
 . . . . . . . . .
 . . . . . . . . .
 . . . # . . . . .
 . . . . . . . . .
 . . . . . . . . .
 . . . . . . . . .

Move Two

 . . . . . . . . .     0  1  2  3  4  5  6  7  8
 . . . . . . . . .     9 10 11 12 13 14 15 16 17
 . . . . . . O . .    18 19 20 21 22 23 24 25 26
 . . . # . . . . .    27 28 29 30 31 32 33 34 35
 . . . . . . . . .    36 37 38 39 40 41 42 43 44
 . . . . . . . . .    45 46 47 48 49 50 51 52 53
 . . . . . . . . .    54 55 56 57 58 59 60 61 62
 . . . . . . . . .    63 64 65 66 67 68 69 70 71
 . . . . . . . . .    72 73 74 75 76 77 78 79 80
So this is black 30, white 24. But it could also be black 30, white 56. After considering the 4 rotations we get 8 combinations, shown below with their zobrist codes.
B (4,4)W (3,3)B hashW hashXOR
302464b6ca5d58205017e2c5a4c687a8c2a286736e9bdf8892b5
305664b6ca5d5820501737bf23f5366f78cc5309e9a86e4f28db
322055982aaeb97bc56281e5d8528b336378d47df2fc3248a61a
326055982aaeb97bc5622796454fa5d47a39720e6fe11cafbf5b
482031846ceb8015dc9281e5d8528b336378b061b4b90b26bfea
486031846ceb8015dc922796454fa5d47a39161229a425c1a6ab
50245c6453dd79306f8ae2c5a4c687a8c2a2bea1f71bfe98ad28
50565c6453dd79306f8a37bf23f5366f78cc6bdb70284f5f1746

The lowest zobrist hash code, in the XOR column, is 161229a425c1a6ab, meaning that internally it sees the board like this:

 . . . . . . . . .
 . . . . . . . . .
 . . . . . . . . .
 . . . . . . . . .
 . . . . . . . . .
 . . . # . . . . .
 . . . . . . O . .
 . . . . . . . . .
 . . . . . . . . .
(Note: it is just coincidence that the rotation is the same as after move 1; the rotation will typically change move to move.)

Scored Positions

Compared to converting a board position to a zobrist hashcode, using the scored positions file is easy. The results of this command

php read_scored_positions.php fuego_chinese.dat | head -6
look like:
31846ceb8015dc92:0: who=W:   7(2%)
161229a425c1a6ab:0: who=B:   7(1%)
0f6dba75177f4751:0: who=W: >=8(0%)
c26fdb58178900b1:0: who=B:   7(2%)
56a292a15dcb1e4b:0: who=W:   6(0%)
01aabb68f67d3dea:0: who=B: >=8(3%)
It should be regarded as coincidence that these correspond exactly with the 6 positions introduced above; theoretically the data in both files could be in any order.

So the first column is the hexcode of the zobrist code; the who=W is who to move next. The final column is the score, with the confidence in brackets. The confidence is on a scale from 0% (no confidence at all) to 100% (very sure about score). The very low confidences in this sample is natural as they are opening positions.


© Copyright 2011, Darren Cook <darren@dcook.org>