Node:Bearoff databases with GNU Backgammon, Next:Obtaining bearoff databases, Previous:Introduction to bearoff databases, Up:Bearoff databases
gnubg works with both one sided and two sided bearoff databases. Currently, it works with up to four databases; two of each kind. Two of the databases are read into memory for fast access, but of course these are limited to very small databases.
The one sided database kept in memory is either built-in or stored on
disk as gnubg_os0.bd
depending on the compile time option
USE_BUILTIN_BEAROFF
, which is most easily controlled by passing
the option --enable-bearoff=TYPE
where type
is either
no
, static
, or external
. gnubg can also work
without this database, but will generate a heuristic version every
time the program starts. This can take up to several minutes,
depending on the speed of your computer.
We recommend using an external file as the executable will be smallest possible, and several running instances of gnubg will share the memory if your system has mmap (memory mapping of files).
The standard size is 15 chequers on 6 points, but you may generate a larger one, but remember that the gnubg will read the file into memory. The default size should be adequate for all purposes.
The two sided database kept in memory (gnubg_ts0.bd
) is
optional and you may generate or download your own (see next section
for details). gnubg will use the exact cubeful equities in the
databases for cubeful money game evaluations and for truncation in
money game rollouts (see (insert ref to rollout chapter)).
gnubg cannot directly use the equities for match play as the equities, in general, depend on the match score, cube value, and cube ownership. However, it's possible to calculate the cube efficiency parameter X from Rick Janowski's formulae from the cubeful money equities that are available. This is very important as the cube efficiency parameter often is very different from the range 0.6 and 0.68 that gnubg uses for long bearoffs and contact play, respectively. The calculated value of X is used in match play generalisation of Janowski's to yield cubeful match winning chances. gnubg uses a similar heuristic for Hypergammon (see below).
The two databases (gnubg_os.bd
and
gnubg_ts.bd
) are kept on disk and accessed when
needed. See next section for details on how to generate or download
your own.
A few words of caution: the race neural net in gnubg is believed to be quite good, so it may not be worthwhile to generate large one sided database. Joseph Heled has published a comparison of chequer play decisions between the 0.13 race net and a one sided bearoff database for 15 chequers on 12 points. A total of 34,165 positions were examined, and the error rates were quite small:
Ply | Error rate/positions | Number of errors | Percentage of positions with errors
|
0 | 0.00025 | 3231 | 9.5
|
1 | 0.00032 | 3418 | 10.0
|
2 | 0.00002 | 1255 | 3.7
|
In order to play or analyse Hypergammon matches or session you need
the databases hyper1.bd
, hyper2.bd
, and hyper3.bd
for 1-chequer, 2-chequer, and 3-chequer (normal) Hypergammon. These
databases contain the cubeless game winning chance, gammon, and
backgammon probabilities (based on cubeless money play without Jacoby
rule), and cubeful equities for money game: centered cube (with Jacoby
rule), centered cube (without Jacoby rule), owned cube, and
unavailable cube. For match play gnubg uses a similar heuristic to
the usage of the two-sided bearoff database in match play for normal
backgammon: the cube efficiency parameter X from Janowski's formulae
are estimated from the cubeful money equities.
Each position requires 28 bytes of storage. For easy indexing of the file gnubg also use storage for the illegal positions. The table below shows the size of the Hypergammon databases.
Number of chequers | Number of positions | Size of file/bytes
|
1 | 676 | 19,968
|
2 | 123,201 | 3,449,668
|
3 | 10,732,176 | 300,500,968
|