Nilatac suicide chess engine (original) (raw)
Nilatac suicide chess engine
About Nilatac
Nilatac is a suicide chess engine. It plays according to international rules (the player being stalemated wins). See the Footnote for caveats.
The fun thing about suicide chess, from a software engineer's point of view, is that it was long believed to be solvable, meaning that a computer could produce a game tree ("proof") in which White wins regardless of Black's defense. In fact, Mark Watkins solved it in 2016 (I would estimate that around 20% of the work was done by other engines, including Nilatac). Some lines, such as 1. e3 d5 or 1. e3 e5, are trivially solvable by average players. Other lines, like 1. e3 b6, took years of computing time from several different chess programs.
Nilatac was developed mostly between 2001 and 2003. I haven't worked on the code recently, although I did do some minor opening research, notably solving 1. e3 Nh6 in 2012.Nilatac and its weakened sibling CatNail are registered on Lichess and usually online. Before, they were active on FICS (where CatNail played over 1.2 million games).
Features
- 4-men endgame tablebases (EGTB) (3 GB);
- opening book (click to browse online);
- alpha-beta with transposition tables and various optimizations;
- proof number search.
Issues
- Slow move generator; the board is stored as a char matrix (no bitboards);
- Crashes and infinite loops in the proof-number search algorithm, since it ignores transpositions and repetitions;
- EGTB bugs, at least due to the lack of en passant support, and possibly more since the EGTB were never verified;
- slow EGTB generation -- it would take forever to generate the 5-men EGTB, because it didn't use retrograde analysis;
- no EGTB compression;
- no unit tests.
Colibri
In 2012 and 2013 I spent some time rewriting a new version from scratch, called Colibri. So far the only working component are the 5-men endgame tables (browsable online). Time permitting, I'd like to rewrite the PNS engine as well to try and solve a few more openings. But it's the bad kind of "time permitting", the kind that tends never to happen.
Downloads
Nilatac is free software. Get the source code!
I will seed the EGTB files on torrents once anybody asks. :-)
License
Copyright 2001-2020 Cătălin Frâncu
Nilatac's source code is released under the GNU General Public License, version 2.
Nilatac's opening book and endgame tables are released under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
Footnote
Nilatac originally worked according to FICS rules, in which stalemate is a win for the player with fewer remaining pieces, or a draw if both sides have the same number of pieces. When I moved to Lichess I updated the rules only partially due to lack of time.
- I fixed the alpha-beta and proof number search algorithms. That was the easy part.
- I did not rebuild the opening book, so there can be discrepancies. It is even conceivable that some lines that are won under FICS rules are still viable under international rules, although this seems very unlikely.
- I did not rebuild the endgame tables. I expect this to cause issues occasionally, for example when the engine, having fewer pieces, will stalemate its opponent. Worse yet, these positions can occur in the alpha-beta or PNS trees and the engine will actively pursue them.