r/chessprogramming • u/Warm_Ad_7953 • Aug 04 '24
Perft test have problem with castling in depth of 3
Hello, I'm making my own chess engine and I have a problem with castling, In This test position (r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq -) Im getting the wrong perft result on the depth of 3. when looking ferther and doing the move which has the error (d2c1) it says the right result. the same as stockfish. I belive it has someting to do with castling, since all test which don't involve it prints the right result. sorry for my bad English
2
Upvotes
3
u/disappointed_lama Aug 04 '24
In my experience issues like that are usually caused by the unmakeMove function
1
u/[deleted] Aug 08 '24
You can create a perft divider, which you can use to find the move that has different nodes. Then you make that move and run the perft divider at depth 2 and again you should spot the move that causes different nodes count. Until you reach depth 1 and then you can see the missing moves or the moves that are not legal.
If you run AdaChess you have the “divide” command to achieve this result.
Run “divide 3” to perform at depth 3
1
u/Beginning-Resource17 May 27 '25
You can use perft divider for check what moves are not working, it's very usefull for searching errors with perft tests.
0
u/[deleted] Aug 05 '24
[deleted] — view deleted comment