so i did full kind of perft, no bulk counting of last depth it's about 3.5 millions instead of 87
my thing suck haha
Moderator: Ras
Code: Select all
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -


Code: Select all
A B C D E F G H
1 R N B Q K B N R Kind of perft: Full Perft, doing all move/undo to the last depth
2 P P P P P P P P Started 6 depths at 2021-03-06 00:11:17 finished at 2021-03-06 00:11:23
3 ■ ■ ■ ■ ■ ■ ■ ■ FEN: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -
4 ■ ■ ■ ■ ■ ■ ■ ■
5 ■ ■ ■ ■ ■ ■ ■ ■ Expected Moves : 119,060,324
6 ■ ■ ■ ■ ■ ■ ■ ■ Total Moves Done : 119,060,324
7 p p p p p p p p Time Taken : 5,656ms
8 r n b q k b n r Moves per second : 21,050,269
if you look at first screenshot, you can see that there is about 81 million call to my pseudo move method but my perft didnt calculated these move
also, i saw your link in your signature, i don't know if you ever did a profiling run on your engine, here is one with peft 5

How would you do perft non-recursively? You could create a move list, and then on move one, generate a new move list and stick it in front of the first one. That way you could go breadth-first instead of depth-first, but that would not be faster. You still have to go through all the moves.
Thanks for taking the time to look into my code! Much appreciated. What tool are you using for the profiling?spirch wrote: ↑Sun Mar 07, 2021 2:26 am also, i saw your link in your signature, i don't know if you ever did a profiling run on your engine, here is one with peft 5![]()
i don't know anything about the code but first thing i would say, remove the recursive call to perft, there is a cost there but you can also look at some hotspot and see if there anything to do there to optimize it
It is the logical conclusion: people will add features to their engines, and so many engines will grow towards one another. In the end when engines have the same features, speed is the last bastion technical thing where engines differentiate.
Optimizations/extra features do make the engine more complicated indeed, because these features are used for speed-up only (caching/storing intermediate stuff, etc...), and not for pure chess playing.But I won't try to optimize Minimal Chess retroactively for speed because there *is* a price to be paid for every optimization. It doesn't fit my vision for it. My next chess engine, if I stick with this surprisingly addictive hobby, will be more ambitious in that regard.
c# and recursion when you look at pure optimization is tricky, I will let you do the search on your preferred online search engine.mvanthoor wrote: ↑Sun Mar 07, 2021 11:24 amHow would you do perft non-recursively? You could create a move list, and then on move one, generate a new move list and stick it in front of the first one. That way you could go breadth-first instead of depth-first, but that would not be faster. You still have to go through all the moves.
