Showing posts with label Tinychess. Show all posts
Showing posts with label Tinychess. Show all posts

Tuesday, October 19, 2010

Tinychess changes its name, now it will be called ChessKISS

I've found out that there is another project called TinyChess, so well, expect a new version very soon

Wednesday, October 13, 2010

Tiny chess VS Crafty

What happened had to happen:

-----------------Crafty_1815_P4_SMP-----------------
Crafty_1815_P4_SMP - TinyChess : 3,0/3 3-0-0 (111) 100% +1200
-----------------TinyChess-----------------
TinyChess - Crafty_1815_P4_SMP : 0,0/3 0-3-0 (000)   0% -1200


No chance to win...

Finally, Gerbil beaten

Well, don't even consider TinyChess as a good engine, I don't post the losses, I'm just happy that I win sometimes some engines better than mine...

Look at some search numbers, TinyChess went to deep 14 with searching 303.303 nodes while Gerbil searched 8.068.442 nodes at deep 11, strange, right?

Another weird thing is the nodes per second that Arena counts for TinyChess:


21:33:34, Send: 1 1455 0 43 g2xh3 Kg6f7 
21:33:34, Send: 2 1455 0 47 g2xh3 Kg6f7 a7 
21:33:34, Send: 3 1455 0 129 g2xh3 Kg6f7 a7 Kf7e6 
21:33:34, Send: 4 1455 0 211 g2xh3 Kg6f7 a7 Kf7e6 Bd6e5 
21:33:34, Send: 5 1455 0 331 g2xh3 Kg6f7 a7 Kf7e6 Bd6e5 Ke6f5 
21:33:34, Send: 6 1455 16 483 g2xh3 Kg6f7 a7 Kf7e6 Bd6e5 Ke6f5 a8=Q 
21:33:34, Send: 7 1455 0 2257 g2xh3 Kg6f7 a7 Kf7e6 Bd6e5 Ke6f5 a8=Q Kf5e6 
21:33:34, Send: 8 1455 16 4252 g2xh3 Kg6f7 a7 Kf7e6 Bd6e5 Ke6f5 a8=Q Kf5e6 Qa8g8 
21:33:34, Send: 9 1520 15 7528 g2xh3 Kg6f7 a7 Kf7e6 Bd6e5 Ke6f5 a8=Q Kf5e6 Qa8g8 Ke6d7 
21:33:34, Send: 10 1520 32 11876 g2xh3 Kg6f7 a7 Kf7e6 Bd6e5 Ke6f5 a8=Q Kf5e6 Qa8g8 Ke6d7 Qg8f7 
21:33:34, Send: 11 1520 62 23351 g2xh3 Kg6f7 a7 Kf7e6 Bd6e5 Ke6f5 a8=Q Kf5e6 Qa8g8 Ke6d7 Qg8f7 Kd7c6 
21:33:34, Send: 12 1520 94 42029 g2xh3 Kg6f7 a7 Kf7e6 Bd6e5 Ke6f5 a8=Q Kf5e6 Qa8g8 Ke6d7 Qg8f7 Kd7c6 Qf7f6 
21:33:35, Send: 13 1540 469 150661 g2xh3 Kg6f7 a7 Kf7e6 Bd6e5 Ke6d7 a8=Q Kd7e7 Qa8e4 Ke7d7 Qe4xh4 Kd7e6 Qh4f6 Ke6d7 
21:33:35, Send: 14 1560 640 303303 g2xh3 Kg6f7 a7 Kf7e6 Bd6e5 Ke6d7 a8=Q Kd7e7 Qa8a3 Ke7d7 Qa3d6 Kd7e8 Be5f6 Ke8f7 Qd6e7 


The sum of movements is 546.501 in one second, so nodes search per second equal 546.501, not 47.391 as Arena says..., strange


I'm going to prove a loss of TinyChess, the opponent will be Crafty, so for sure I know the result,  I will post it in a few minutes.

A new victim, BigLion

After all, the engine is not that bad...

I created last night a tournament among all available engines, I will show the results in another post.

Tiny chess VS BigLion

Definitely, this engine is better than ours, but the engine manage to achieve a draw in this tricky game, but the whole game the engine was behind:

There are two visible problems, the infamous repetition bug and the memory consumption (almost 1GB), I'm not deleting the old entries in the transposition tables, but I should...

Tuesday, October 12, 2010

Big bug in TinyChess

Today things were going well in this position against Piranha, but as you can see in the bars the advantage dissapeared:

The good move would be Re1c1 to cover the promotion, but strangely the engine played Re1f7+ ???, it turns out that the function GetCaptures() had a bug (this function is called by InCheck()), the promotions and enPassants are created directly in the movelist while captures go throught the bitboard test, the bitboard test take cares of the special parameter aIndex (which means I'm only interest in captures to that specific square) while the promotion and EnPassant did not, so the following changes has been added:


//Promotion
if (aIndex = -1) and (row = 7) and (not bit._GetBit(BoardBitboard, idx)) then
  result.Add(TMoveHelper.Pack(piece.PieceType, piece.Index, idx, actPromote));

//En passant left
pawn := GetPiece(piece.Index - 1);
if pawn <> nil then
  idx2 := pawn.Backward(1);

if (pawn <> nil) and (FData.EnPassant <> nil) and (pawn.Side <> aSide) and (pawn = FData.EnPassant) and
   (GetPiece(idx2) = nil) then
begin
  if (aIndex = -1) or (aIndex = idx2) then            
    result.Add(TMoveHelper.Pack(piece.PieceType, piece.Index, idx2, actEnPassant);
end;
After applying the patch:
21:16:14, Send: 1 435 0 67 c8=Q Rd7xb7 
21:16:14, Send: 2 425 16 372 c8=Q Rd7xb7 Kb1a1 
21:16:14, Send: 3 425 0 503 c8=Q Rd7xb7 Kb1a1 
21:16:14, Send: 4 360 16 2279 c8=Q Rd7xb7 Kb1a1 Rb7a7 Ka1b1 
21:16:14, Send: 5 360 31 3932 c8=Q Rd7xb7 Kb1a1 Rb7a7 Ka1b1 Ra7a3 
21:16:14, Send: 6 360 94 15183 Rf1c1 Kg7f6 c8=Q Rd7xb7 Kb1a1 Rb7a7 Ka1b1 
21:16:14, Send: 7 360 187 37880 Rf1c1 e5 Rb7a7 Rd7xc7 Rc1xc7 Re7xc7 Ra7xc7 Kg7f6 
21:16:15, Send: 8 360 469 88674 Rf1c1 e5 Rb7a7 Rd7xc7 Rc1xc7 Re7xc7 Ra7xc7 Kg7f6 
21:16:15, Send: 9 365 734 207251 Rf1c1 e5 Rb7a7 Rd7xc7 Rc1xc7 Re7xc7 Ra7xc7 Kg7f6 Kb1c2 e4 
21:16:17, Send: 10 365 1532 427565 Rf1c1 e5 Rb7a7 Rd7xc7 Rc1xc7 Re7xc7 Ra7xc7 Kg7f6 Kb1c2 e4 
The proper movement is done at depth 6.
Well, that's life

Tiny chess VS Mediocre

I think I was lucky in this game against Mediocre (ELO 2142), somehow the engine manage to push the black king to middle left part of the board.




1. e4 e5
2. Nf3 Nc6
3. Bb5 a6
4. Ba4 Nf6
5. O-O Be7
6. Re1 b5
7. Bb3 O-O
8. c3 d6
9. h3 Na5
10. Bc2 c5
11. d4 exd4
12. cxd4
13. Kh1
14. Nbd2
15. exd5
16. Ne4
17. Nxd4
18. Qf3
19. Nxf6+
20. Qf5
21. Bxe4
22. Qxh7+
23. Bd5
24. Bg5
25. Qg8+
26. Qf7+
27. Qe6+
28. Be3+
29. Bd2+
30. bxc3+
{(b2xc3+ Be5xc3 Re1e4+ Na5c4 Ra1b1+ Kb4a3 Qe6xa6+ Bc3a5) +17.70/7 5} Bxc3
 {(Be5xc3 Re1e4+ Rc8c4 Qe6e7+ Kb4a4 Bd5xc4 b5xc4 Qe7xd8 Bc3xd2 Qd8xd2) -17.31/9 4}
31. ... {1-0 Arena Adjudication}
1-0

Monday, October 11, 2010

Tiny chess VS SlowChess

You cannot always win...


...Still a long way to go

Tiny chess VS Piranha

Another surprising victory...

:-)

Speed improvements on TinyChess

A week ago or so I post this log, searching to depth 10 from inital position:

11:20:31, Send: 1 57 0 43 Ngf3 
11:20:31, Send: 2 0 0 227 Ngf3 Ngf6
11:20:31, Send: 3 57 0 503 Ngf3 Ngf6 Nbc3
11:20:31, Send: 4 0 31 2208 Ngf3 Ngf6 Nbc3 Nbc6
11:20:31, Send: 5 27 31 4100 Ngf3 Ngf6 Nbc3 Nbc6 e3
11:20:31, Send: 6 13 141 12055 Nbc3 Nbc6 d4 Ngf6 e4 e6
11:20:31, Send: 7 29 500 39259 Nbc3 Nbc6 Ngf3 Ngf6 e3 d5 Bfd3
11:20:33, Send: 8 10 1734 137817 Nbc3 Ngf6 Ngf3 Nbc6 e3 d5 Bfb5 Bcd7
11:20:36, Send: 9 24 2438 246414 Nbc3 Ngf6 Ngf3 Nbc6 d4 d5 Bcf4 Bcf5 e3
11:20:45, Send: 10 31 9594 624118 Nbc3 Nbc6 Ngf3 e6 e4 Bfb4 Bfd3 Bbxc3 dxc3 Ngf6 



As you can see it took 14 seconds, well this weekend I had to lunch a bunch of processes at work, so meanwhile I had time to deal with speed, compare to this:



10:09:19, Send: 1 55 0 43 Ng1f3 
10:09:19, Send: 2 0 0 223 Ng1f3 Ng8f6 
10:09:19, Send: 3 55 0 473 Ng1f3 Ng8f6 Nb1c3 
10:09:19, Send: 4 0 15 2036 Ng1f3 Ng8f6 Nb1c3 Nb8c6 
10:09:19, Send: 5 20 0 3885 Ng1f3 Ng8f6 Nb1c3 Nb8c6 e3 
10:09:19, Send: 6 0 141 21194 Ng1f3 Nb8c6 Nb1c3 Ng8f6 e3 e5 
10:09:19, Send: 7 25 94 38454 Ng1f3 Nb8c6 Nb1c3 Ng8f6 e3 e5 Bf1d3 
10:09:20, Send: 8 0 609 123812 Ng1f3 Ng8f6 d4 d5 Nb1c3 Nb8c6 Bc1e3 Bc8f5 
10:09:21, Send: 9 17 1125 258263 Ng1f3 Ng8f6 d4 d5 Nb1c3 Nb8c6 e3 Nf6e4 Nc3b5 
10:09:23, Send: 10 15 2500 534927 Ng1f3 Ng8f6 d4 Nb8c6 Nb1c3 d5 e3 Nf6e4 Nc3xe4 d5xe4 


Now the same depth is achieved with only 4,5 seconds (the movements are different since many changes were done), this is 219.293 nodes per second. I'm very satisfied with the results, but this is not finish, the new GenerateAllMoves() totally based on bitboards is on the way, I expect a big performance increase. These were the changes:

  • Bitboards are generated gradually
  • Pieces are generated gradually
  • Evaluation was refactored 

Tiny chess VS Tscp181, part 2

Definitely there is an error in the check repetition code, shame on me...



Time to sleep

Tiny chess VS Roce

Today I play against this engine for the first time and we end up in a draw due to threefold repetition (I think the code does not cover properly this situation)


I'm quite happy about that

Sunday, October 10, 2010

Tiny chess VS Gerbil

Bad news, I miserably loose against this engine:


Looks like and do not encourage the engine very much to move pawns... (three of them still not moved)

Tiny chess VS Mscp

I never tried this engine before (although I know is not strong), but you never know what your creature is going to do...

Finally I won...


By the way, I've notice that under some engines the performance was bad, the reason behind is that those engines make "Pondering" (use your time to think, quite tricky...), I launch both opponents in same machine, so I share the CPU while thinking.

Saturday, October 9, 2010

Tiny chess VS Tscp181

I'm glad that I've reach a point in which TinyChess beats Tscp181 quite often (the longer the game the more possibilities has TinyChess), next milestone is to beat Mediocre Chess at least once... :-)

Today the engine made a mistake against Tscp181 in this position:
As you can see whites have more pieces in the board, but the oponent manage to promote the pawn at a4, so at the end he won, I will have revisit the section code that analizes open ranks.

Today the results were:

  • TinyChess 1,5
  • Tscp         2,5