Perft
-
- Posts: 12
- Joined: Wed Dec 03, 2008 18:52
-
- Posts: 12
- Joined: Wed Dec 03, 2008 18:52
-
- Posts: 859
- Joined: Sat Apr 28, 2007 14:53
- Real name: Ed Gilbert
- Location: Morristown, NJ USA
- Contact:
-
- Posts: 859
- Joined: Sat Apr 28, 2007 14:53
- Real name: Ed Gilbert
- Location: Morristown, NJ USA
- Contact:
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
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
-
- Posts: 12
- Joined: Wed Dec 03, 2008 18:52
Hi Pascal,
Taking back the following position with saw from the Woldouby position :
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
Duplicate moves are moves with same "initial square", same "end square" and same "captured pieces". The only difference is the order of the captures.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
Taking back the following position with saw from the Woldouby position :
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
-
- Posts: 859
- Joined: Sat Apr 28, 2007 14:53
- Real name: Ed Gilbert
- Location: Morristown, NJ USA
- Contact:
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
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
-
- Posts: 12
- Joined: Wed Dec 03, 2008 18:52
-
- Posts: 12
- Joined: Wed Dec 03, 2008 18:52
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
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
-
- Posts: 1722
- Joined: Wed Apr 14, 2004 16:04
- Contact:
HI Pascal,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
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
-
- Posts: 12
- Joined: Wed Dec 03, 2008 18:52
Hi Pascal,
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
I do not understand you question.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
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
-
- Posts: 12
- Joined: Wed Dec 03, 2008 18:52
- FeikeBoomstra
- Posts: 306
- Joined: Mon Dec 19, 2005 16:48
- Location: Emmen