Page 1 of 2

Contrived position for perft

Posted: Sun Apr 21, 2019 5:10 am
by Michael Sherwin
Does it cover all the possibilities? Has someone done a better one already? Any suggested changes?
[d]r3k2r/1bp2pP1/5n2/1P1Q4/1pPq4/5N2/1B1P2p1/R3K2R b KQkq c3 0 1
Thanks

Re: Contrived position for perft

Posted: Sun Apr 21, 2019 7:12 am
by lucasart
Michael Sherwin wrote: Sun Apr 21, 2019 5:10 am Does it cover all the possibilities? Has someone done a better one already? Any suggested changes?
[d]r3k2r/1bp2pP1/5n2/1P1Q4/1pPq4/5N2/1B1P2p1/R3K2R b KQkq c3 0 1
Thanks
nice one. pins are an important source of bugs. you should add more pins.

Re: Contrived position for perft

Posted: Sun Apr 21, 2019 8:29 am
by Michael Sherwin
lucasart wrote: Sun Apr 21, 2019 7:12 am
Michael Sherwin wrote: Sun Apr 21, 2019 5:10 am Does it cover all the possibilities? Has someone done a better one already? Any suggested changes?
[d]r3k2r/1bp2pP1/5n2/1P1Q4/1pPq4/5N2/1B1P2p1/R3K2R b KQkq c3 0 1
Thanks
nice one. pins are an important source of bugs. you should add more pins.
Bed time, I will work on that tomorrow! :D

Re: Contrived position for perft

Posted: Sun Apr 21, 2019 9:32 am
by JohnWoe
Sapeli says:

./sapeli -position fen r3k2r/1bp2pP1/5n2/1P1Q4/1pPq4/5N2/1B1P2p1/R3K2R b KQkq c3 0 1 -perft 6
depth 0 nodes 1 mnps 0.000 time 0.000
depth 1 nodes 60 mnps 0.000 time 0.000
depth 2 nodes 2608 mnps 0.000 time 0.000
depth 3 nodes 113742 mnps 14.218 time 0.008
depth 4 nodes 4812099 mnps 13.256 time 0.363
depth 5 nodes 202902054 mnps 13.964 time 14.530
###
nodes 207830564 mnps 14.304 time 14.530

Re: Contrived position for perft

Posted: Sun Apr 21, 2019 9:55 am
by lucasart
Michael Sherwin wrote: Sun Apr 21, 2019 8:29 am
lucasart wrote: Sun Apr 21, 2019 7:12 am
Michael Sherwin wrote: Sun Apr 21, 2019 5:10 am Does it cover all the possibilities? Has someone done a better one already? Any suggested changes?
[d]r3k2r/1bp2pP1/5n2/1P1Q4/1pPq4/5N2/1B1P2p1/R3K2R b KQkq c3 0 1
Thanks
nice one. pins are an important source of bugs. you should add more pins.
Bed time, I will work on that tomorrow! :D
How aboud this?
[D] r6r/1bp2pP1/R2qkn2/1P6/1pPQ4/1B3N2/1B1P2p1/4K2R b KQ c3 0
It adds pins of the 2 possible kinds:
* the normal pin, where from->to causes self-check through the vacated from square.
* the en-passant special case, where from->to causes self-check, through the square vacated by the captured enemy pawn.

There is actually a third kind of pin, but that only happens in Chess960. It's when you can't castle, because the castling rook is pinned.

Re: Contrived position for perft

Posted: Sun Apr 21, 2019 10:02 am
by Volker Annuss
Michael Sherwin wrote: Sun Apr 21, 2019 5:10 am Does it cover all the possibilities? Has someone done a better one already? Any suggested changes?
[d]r3k2r/1bp2pP1/5n2/1P1Q4/1pPq4/5N2/1B1P2p1/R1R1K2R b KQkq c3 0 1
After Rxa1 Rxa1 you have rook on A1 that has already moved so castling is impossible. But no rook has ever moved away from A1.

Re: Contrived position for perft

Posted: Sun Apr 21, 2019 10:31 am
by elcabesa
if my engine is not wrong those are the results:
1: 60
2: 2608
3: 113742
4: 4812099
5: 202902054
6: 8419356881

Re: Contrived position for perft

Posted: Sun Apr 21, 2019 10:37 am
by elcabesa
another possibile source of problem is the interaction of "pin" and en passant. I think this is rare but it can happen.
here an example where en passant capture is forbidden (fxe3)
[d]8/K7/8/8/2Q1Pp1k/8/8/8 b - e3 0 1

Re: Contrived position for perft

Posted: Sun Apr 21, 2019 11:31 am
by Maarten Claessens
elcabesa wrote: Sun Apr 21, 2019 10:31 am if my engine is not wrong those are the results:
1: 60
2: 2608
3: 113742
4: 4812099
5: 202902054
6: 8419356881
Sorry, but your engine is wrong. Perft 2 of the position "r3k2r/1bp2pP1/5n2/1P1Q4/1pPq4/5N2/1B1P2p1/R1R1K2R b KQkq c3 0 1"is 2659.

Re: Contrived position for perft

Posted: Sun Apr 21, 2019 12:25 pm
by lucasart
Maarten Claessens wrote: Sun Apr 21, 2019 11:31 am
elcabesa wrote: Sun Apr 21, 2019 10:31 am if my engine is not wrong those are the results:
1: 60
2: 2608
3: 113742
4: 4812099
5: 202902054
6: 8419356881
Sorry, but your engine is wrong. Perft 2 of the position "r3k2r/1bp2pP1/5n2/1P1Q4/1pPq4/5N2/1B1P2p1/R1R1K2R b KQkq c3 0 1"is 2659.
Well if you mistype the FEN and search a different position...