Blame | Last modification | View Log | Download | RSS feed
Gaviota Tablebases Probing Code APICopyright (c) 2010 Miguel A. Ballicora-----------------------------------------------------------------------------This software provides C code to probe the Gaviota Endgame Tablebases.It is released under then X11 ("MIT") license (see license.txt).This API (Application Programming Interface) is designed to be as portableas possible. Functions could be called from Linux or Windows.Most likely it will work in other operating systems but that has not beentested. This API is a beta version and as such, it is not guaranteed anytype of backward compatibility or to remain untouched, at least untilversion 1.0 is released.A very small set of tablebase files is included in this distributionfor testing purposes (only 3 pieces). They are compressed with fourdifferent compression schemes. For a more complete set, please downloadGaviota fromhttp://sites.google.com/site/gaviotachessengine/and generate the 4 and 5 piece tablebases. Instructions how to generateand compressed them are in the website. More information can always be found:http://sites.google.com/site/gaviotachessengine/Home/endgame-tablebases-1Alternatively, already compressed tablebase files (ready to go!) can bedownloaded fromhttp://www.olympuschess.com/egtb/gaviota/ (Many thanks to Josh Shriver)"tbprobe" is distributed here as a tablebase probing example. The current APIis relatively "low level" to optimize performance. We hope the small programtbprobe is self explanatory. A more complete and detailed documentation may bereleased later.We plan to support an interface with a FEN notation; thus, it is expectedthat some other functions maybe added to this API.Four different types of compression are included. It is possible that in thefuture some other compression schemes could be provided, but only if theyrepresent a serious improvement in speed or memory size. To maximizebackward compatibility between versions of programs and TBs, it is stronglyrecommended that engine developers always support at least scheme 4 (tb_CP4),which is considered the default at this point. For that reason, it issuggested that testers always have a set of TBs compressed with scheme 4.This API is designed to be multithreading friendly. Regions where differentthreads could access data from this API were protected with a mutex to avoidproblems.-------------------------- How to use this API ------------------------------To include this code in any engine or GUI, the following files should becompiled and linked:gtb-probe.cgtb-dec.cgtb-att.csysport/sysport.ccompression/wrap.ccompression/huffman/hzip.ccompression/liblzf/lzf_c.ccompression/liblzf/lzf_d.ccompression/zlib/zcompress.ccompression/zlib/uncompr.ccompression/zlib/inflate.ccompression/zlib/deflate.ccompression/zlib/adler32.ccompression/zlib/crc32.ccompression/zlib/infback.ccompression/zlib/inffast.ccompression/zlib/inftrees.ccompression/zlib/trees.ccompression/zlib/zutil.ccompression/lzma/LzmaEnc.ccompression/lzma/LzmaDec.ccompression/lzma/Alloc.ccompression/lzma/LzFind.ccompression/lzma/Lzma86Enc.ccompression/lzma/Lzma86Dec.ccompression/lzma/Bra86.cThe following files will be "included"gtb-probe.hgtb-dec.hgtb-att.hgtb-types.hplus all the *.h files in the folders, so set the proper -I flags:sysport/compression/compression/huffman/compression/liblzf/compression/zlib/compression/lzma/The following libraries should be linked in Linux-lpthread-lmIn Windows, the appropriate MT (multithreaded library should be linked too)These switches should be set in the compiler-D NDEBUG-D Z_PREFIXThe first one removes the assert code, and the secondone makes sure that some names in the zlib library will notcollision with names in other compression libraries.-------------------------- COMPILATION EXAMPLE ------------------------------The file compile.sh is an example of how tbprobe can becompiled in Linux using gcc.Rakefile.rb is the ruby version of Makefile. You have to install 'rake'to execute it. This is what I use but you don't have to. It is providedout of laziness. I should probably remove it.------------------ COMPILING A STATIC LIBRARY (optional) --------------------Aaron Becker wrote a Makefile to compile a static library --> libgtb.aI just applied this modification from his fork.For now, this for Linux only. Type 'make' to compile it.Some people may find this approach more convenient since the libraryhas to be compiled only once. Of course, this library needs to be includedat linking time, when you compile your own program---------------------------- For UCI Authors --------------------------------Generally, UCI (Universal Chess Interface) GUIs use standard labels forTablebase paths and cache sizes. For instance, NalimovPath and NalimovCacheare used for the Nalimov tablebases. Therefore, engine authors are stronglyencouraged (Please!) to follow a common standard to simplify the life of GUIdevelopers and users. For that reason, it is suggested to implement asparameters: GaviotaTbPath and GaviotaTbCache in their communication with aUCI graphical user interface.-----------------------------------------------------------------------------Good luck with the tablebases!Miguel*****************************************************************************