Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 22 Dec 2010
Offline Last Active Sep 18 2013 01:16 AM

Posts I've Made

In Topic: UCI based chess Engine : Some questions.

03 June 2013 - 12:17 PM

Thanks for the reply.
I setup this position r1bqkb1r/1p1p1ppp/p1n1p1n1/4P3/2B5/2N2N2/PP3PPP/R1BQR1K1 b kq - 0 9
In the first round, I didnot search in QSearch as the condition ply>=maxPly would fail and it wouldn't proceed with generation of Capture moves.
In the second round I added Qsearch with addition of 5 plys to search. So if at depth 5 it went to QSearch then it would search in Qsearch for 5+5 = 10 plys.
and got the following results on the first day and I also noted that my machine (Dell Studio Laptop was heated up pretty much).
Without QSearch.
Depth Nodes Time(msecs) kNodes/Sec
1 36 131 0.27
2 1757 160 10.98
3 7689 336 22.88
4 136953 2743 49.92
5 604808 17768 34.039
6 11339038 207256 54.71
With QSearch
Depth Nodes Time(msecs) kNodes/Sec
1 1087 239 4.54
2 13289 543 24.47
3 103435 2864 36.11
4 1313863 28137 46.49
5 7980765 175669 45.43
6 57394529 1266073 45.33
Here are the results after second day when laptop didn't heat up much.
Without QSearch.
Depth Nodes Time(msecs) kNodes/Sec
1 36 16 2.25
2 1757 19 92.47
3 7689 37 207.81
4 136953 288 475.53
5 604808 1742 347.19
With QSearch
Depth Nodes Time(msecs) kNodes/Sec
1 1087 17 63.94
2 13289 43 309.04
3 103435 242 427.41
4 1313863 2715 483.92
5 7980765 17249 462.67

I think this is a hardware + programming efficiency issue.

Please comment as to how can I improvise this.

In Topic: UCI based chess Engine : Some questions.

02 June 2013 - 01:41 AM

Thanks for replying.

Can you comment on the speed of  the engine when it take max 30 secs to play a move at 5 plys and further 5 plies at QSearch(Without MVV/LVA or any sorting).

I asked you this as I would like to know if I don't have anything terribly wrong going on.

I ran perft suite as my unit test suite, had no findings.

I think I have messed up some where in make moves that come from GUI through UCI protocol. May be its missing some checks and other feature.

I would check on those by printing some display boards. 

In Topic: UCI based chess Engine : Some questions.

01 June 2013 - 11:12 AM

Hi alvaro, thanks for replying.

I implemented the move logic without considering 3 move repetitions which is going to be my next priority.


Here is a game that it played at maxDepth 5 without any sophistication not even killers or anything of that sort, plain alpha beta with very crude static evaluation.

it took about 15 secs to make a move on an average.


Here is the first game where it played with white.
1. d4 e6 2. e4 Nc6 3. Nc3 Bb4 4. Nf3 Nf6 5. e5 Ne4 6. Bd2 Nxd2 7. Qxd2 O-O
8. Bb5 d5 9. Bxc6 bxc6 10. O-O-O Bb7 11. Rhe1 a5 12. g4 f6 13. g5 fxe5 14.
Nxe5 Bd6 15. a3 g6 16. f4 a4 17. h3 Qe7 18. h4 Qg7 19. Qe3 Rfe8 20. Ng4 Kf8
21. Kb1 Re7 22. Qf2 Qh8 23. Qf3 Qg7 24. Qf2 Qh8 25. Qf3 Qg7 26. Qf2 {3-fold
repetition} 1/2-1/2
Here is the second game, playing with black.
1. g3 d5 2. Nf3 e6 3. Nc3 d4 4. Nb5 Nc6 5. e3 e5 6. exd4 exd4 7. c3 Bg4 8.
Qe2+ Be7 9. Nbxd4 Nxd4 10. cxd4 c6 11. Bg2 Bxf3 12. Bxf3 Qxd4 13. Qe3 O-O-O
14. Qxd4 Rxd4 15. h4 Nf6 16. b3 Rhd8 17. a4 Bb4 18. Ra2 Rd3 19. Bd1 Ne4 20.
Bg4+ Kb8 21. Bf5 Re8 22. O-O Bc5 23. Kg2 Rxb3 24. Bxh7 g6 25. Re1 Bxf2 26.
Rxe4 Rxe4 27. Kxf2 Rd3 28. Bg8 f5 29. Bh7 Rc4 30. Ra1 Rg4 31. h5 Rgxg3 32.
hxg6 Rg4 33. Ke2 Rd5 34. a5 Re5+ 35. Kf3 Rd5 36. Bg8 Rd6 37. Bf7 a6 38. Ra3
Rg1 39. Rc3 Rd8 40. d3 Rf1+ 41. Kg2 Re1 42. Kf2 Rh1 43. Bf4+ Ka8 44. g7 Rh4
45. Bc7 Rc8 46. g8=Q Rh2+ 47. Bxh2 b6 48. Qxc8 {Arena Adjudication. Illegal
move!} 1-0

There was a time when I actually thought that my program was pressing the game, but then as it is clear from the game, I have messed up with some move making issues which as of now I would be checking.



In Topic: UCI based chess Engine : Some questions.

31 May 2013 - 01:52 PM

Hi all, Thanks for replying.


I faced this question as I programmed by Engine to setup board via FEN and not by move input.

I don't really keep track of game specs like castling and enpassant squares on move by move basis, but rather break the fen and adjust all parameters accordingly.


I am using Arena as GUI. Is there any setting where in I can just tweak it to send me the FEN instead of moves, but then again I wouldn't be able to keep track of 3-repetition draws.


If I go with the move approach, then I have to convert the physical move to logical 64 bit-bit-board move, adjust all the flags and so on.

So is this worth or is there anything else which I am missing.

In Topic: Chess Programing: Request for Code Review.

02 January 2013 - 10:33 AM

I have written two chess engines when I first began to code about year ago.

Both were 0x88 based and I wasnt pleased with the performance I got from them (4 plys in about 4-5 mins).

So you were getting 4 plys in 4 or 5 minutes, when it should have taken a fraction of a second. Then you must have decided that the problem was the board representation, but this is not correct. You can make 0x88-based engines that are really fast.
So from your post I think I am heading the wrong way and attack boards would make my evaluation slow (but I cant see how)
You are reading too much into my post. I was just pointing out that you are going about this the wrong way, and you shouldn't try to optimize the speed of perft. You should find out why your engine was taking minutes to reach 4 plys. Dynamic memory allocation is an obvious thing to get rid of, but I guess you were doing something else completely wrong.


Yes, its just that I have lost the code, so as it is I was trying to code something new. I have never felt or mentioned that 0x88 engines are slow or something like that.

The main reason of shifting to bitboards was the thrill. The thrill in representing entire chess board in just one unsigned long. Another reason for myt 0x88 engine was slow because I scanned for material (looped the board) everytime, rather I could just keep count and so on.. 0x88 is an excellent scheme for representation (at first I was pleasantly surprised with the idea alone of sq&0x88.)

Ok then I think I should go on writing this as complete chess engine and then come back for optimization. 


PS: Its just that I am not schooled formally in computer, I developed liking for computers and studied through books like Introduction to Algorithms during spare time.

So there might me some issues with the way I think. I hope I am not asking too much.