First Post here: I have a few questions...

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

voyagerOne
Posts: 154
Joined: Tue May 17, 2011 8:12 pm

First Post here: I have a few questions...

Post by voyagerOne »

I am another victim that got infected by the "chess programming bug".

Here are some questions that I hope somebody can enlighten me:

1. What is the general idea (logic) for switching game phase evaluation from middle to end? I couldn't find much information about this. I know it has to deal with pieces left and current ply but would like to hear some expert thoughts.

2. I noticed engine will display depth such as 10/16. Does the 16 represent quintessential depth?

3. Just using negaMax alpha beta,IID, move ordering and qSearch. What depth does one expect to reach in appropriate time (around 30s)? My engine currently reaches to depth 8 at 1600kns. Does this seem right?

Thanks in advance!
smatovic
Posts: 2658
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: First Post here: I have a few questions...

Post by smatovic »

Welcome to CCC Bill,
1. What is the general idea (logic) for switching game phase evaluation from middle to end? I couldn't find much information about this. I know it has to deal with pieces left and current ply but would like to hear some expert thoughts.
I am not an expert, but in an simple evaluation function the endgame could be defined as
Additionally we should define where the ending begins. For me it might be either if:

Both sides have no queens or
Every side which has a queen has additionally no other pieces or one minorpiece maximum.

http://chessprogramming.wikispaces.com/ ... n+function
3. Just using negaMax alpha beta,IID, move ordering and qSearch. What depth does one expect to reach in appropriate time (around 30s)? My engine currently reaches to depth 8 at 1600kns. Does this seem right?
1600 knps sounds fast, i remember once i have forgotten to count the qsearch nodes correct. When you call qsearch make sure you count the node only once.

IIRC my engine did search to a depth of 6 within 7 seconds with these techniques...
do you use an Internal Deepening Framework?


--
Srdja
Ron Murawski
Posts: 397
Joined: Sun Oct 29, 2006 4:38 am
Location: Schenectady, NY

Re: First Post here: I have a few questions...

Post by Ron Murawski »

voyagerOne wrote:I am another victim that got infected by the "chess programming bug".
Sorry to say, but your disease is incurable!
voyagerOne wrote: Here are some questions that I hope somebody can enlighten me:

1. What is the general idea (logic) for switching game phase evaluation from middle to end? I couldn't find much information about this. I know it has to deal with pieces left and current ply but would like to hear some expert thoughts.
Endgame is when material has dropped to the point where checkmate becomes difficult/impossible. This is the time to activate the king as an attacker. This cross-over point from middle to end usually means that each side, excluding pawns, has less material than a queen and a minor piece.
voyagerOne wrote: 2. I noticed engine will display depth such as 10/16. Does the 16 represent quintessential depth?
The 10/16 can represent one of two things:

1) 16 is the max depth actually searched (using extensions) to search 10-deep

2) The engine is currently searching the 10th of 16 possible legal moves

You need to show us the full context to determine the meaning.
voyagerOne wrote: 3. Just using negaMax alpha beta,IID, move ordering and qSearch. What depth does one expect to reach in appropriate time (around 30s)? My engine currently reaches to depth 8 at 1600kns. Does this seem right?
Search depth varies depending on the position. You would need to show us the fen position you are testing and what hardware it is running on so we could determine if your search depth is typical.
voyagerOne wrote: Thanks in advance!
Welcome to the board! :-)
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: First Post here: I have a few questions...

Post by tpetzke »

Hi and welcome,

1.6 Mio nodes per seconds is pretty fast, do you have an evaluation that takes cares of positional terms or just material and piece-square stuff ?

If you have a basic evaluation you will search in general more nodes than with a more advanced evaluation. The reason is that the best move from a ply 6 search is then more likely the same as it was with a ply 5 search. And when the best move is searched first you search less nodes.

I have a record of the performance of early version of my engine to give you an idea what different features are worth

They are from a fixed ply search against the same position

without any move ordering
iCE 0.1 build 96 [DEBUG] [2010.12.30]
position fen 3Q4/5q1k/4ppp1/2Kp1N1B/RR6/3P1r2/4nP1b/3b4 w - -
info depth 7 seldepth 30 time 712672 nodes 119147677 pv h5f3 f7c7 d8c7 h2c7 b4h4 h7g8 a4a8 nps 167184 score cp 503 hashfull 445 tbhits 0

with move ordering by see in search and qsearch
iCE 0.1 build 100 [DEBUG] [2010.12.31]
info depth 7 seldepth 20 time 8797 nodes 1959925 pv h5f3 f7c7 d8c7 h2c7 b4h4 h7g8 a4a8 nps 222794 score cp 503 hashfull 77 tbhits 0
info depth 8 seldepth 19 time 18672 nodes 1248484 pv h5f3 f7c7 d8c7 h2c7 b4h4 h7g8 a4a8 g8f7 nps 66863 score cp 503 hashfull 358 tbhits 0
info depth 9 seldepth 24 time 83078 nodes 16272319 pv h5f3 e2f4 f5d6 f7g7 b4f4 h2f4 a4f4 d1f3 f4f3 nps 195867 score cp 600 hashfull 699 tbhits 0

with LMR in ALL Nodes
iCE 0.1 build 116 [DEBUG] [2011.1.1]
info depth 7 seldepth 20 time 4343 nodes 583438 pv h5f3 f7c7 d8c7 h2c7 b4h4 h7g8 a4a8 nps 134339 score cp 503 hashfull 51 tbhits 0
info depth 8 seldepth 19 time 3891 nodes 516791 pv h5f3 f7c7 d8c7 h2c7 b4h4 h7g8 a4a8 g8f7 nps 132817 score cp 503 hashfull 94 tbhits 0
info depth 9 seldepth 24 time 28156 nodes 3475415 pv h5f3 e2f4 f5d6 f7g7 b4f4 h2f4 a4f4 d1f3 f4f3 nps 123434 score cp 600 hashfull 334 tbhits 0
info depth 10 seldepth 22 time 39703 nodes 4047212 pv h5f3 e2f4 f5d6 f7g7 b4f4 h2f4 f3d1 f4d6 d8d6 g7f7 nps 101937 score cp 600 hashfull 691 tbhits 0

with adaptive 0 move pruning enabled
iCE 0.1 build 120 [DEBUG] [2011.1.2]
info depth 7 seldepth 20 time 2906 nodes 188962 pv h5f3 f7c7 d8c7 h2c7 b4h4 h7g8 a4a8 nps 65024 score cp 503 hashfull 26 tbhits 0
info depth 8 seldepth 19 time 1172 nodes 74043 pv h5f3 f7c7 d8c7 h2c7 b4h4 h7g8 a4a8 g8f7 nps 63176 score cp 503 hashfull 35 tbhits 0
info depth 9 seldepth 24 time 11156 nodes 638186 pv h5f3 e2f4 f5d6 f7g7 b4f4 h2f4 a4f4 d1f3 f4f3 nps 57205 score cp 600 hashfull 108 tbhits 0
info depth 10 seldepth 22 time 7063 nodes 411899 pv h5f3 e2f4 f5d6 f7g7 b4f4 h2f4 f3d1 f4d6 d8d6 g7f7 nps 58317 score cp 600 hashfull 164 tbhits 0
info depth 11 seldepth 25 time 91734 nodes 13189595 pv h5f3 e2f4 f5d6 f7g7 b4f4h2f4 f3d1 g6g5 d3d4 f4d6 d8d6 nps 143780 score cp 601 hashfull 710 tbhits 0


Those early versions were not strong enough to find the correct move (b4b7) in a reasonable amount of time, but it shows the effect on the tree size of the different features.

Thomas...
mike_bike_kite
Posts: 98
Joined: Tue Jul 26, 2011 12:18 am
Location: London

Re: First Post here: I have a few questions...

Post by mike_bike_kite »

I also recently got infected by this chess programming disease. For comparison my little Java applet can only manage a rather sad 30k nps. Must admit I'm finding it hard fighting with the terminology though. Is there a definitions page showing what various terms mean ie negaMax, IID and qSearch are all new to me (or perhaps new words for already known concepts)? The FAQ doesn't seem to contain anything relevant.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: First Post here: I have a few questions...

Post by hgm »

A good source of basic info can befound at http://chessprogramming.wikispaces.com .

Negamax is an implementation of minimax that uses the same code in odd and even plies by flipping sign of the score.

IID = Internal Iterative Deepening,a search method that in every node of the tree where you don't have an idea what the best move could be, you first do a less deep search to get such an idea, before you search at the originally requested depth.

qSearch = QS = Quiescence Search, which in its simplest form only searches captures to see if their score exceeds that of the current position.
nkg114mc
Posts: 74
Joined: Sat Dec 18, 2010 5:19 pm
Location: Tianjin, China
Full name: Chao M.

Re: First Post here: I have a few questions...

Post by nkg114mc »

Ron Murawski wrote: Endgame is when material has dropped to the point where checkmate becomes difficult/impossible. This is the time to activate the king as an attacker. This cross-over point from middle to end usually means that each side, excluding pawns, has less material than a queen and a minor piece.
Hi, Ron. So can I understand it as that if the material of both side except pawns is equal or less than (a queen + a minor piece), then the game has entered into endgame phase generally. Is it correct?
Ron Murawski
Posts: 397
Joined: Sun Oct 29, 2006 4:38 am
Location: Schenectady, NY

Re: First Post here: I have a few questions...

Post by Ron Murawski »

nkg114mc wrote:
Ron Murawski wrote: Endgame is when material has dropped to the point where checkmate becomes difficult/impossible. This is the time to activate the king as an attacker. This cross-over point from middle to end usually means that each side, excluding pawns, has less material than a queen and a minor piece.
Hi, Ron. So can I understand it as that if the material of both side except pawns is equal or less than (a queen + a minor piece), then the game has entered into endgame phase generally. Is it correct?
Hi Chao,

Here is an example: If White has Q+N+pawns and Black has R+B+N+pawns, the White king can probably roam to any part of the board in safety, while the Black side should keep its king well protected. I'm sure there are exceptions to this rule, but it is true in the majority of cases.

Ron
nkg114mc
Posts: 74
Joined: Sat Dec 18, 2010 5:19 pm
Location: Tianjin, China
Full name: Chao M.

Re: First Post here: I have a few questions...

Post by nkg114mc »

Thanks very much for your reply, Ron! :) ~