https://github.com/Gigantua/Chess_Movegen
I made sure to include every idea in the wiki at least once. So there is not 10x the same algorithm with the same idea - but we have a C++20 constepxr version of unique algorithms.
Huge thanks to Harald for sending me the sourcecode to his engine - Elephant_1_07. which also contained an assortment of lookup algorithms. Some algorithms were over 20 years old! Some are younger.
I took these and some in the discussions we had in these threads to create a C++20 assortment of known lookup algorithms.
forum3/viewtopic.php?f=7&t=77133#p890486
http://www.talkchess.com/forum3/viewtop ... 67#p914867
Some are really really nice pieces of code!
All of these lookups are constexpr so that the whole initialisation for all 13 algorithms happens at compiletime. Each algorithm lives in its own namespace and if you want to pick one for your engine just copy and include the .hpp file

All you need is namespace::Rook(sq, occ) to get the attacked squares.
It prints the table size - MLU/s for different tests and the dependency on special operations.
I will also add Multithreading tests in the future (L2 cache pressure)
Here is the result for a Ryzen 9 5950X:
Code: Select all
AMD Ryzen 9 5950X 16-Core Processor
Megalooks Simulated Game/s:
Exploading: 150.89MOps 6 kB Optimal perf: imul64
Reference: 68.93MOps 8 kB Optimal perf: none
KoggeStone: 111.98MOps 0 kB Optimal perf: none
RotatedBoard: 92.37MOps 14 kB Optimal perf: none
QBB Algo: 171.72MOps 0 kB Optimal perf: countr_zero, countl_zero
BobMike: 211.32MOps 8 kB Optimal perf: countr_zero, countl_zero
SlideArithm: 256.04MOps 2 kB Optimal perf: bzhi_u64, blsmsk_u64
XorRookSub: 297.78MOps 2 kB Optimal perf: bswap
Hash Variable: 399.36MOps 729 kB Optimal perf: imul64
Hash Plain: 529.61MOps 2306 kB Optimal perf: imul64
Hash Fancy: 597.36MOps 694 kB Optimal perf: imul64
Pext : 925.24MOps 843 kB Optimal perf: pext_u64
HyperCube: 310.30MOps 841 kB Optimal perf: none
Please post your results (Especially old intel + Ryzen 1/2) and if you want to add an algo please pm me - or create a PR - or contact me under daniel.infuehr@live.de
Happy new year!