Protector Code
Brought to you by:
raimundheid
Protector is a Bitboard-based chess program that communicates with a chess GUI via the UCI protocol. Protector was written from scratch as a bitboard-based program in ANSI-C. It incorporates many ideas from Crafty, Fruit and Toga -- but in many aspects it is different from any of these programs (for this reason it will not be possible to copy code from Protector to Toga, for example). Please take a look at the sources for more details. ### SUPPORTED PLATFORMS Currently Protector can be compiled and run on the following platforms: - Windows XP 32-bit. Use Microsoft Visual Studio 2005. Create a new "Project from existing code", add file types "*.cpp;*.c;*.h". Set the project type to "Console Application Project", and add "Support for MFC". Add "MSFT_CC" to the Preprocessor definitions. Protector should also run on Windows 2000 and Vista 32-bit but I haven't tested this. - Windows Vista/Windows 7 64-bit. Use Microsoft Visual Studio 2005 with the 64-bit libraries and look above (Windows 32-bit) for project setup. Protector should also run on XP 64-bit systems, but I haven't tested this. - Ubuntu 9 Linux 32-bit and 64-bit. Use ICC (Intel C++ Compiler) and the Makefile. Install ICC 11.0 and type 'make'. Protector should also run on other Linux distributions, but I haven't tested this. Please note: For tests Protector should have access to at least 4-men Nalimov tablebases (better: 5-men), since it doesn't contain specialized code for primitive endgames. ### FUTURE WORK It would be great if you support the further development of Protector in one of the following areas. I recommend to contact me via 'Raimund_Heid@yahoo.com' in advance. - Speed optimization. I haven't speed-optimized Protector for a long time and I assume that it can be accelerated 10-20% by refactoring, an example being the usage of compiler intrinsics under Linux. Use the automated tests (assertions in debug mode) for refactoring. Another promising measure could be using the ICC profiler under Linux. - Evaluation. Of course this is an endless story. Protector currently is weak in estimating the value of rooks vs. knights and bishops in endgames. I assume that connected pawns need to be examined in order to assess this value more adequate. Another important weakness is 'king position in endgames' (distant passers, proximity to remaining pawn islands, king invasion). - Parallel search. Currently Protector uses the shared hashtable approach for parallel search. The speedup with more than 2 processors is poor. Some more sophisticated SMP algorithms like YBW should do a much better job. - GCC support. Not a big thing, I suppose. ICC 11.0 (Intel C++ Compiler) compiles Protector without warnings. However GCC complains about the inline functions in the header files and wants to have them in the module files. I guess that a compiler switch can solve this, but I haven't found it yet. - Mac support. I haven't compiled Protector on a Mac yet since I don't own one. I assume that it takes a couple of hours to get Protector compiling and running on a Mac. Some support from you would be great! ### TABLEBASE ACCESS Currently the permission to use and distribute Eugene Nalimov's and Andrew Kadatch's code for accessing Nalimov tablebases along with the sources of Protector is pending (according to an automated reply Eugene Nalimov is on vacation). In order to respect their copyright I haven't included their code in the sources provided with Protector. However, if you are a developer and have the permission to use or include their code you can do so by conducting the following steps: 1) Download the sources of Crafty 23.0 from ftp://ftp.cis.uab.edu/pub/hyatt/source/crafty-23.0.zip and copy the three files 'egtb.cpp', 'tbdecode.h' and 'lock.h' into the directory of the protector sources. Please note that the content of 'lock.h' isnt't really needed, but 'lock.h' is included in 'egtb.cpp' and copying this file is the fastest way to a compileable project. 2) Make sure INCLUDE_TABLEBASE_ACCESS is defined in 'tools.h'. And you're done. Please note: Protector's glue code for accessing Nalimov tablebases is contained in 'tablebase.c'. If you want to compile the Protector sources without tablebase access code: a) Remove the INCLUDE_TABLEBASE_ACCESS preprocessor definition in 'tools.h' b) Exclude the 'egtb.o' and 'tablebase.o' files from the project's build targets. ### CREDITS Protector is based on many great ideas from the following people: Fabien Letouzey (pvnodes, blending of opening and endgame values), Thomas Gaksch (pvnode extensions, extended futility pruning, space attack eval), Robert Hyatt (consistent hashtable entries), Andrew Kadatch, Eugene Nalimov (tablebases), Stefan Meyer-Kahlen (UCI), Gerd Isenberg (magic bitboards), Mike Donnig (testing), Vincent van Diepeveen (for reminding me to respect the value of someone else's work). Without their contributions Protector would not be what it is. Thank you so much.