CookieCat sample games

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

CookieCat sample games

Post by sje »

Here is a CookieCat sample autoplay game at five seconds per move.

Missing: An opening book, many positional evaluation components, and many search enhancements.

Code: Select all

[Event "Autoplay"]
[Site "Unknown site"]
[Date "2011.12.24"]
[Round "-"]
[White "CookieCat 2011.12.24"]
[Black "CookieCat 2011.12.24"]
[Result "1/2-1/2"]

1 Nf3 Nc6 2 Nc3 d5 3 d4 Bf5 4 e3 e6 5 Bd3 Nf6 6 Ke2 Ne4 7 Ne5 Nxe5 8 dxe5 Qg5 9 g3 Nxc3+ 10 bxc3
Qh5+ 11 Kd2 Bg4 12 Be2 Bxe2 13 Qxe2 Qxe2+ 14 Kxe2 Be7 15 Rb1 b6 16 f3 Kd7 17 e4 Kc6 18 exd5+ Kxd5
19 Be3 c5 20 Bf4 g5 21 Rhd1+ Kc4 22 Bd2 Rad8 23 f4 Rd5 24 Be1 gxf4 25 gxf4 Rg8 26 Kf3 Rg1 27 Kf2
Rxd1 28 Rxd1 Rg8 29 Kf3 Rg1 30 Kf2 Rg7 31 Kf3 f6 32 exf6 Bxf6 33 Rd3 e5 34 Re3 exf4 35 Re4+ Kb5 36
Kxf4 Rg2 37 Kf5 Bd8 38 a4+ Ka6 39 Re8 Bc7 40 h3 h5 41 Re7 Bh2 42 Re8 Bc7 43 Re7 Bb8 44 Re8 Bh2 45
Re7 Bb8 46 Re8 Bh2 47 Re7 Rxc2 48 Kg5 Rg2+ 49 Kxh5 Ra2 50 Re4 Ka5 51 Re7 Ka6 52 Re4 Ka5 53 Re7 a6
54 Re4 Ra1 55 Bd2 Bg3 56 Re6 Rd1 57 Bg5 Bc7 58 Re4 Ra1 59 Bd2 Ra2 60 Be1 Ra1 61 Bd2 Bg3 62 Re6 Rd1
63 Bg5 Bc7 64 Re4 Rh1 65 h4 Rd1 66 Re7 Bd8 67 Re4 Bxg5 68 hxg5 Rh1+ 69 Kg4 Rg1+ 70 Kh4 Rh1+ 71 Kg4
Rg1+ 72 Kh4 Rg2 73 Rg4 Rh2+ 74 Kg3 Rh8 75 g6 Rg8 76 g7 c4 77 Kh4 b5 78 axb5 axb5 79 Kh5 b4 80 cxb4+
Kb5 81 Kh6 c3 82 Kh7 c2 83 Rg1 Rxg7+ 84 Kxg7 Kxb4 85 Kf6 Ka3 86 Ke5 Ka2 87 Kd4 Kb2 88 Kc4 c1=B 89
Kb4 Bd2+ 90 Ka4 Bc1 91 Ka5 Bd2+ 92 Ka4 Bc1 93 Ka5 Bd2+ 94 Ka4 1/2-1/2
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: CookieCat sample games

Post by lucasart »

sje wrote:Missing: An opening book
IMO the opening book should be the job of the GUI. If you use the UCI protocol you should never have to worry about coding the book stuff yourself.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: CookieCat sample games

Post by lucasart »

sje wrote:Here is a CookieCat sample autoplay game at five seconds per move.

Missing: An opening book, many positional evaluation components, and many search enhancements.

Code: Select all

[Event "Autoplay"]
[Site "Unknown site"]
[Date "2011.12.24"]
[Round "-"]
[White "CookieCat 2011.12.24"]
[Black "CookieCat 2011.12.24"]
[Result "1/2-1/2"]

1 Nf3 Nc6 2 Nc3 d5 3 d4 Bf5 4 e3 e6 5 Bd3 Nf6 6 Ke2 Ne4 7 Ne5 Nxe5 8 dxe5 Qg5 9 g3 Nxc3+ 10 bxc3
Qh5+ 11 Kd2 Bg4 12 Be2 Bxe2 13 Qxe2 Qxe2+ 14 Kxe2 Be7 15 Rb1 b6 16 f3 Kd7 17 e4 Kc6 18 exd5+ Kxd5
19 Be3 c5 20 Bf4 g5 21 Rhd1+ Kc4 22 Bd2 Rad8 23 f4 Rd5 24 Be1 gxf4 25 gxf4 Rg8 26 Kf3 Rg1 27 Kf2
Rxd1 28 Rxd1 Rg8 29 Kf3 Rg1 30 Kf2 Rg7 31 Kf3 f6 32 exf6 Bxf6 33 Rd3 e5 34 Re3 exf4 35 Re4+ Kb5 36
Kxf4 Rg2 37 Kf5 Bd8 38 a4+ Ka6 39 Re8 Bc7 40 h3 h5 41 Re7 Bh2 42 Re8 Bc7 43 Re7 Bb8 44 Re8 Bh2 45
Re7 Bb8 46 Re8 Bh2 47 Re7 Rxc2 48 Kg5 Rg2+ 49 Kxh5 Ra2 50 Re4 Ka5 51 Re7 Ka6 52 Re4 Ka5 53 Re7 a6
54 Re4 Ra1 55 Bd2 Bg3 56 Re6 Rd1 57 Bg5 Bc7 58 Re4 Ra1 59 Bd2 Ra2 60 Be1 Ra1 61 Bd2 Bg3 62 Re6 Rd1
63 Bg5 Bc7 64 Re4 Rh1 65 h4 Rd1 66 Re7 Bd8 67 Re4 Bxg5 68 hxg5 Rh1+ 69 Kg4 Rg1+ 70 Kh4 Rh1+ 71 Kg4
Rg1+ 72 Kh4 Rg2 73 Rg4 Rh2+ 74 Kg3 Rh8 75 g6 Rg8 76 g7 c4 77 Kh4 b5 78 axb5 axb5 79 Kh5 b4 80 cxb4+
Kb5 81 Kh6 c3 82 Kh7 c2 83 Rg1 Rxg7+ 84 Kxg7 Kxb4 85 Kf6 Ka3 86 Ke5 Ka2 87 Kd4 Kb2 88 Kc4 c1=B 89
Kb4 Bd2+ 90 Ka4 Bc1 91 Ka5 Bd2+ 92 Ka4 Bc1 93 Ka5 Bd2+ 94 Ka4 1/2-1/2
Congratulations for CookieCat :)

I would say the first things you need to do to have a reasonable eval is:
- piece on square tables. there are of course many ways to do it, but the Fruit approach is a very good one, since it reduces massively the number of arbitrary parameters (parametric PSQ). In particular Ke2? would not have been played given a reasonable PSQ table.
- Pawn structures of course. Although doubled backward isolated pawns and the like are important, the most important elo-wise is probably passed pawns. Without any passed pawns knowledge your engine is likely to be quite silly in endgames. In this game, white should have initiated a plan to push the h passed pawn much earlier.
- The main improvements will come from the search at this early point of developpement. I've found the Null Move to be a massive elo gain when I started developping DoubleCheck (and just had a basic SEE ordering + PVS algorithm, eval was just PSQ tables)
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: CookieCat sample games

Post by sje »

lucasart wrote:
sje wrote:Missing: An opening book
IMO the opening book should be the job of the GUI. If you use the UCI protocol you should never have to worry about coding the book stuff yourself.
Coding an opening book, both generation and look-up, is easy. These routines have to be present in the program because (in part), the end user may be running CookieCat on a small system (e.g., Raspberry Pi) where there is no GUI available.

And it's a similar story for tablebases. The only difference is that the TB generator is a separate program, although I could integrate it later as it too can run on a small system. How small? It was written and tested on a 1986 Mac Plus with a whopping 4 MB of RAM and a 20 MB drive.

CookieCat has hook stubs for xboard and UCI. But I may delete these and use my own protocol instead with filter programs to handle xboard/UCI.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: CookieCat sample games

Post by sje »

lucasart wrote:I would say the first things you need to do to have a reasonable eval is:
- piece on square tables. there are of course many ways to do it, but the Fruit approach is a very good one, since it reduces massively the number of arbitrary parameters (parametric PSQ). In particular Ke2? would not have been played given a reasonable PSQ table.
- Pawn structures of course. Although doubled backward isolated pawns and the like are important, the most important elo-wise is probably passed pawns. Without any passed pawns knowledge your engine is likely to be quite silly in endgames. In this game, white should have initiated a plan to push the h passed pawn much earlier.
- The main improvements will come from the search at this early point of developpement. I've found the Null Move to be a massive elo gain when I started developping DoubleCheck (and just had a basic SEE ordering + PVS algorithm, eval was just PSQ tables)
CookieCat already has a POS table for pawn advancement; adding more tables is easy and will be done soon.

The program already knows how to detect passed pawns and soon will be able to identify other pawn features. There is already a pawn structure/score transposition table.

CookieCat also knows about null moves and these are correctly handled by the execute/retract routines. Adding a null move search is easy.

Hey, I can type only so fast:

Code: Select all

sje$ wc *.pas
   14651   43516  433248 CookieCat.pas
That's 171 lines of code per day since October 3rd when I started BozoChess from scratch.

The evaluator is good enough for now. Getting the tablebase code entirely finished, writing the PGN and EPD parsers, writing the opening book routines, and working on thread issues all have higher priority.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: CookieCat sample games

Post by lucasart »

sje wrote: Hey, I can type only so fast:

Code: Select all

sje$ wc *.pas
   14651   43516  433248 CookieCat.pas
That's 171 lines of code per day since October 3rd when I started BozoChess from scratch.
Nice work !

Let me know when you have a functional and stable enough program that I can test. Is it going to be UCI compatible ?

I'm doing a GPL Blitz rating list (cf. my post in the Tournament forum), and CookieCat 1.0 would be a nice addition to my collection !
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: CookieCat sample games

Post by sje »

lucasart wrote:Let me know when you have a functional and stable enough program that I can test. Is it going to be UCI compatible ?

I'm doing a GPL Blitz rating list (cf. my post in the Tournament forum), and CookieCat 1.0 would be a nice addition to my collection !
Someday CookieCat will be both xboard and UCI compatible, but this is likely to require a polygot-like separate filter program.

In the meantime, you are welcome to review and test the program and its simple console interface. Just send me a PM with your email address and a copy of the source will be on its way.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: CookieCat sample games

Post by lucasart »

sje wrote:
lucasart wrote:Let me know when you have a functional and stable enough program that I can test. Is it going to be UCI compatible ?

I'm doing a GPL Blitz rating list (cf. my post in the Tournament forum), and CookieCat 1.0 would be a nice addition to my collection !
Someday CookieCat will be both xboard and UCI compatible, but this is likely to require a polygot-like separate filter program.

In the meantime, you are welcome to review and test the program and its simple console interface. Just send me a PM with your email address and a copy of the source will be on its way.
I'll probably wait for an UCI or Xboard version before. I can't really test without, and as for reviewing code.. I'm a noob in PASCAL, so I couldn't really help you there :(
Although I have done some PASCAL in the past, and at the time I thought it was the best language ever! That was after my Visual Basic phase, and before I learnt C 8-)
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: CookieCat sample games

Post by sje »

lucasart wrote:I'll probably wait for an UCI or Xboard version before. I can't really test without, and as for reviewing code.. I'm a noob in PASCAL, so I couldn't really help you there :(
There will be a lengthy wait, as xboard/UCI support will very likely be the very last piece added before exiting the beta phase.

Playing strength is not a goal above all other goals. There are already plenty of free, strong programs. But how many of these are truly portable? How many were written with a highly permissive, BSD style license? How many were coded so that a relative neophyte could understand and modify the program?
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

This time with tablebase support

Post by sje »

I've connected the tablebase transposition table probe and the tablebase file probe with the first having priority over the second. An object of the enclosing class, tbwrangler, is queried by the search at ply > 0 whenever the position's wood (count of chessmen) integer component drops into the TB man count range. This includes the quiescence search, but this is just for testing and will be changed.

Here is a five second per move autoplay game using the TB code (the first ten ply manually inserted):

Code: Select all

[Event "Unknown event"]
[Site "Unknown site"]
[Date "2011.12.28"]
[Round "-"]
[White "Unknown player"]
[Black "Unknown player"]
[Result "1/2-1/2"]

1 e4 c5 2 Nf3 d6 3 d4 cxd4 4 Nxd4 Nf6 5 Nc3 a6 6 Be3 e5 7 Nf3 Qa5 8 Qd2 Qc7 9 a4 Nbd7 10 b4 Nb6 11
Qd3 d5 12 Bd2 Bxb4 13 Nxd5 Nbxd5 14 exd5 e4 15 Qc4 Bd6 16 Ng5 Bxh2 17 Nxf7 Kxf7 18 d6+ Qxc4 19
Bxc4+ Be6 20 Bxe6+ Kxe6 21 Rxh2 Kxd6 22 Bf4+ Kc5 23 Rh3 Kc4 24 a5 Rhd8 25 Rb3 Rd7 26 Rab1 Nd5 27
Bg3 Rad8 28 Rxb7 Nc3 29 Rxd7 Rxd7 30 Rc1 Kb4 31 Be5 Na4 32 Rb1+ Kxa5 33 Bf4 Nc5 34 Bd2+ Ka4 35 Rb4+
Ka3 36 Rc4 Nb7 37 Rxe4 Kb2 38 Rc4 Nd6 39 Rc6 Ne4 40 Be3 Nc3 41 Bd2 Ne4 42 Ba5 Rd5 43 Rxa6 Kxc2 44
f3 Nc3 45 Bc7 Rd2 46 Kf1 Rd1+ 47 Kf2 Rd2+ 48 Kg3 Rd5 49 Rc6 g6 50 Bd6 Kd3 51 Bb4 Ne2+ 52 Kf2 Rb5 53
Be1 Nf4 54 Bc3 Rg5 55 g4 h5 56 Bf6 Rb5 57 Ra6 Nd5 58 Bg7 hxg4 59 fxg4 g5 60 Re6 Rb7 61 Bh8 Rf7+ 62
Kg3 Nf4 63 Rd6+ Kc4 64 Be5 Ne2+ 65 Kg2 Nf4+ 66 Kg3 Ne2+ 67 Kh2 Nf4 68 Rc6+ Kd5 69 Rc7 Rxc7 70 Bxc7
Ke4 71 Kg3 Nd5 72 Bd6 Nf6 73 Kh2 Nxg4+ 74 Kg1 Kd3 75 Ba3 Kc2 76 Bb4 Kb1 77 Ba3 Ka1 78 Bb4 Ka2 79
Ba5 Ka1 80 Bb4 Ka2 81 Ba5 Ka1 82 Bb4 1/2-1/2