crafty question

Discussion of chess software programming and technical issues.

Moderator: Ras

Cardoso
Posts: 363
Joined: Thu Mar 16, 2006 7:39 pm
Location: Portugal
Full name: Alvaro Cardoso

crafty question

Post by Cardoso »

Hi,
I noticed that in iterate.c crafty doesn't allways start iterating with 1 ply depth.
It can start with iteration depth 1 plus the last pv depth.
Will this allways be the case? That is will it allways do that everytime it searches a move?
If it would allways start with 1 ply depth would that be wrong?
In what cases will it start with iteration depth = 1 ?
When we start a new game?
When we setup a position?

best regards,
Alvaro
Aleks Peshkov
Posts: 892
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia

Re: crafty question

Post by Aleks Peshkov »

I am not connected with Crafty in any way, but can try to give a quick answer.

Code: Select all

      shared->iteration_depth = 1;
      if (last_pv.pathd > 1)
        shared->iteration_depth = last_pv.pathd + 1; 
Crafty store PV from previous search, if it got an opponent move that predicted by last PV, Crafty can continue deepening from the place it stopped before. This can happen regardless pondering mode on or off.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: crafty question

Post by bob »

Cardoso wrote:Hi,
I noticed that in iterate.c crafty doesn't allways start iterating with 1 ply depth.
It can start with iteration depth 1 plus the last pv depth.
Will this allways be the case? That is will it allways do that everytime it searches a move?
If it would allways start with 1 ply depth would that be wrong?
In what cases will it start with iteration depth = 1 ?
When we start a new game?
When we setup a position?

best regards,
Alvaro
Think about it for a minute. You complete a 14 ply search, and play the first move, and on a ponder search, you assume your opponent plays the second move. Leaving you 12 plies left of the original search. Why repeat the first twelve plies again? So it starts at 13 and goes forward...

On a mis-predicted search, it always starts at ply=1 of course...