CuckooChess 1.12 - A Java Chess Program

Error: Java applet tag ignored by browser

About the program

Most of the ideas in the program are from the Chess Programming Wiki or from the TalkChess.com forum.

The program implements many of the standard methods for computer chess programs, such as iterative deepening, negascout, aspiration windows, quiescence search with SEE pruning and MVV/LVA move ordering, hash table, history heuristic, recursive null moves, futility pruning, late move reductions, opening book and magic bitboards.

The program is rather slow compared to state of the art chess programs. However, it is still quite good at tactics and scores 299 of 300 on the win at chess tactical test suite, at 10 seconds thinking time per position, using an Intel Core i7 870 CPU. The only position not solved is the extremely complicated position 230, which according to current analysis, seems like a draw and therefore an invalid test position.

Note that I do not consider Java the best language for implementing a chess engine. I wrote this program mostly to get some hands-on experience with java and eclipse.

The program uses the Chess Cases chess font, created by Matthieu Leschemelle.

I picked the name CuckooChess because the transposition table is based on Cuckoo hashing.

The program, except for the chess font, is copyrighted by me, Peter Österlund, and is available as open source under the GNU GPL v3 license.

Downloads

You can also run the applet as a standalone program. Download the jar file and run it like this:

java -jar cuckoo112.jar txt (text mode)

or like this:

java -jar cuckoo112.jar gui (graphical mode)

More commands are available in text mode than in graphical mode. Try the help command for a list of available commands.

Here is the source code (eclipse project) for the program: cuckoo112.tar.bz2
Alternatively, you can get the source code from code.google.com.
Build instructions

Here is the ChangeLog.

UCI mode

It is also possible to use the program as a UCI engine, which means that you can use it with many graphical chess programs. For example, to use it with XBoard/WinBoard + polyglot, set EngineCommand like this in the polyglot ini file:

EngineCommand = java -jar /path/to/jar/cuckoo112.jar uci

To use the program with the Arena GUI, create a one-line bat-file containing:

javaw -Xmx256m -jar cuckoo112.jar uci

Note that you must set the maximum heap size using -Xmx to a value larger than the hash size you set in the Arena program. (I don't know exactly how much larger.)

If you are using windows, you may also be interested in a compiled version available from Jim Ablett's chess projects page.

Speed

The program runs fastest when run in a 64-bit OS using a 64-bit java implementation (JVM). Here is a speed comparison using CuckooChess 1.11 in 64-bit windows 7 on an intel core i7 870, when analyzing from the initial position to depth 17:

Version Speed (N/s)
64-bit JVM (1.6.0_29) 1130275
32-bit JVM (1.6.0_29) 584194

On this computer, the 64-bit version is more than 90% faster.

Texel: C++11 port

In 2012 I ported CuckooChess to C++11 and also renamed it to Texel. This almost doubled the search speed. Version 1.01 was released 2012-03-24. The current version is 1.03. More details are in the ChangeLog.

Here is a speed comparison between different systems and compiler settings, using Texel 1.02 and analyzing from the initial position to depth 17:

Version Speed (N/s)
Linux 64-bit SSE42 2007723
Linux 64-bit 1789993
Linux 32-bit SSE42 1231864
Linux 32-bit 1042577
Windows 8 64-bit SSE42 1766052
Windows 8 64-bit 1634860
ARM 32-bit 174589

The linux and windows versions were run on an "Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz" system. The ARM version was run on an HTC One X mobile phone.

Android port

Here is a port of the program to the Android mobile phone operating system. The android port has been tested on an emulated Android 1.6 device and on a real HTC desire (Android 2.2) device.

Note! The Android port is no longer developed. It has been superseded by DroidFish.

screenshot1 screenshot2