OK; so this is bulk counting. I could add this to my engine easily as an option... but I'm hesitant about it because it doesn't do anything for playing chess. You can't NOT include those leaves in your move lists when you're playing, of course ... in perft, you can just count the length of the list and throw it away because you know all moves will be legal.
Maybe I'll add it just to see what perft speed would become... and then take it out again. Or make it an option for people who'd want to test with it. I'd like my perft to be brute force to test everything down to the last leaf.
Don't know if I'm missing anything, but I see the following node counts:Hardware is not that importan, as it looks like one 1 core.
The result comes from: "gcc8 64bit AMD EPYC 7502P 1/32-Core Processor", which looks stunning, but only 1 core is being used.
On my i7-8850H MacBookPro it's about 80% performance (of course only 1 core being used, too).
This move generator has been built in 2008 with the main purpose to be as fast as possible. I invented an own style of bitboard representation. Later I learned it is called "Kindergarten bitboard".
The performance gain since 2008 may be interesting (using hash):the last 3 lines and version 1.0.2 are from 2008 with hardware of that time. The speed for 1 core increased only about a factor 3 in 12 years. Who had ever thought this?Code: Select all
/* OliPerft 1.0.5 - Bitboard Magic Move (c) Oliver Brausch 16.Sep.2020, ob112@web.de */ /* oliperft 6 "r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1" Nodes: 8229523927 cs: 1156 knps: 711527 (gcc8 64bit AMD EPYC 7502P 1/32-Core Processor) Nodes: 8229523927 cs: 1526 knps: 539145 (gcc4 OSX i7 8850H 2.6 GHz) Nodes: 8229523927 ms: 40610 knps: 202647 (VS2005 64bit AMD64 4600+) (1.0.2) Nodes: 8229523927 ms: 64860 knps: 126881 (VS2005 32bit AMD64 4600+) (1.0.2) Nodes: 8229523927 ms: 97251 knps: 84621 (gcc4 32bit AMD Opteron 1210HE) (1.0.2)
84.621 knps (84 million)
126.881 knps (127 million)
202.647 knps (202 million)
539.145 knps (539 million)
711.527 knps (712 million)
That is a speedup of 8.47x. Where do you get a factor 3 in 12 years?
What really stands out to me is the massive jump in speed when you switched to 64-bit. I see that with my engine as well: if I compile it as a 32-bit engine, the speed drops by 40-50%.