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'm having trouble figuring out the root ply of crafty.
Is it 0 or 1?
It looks 1, but ply 0 is used also for generating moves, make/unmake moves, etc.
Could someone please tell me exactely in wich cases ply 0 is used?

many thanks,
Alvaro
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: crafty question

Post by bob »

Cardoso wrote:Hi,
I'm having trouble figuring out the root ply of crafty.
Is it 0 or 1?
It looks 1, but ply 0 is used also for generating moves, make/unmake moves, etc.
Could someone please tell me exactely in wich cases ply 0 is used?

many thanks,
Alvaro
If, by "root ply" you mean the OTB position in the real game, that is ply 0. But the search works from ply 1 only. And ply 1 is a dead copy of ply 0 in that regard, so...

always 1. If you are talking about the PV array, 0 is used to back up the PV to the main program. But for Crafty, ply starts at 1 and climbs, never dropping to 0 except when the search terminates.

ply 0 is the "master copy" of the castle status and such. I copy that to ply one and do the search. Ply 0 only gets modified by MakeMoveRoot() and UnmakeMoveRoot() as those values represent the current OTB game state.

Hope that helps.

Somewhat messy but I'm not going to try to clean it up and break everything. :)