Perft

Discussion about development of draughts in the time of computer and Internet.
Post Reply
TAILLE
Posts: 968
Joined: Thu Apr 26, 2007 18:51
Location: FRANCE

Post by TAILLE » Mon Dec 08, 2008 00:11

Hi Pascal,

22x22 is correct and the only move but after that it exists only 6 moves (not 7)
Image

Gérard

pascaljunq
Posts: 12
Joined: Wed Dec 03, 2008 18:52

Post by pascaljunq » Mon Dec 08, 2008 00:59

Gerard,

you are right, 7 is the nodes for perft 2

After 25-20 24-15 33-29 18-22 29x20 22x22

Perft2 20-14 nodes 1
Perft2 30-25 nodes 1
Perft2 30-24 nodes 1
Perft2 32-28 nodes 1
Perft2 32-27 nodes 2
Perft2 34-29 nodes 1
perft2 sum 7 (instead of 9)

Have a good night

Pascal

pascaljunq
Posts: 12
Joined: Wed Dec 03, 2008 18:52

Post by pascaljunq » Mon Dec 08, 2008 01:31

Gerard,

I have fix the bug !

The issue was in make procedure in case of loop (ie 22x22).
Thank you very much for your help.

Pascal

Ed Gilbert
Posts: 859
Joined: Sat Apr 28, 2007 14:53
Real name: Ed Gilbert
Location: Morristown, NJ USA
Contact:

Post by Ed Gilbert » Mon Dec 08, 2008 03:18

Rein Halbersma wrote: Ed, what is your breakdown?
Rein, I'm guessing you want perft times with 1 and 2 calls to the move generator.

Start: 31.72, 60.28
Random: 18.20, 34.39
Woldouby: 9.02, 16.72

-- Ed

Ed Gilbert
Posts: 859
Joined: Sat Apr 28, 2007 14:53
Real name: Ed Gilbert
Location: Morristown, NJ USA
Contact:

Post by Ed Gilbert » Mon Dec 08, 2008 03:33

Pascal,

Does your move generator remove all duplicate moves, i.e. moves that take a different capture path but end up with the same result board? A good test for that is this position:

B:BK17,K24:W6,9,10,11,20,21,22,23,30,K31,33,37,41,42,43,44,46

At perft depth 9 you should have 1216917193 nodes.

-- Ed

pascaljunq
Posts: 12
Joined: Wed Dec 03, 2008 18:52

Post by pascaljunq » Mon Dec 08, 2008 22:11

Ed,

I try to remove duplicates move but it sounds not good.

For a position, duplicate moves are moves with same "initial square" and same "end square".

is it true ?

if not, could you give me an example please.

Pascal

TAILLE
Posts: 968
Joined: Thu Apr 26, 2007 18:51
Location: FRANCE

Post by TAILLE » Mon Dec 08, 2008 23:44

Hi Pascal,
pascaljunq wrote:Ed,

I try to remove duplicates move but it sounds not good.

For a position, duplicate moves are moves with same "initial square" and same "end square".

is it true ?

if not, could you give me an example please.

Pascal
Duplicate moves are moves with same "initial square", same "end square" and same "captured pieces". The only difference is the order of the captures.
Taking back the following position with saw from the Woldouby position :
Image
Black to move.

In this position the move generator will find two following capture suites :
22x31x42x33x22 and 22x33x42x31x22
These two moves are in fact duplicate moves. It is of course possible to keep this moves as separate moves (the second move will take the result of the first one by using the hash table) but it is quite easy to simply eliminate one of them in the move generator itself.

Gérard

Ed Gilbert
Posts: 859
Joined: Sat Apr 28, 2007 14:53
Real name: Ed Gilbert
Location: Morristown, NJ USA
Contact:

Post by Ed Gilbert » Tue Dec 09, 2008 00:22

Pascal,

In this position,

B:BK17,K24:W6,9,10,11,20,21,22,23,30,K31,33,37,41,42,43,44,46

black has 14 unique moves. But if you count each different way to do the captures as separate moves, your move generator might list as many as 530 different moves. It is best to eliminate these redundant moves in your move generator so that your movelist structure does not need to have space for so many moves.

-- Ed

pascaljunq
Posts: 12
Joined: Wed Dec 03, 2008 18:52

Post by pascaljunq » Tue Dec 09, 2008 19:07

Ed,

I tried your postion and results are :

perft : 1 Nodes : 14
perft : 2 Nodes : 55
perft : 3 Nodes : 1168
perft : 4 Nodes : 5432
perft : 5 Nodes : 87195
perft : 6 Nodes : 629010
perft : 7 Nodes : 9041010
perft : 8 Nodes : 86724219
perft : 9 Nodes : 1216917193

Is it correct ?

Pascal

pascaljunq
Posts: 12
Joined: Wed Dec 03, 2008 18:52

Post by pascaljunq » Tue Dec 09, 2008 19:39

Gérard,

I 'd like to refine my question :

In my move generator recursive procedure, after calculating a move, I check if it's a duplicate move. To do that, i check if a previous move was find with same "initial square" and same "final square" and same captured count.

Is it correct or may I also check that captured pieces are the same (with other sequence or not) ?

Pascal

Rein Halbersma
Posts: 1722
Joined: Wed Apr 14, 2004 16:04
Contact:

Post by Rein Halbersma » Tue Dec 09, 2008 19:48

pascaljunq wrote:Gérard,

I 'd like to refine my question :

In my move generator recursive procedure, after calculating a move, I check if it's a duplicate move. To do that, i check if a previous move was find with same "initial square" and same "final square" and same captured count.

Is it correct or may I also check that captured pieces are the same (with other sequence or not) ?

Pascal
HI Pascal,

Your numbers in your previous post are correct, as you can confirm yourself from earlier posts in this thread.

You must indeed check whether the pieces are the same. It is possible that you capture two different sets of pieces that have the same size. See e.g. this position with white to move
<img src="http://fmjd.org/dias2/save/12288484086.png">

Another small thing: you don't have to check for duplicates if you just generate a capture that increase the maximum number of captured pieces (since it's the first one it is by definition unique) or if the number of captures is less than 3 (because you can only return to the From square if you capture 4 or more pieces).

Rein

pascaljunq
Posts: 12
Joined: Wed Dec 03, 2008 18:52

Post by pascaljunq » Tue Dec 09, 2008 21:33

Hi Rein,

Very clear.

is it possible to capture two different sets of pieces that have the same size with a draught ?

Pascal

TAILLE
Posts: 968
Joined: Thu Apr 26, 2007 18:51
Location: FRANCE

Post by TAILLE » Tue Dec 09, 2008 21:51

Hi Pascal,
pascaljunq wrote:Hi Rein,

Very clear.

is it possible to capture two different sets of pieces that have the same size with a draught ?

Pascal
I do not understand you question.

Image
In this diagram it is of course possible to capture two different sets of pieces that have the same size.

Could you clarify your question ?

Gérard

pascaljunq
Posts: 12
Joined: Wed Dec 03, 2008 18:52

Post by pascaljunq » Tue Dec 09, 2008 22:00

gerard,

is it possible to capture two different sets of pieces that have the same size with a draught (avec un pion) from the same initial square to the same final square ?

Rein proved (with previous diagram) that it is possible with a king

Pascal

User avatar
FeikeBoomstra
Posts: 306
Joined: Mon Dec 19, 2005 16:48
Location: Emmen

Post by FeikeBoomstra » Tue Dec 09, 2008 22:18

It's called a man in English. If you start with a square and extend the opposite branch with two legs in series, than you have two different routes to the same end-point.

Post Reply