I know that you are leaving a lot of performance on the table by using C.OliverBr wrote: ↑Sat Nov 20, 2021 9:11 pmYes. OliThink4 (https://github.com/olithink/olithink4)shahil4242 wrote: ↑Sat Nov 20, 2021 5:10 amI think one of the version of OliThink had uses rotated bitboard.What is the result of perft? Does it is faster than magic bitboard?is it is woth learning about rotated bitboard.OliverBr wrote: ↑Thu Nov 18, 2021 11:40 pmActually dumb is really intriguing. It's very compact and well written.abulmo2 wrote: ↑Wed Nov 17, 2021 2:01 pm You may have a look at dumb, it is about 1200 lines of code and 2677 Elo at CCRL 40/4.
You can also give a look at OliThink which is very strong (2867 Elo for version 5.9.7 on CCRL 40/4) with a very compact source code (1033 lines of code for version 5.10.1).
had rotated bitboards. And it had good results and caught the attention of many chess pioneers. One of them them is a Stockfish developer.
The Kindergarten bitboards of OliThink5 (https://github.com/olithink/OliThink)
was another independent development of my own without looking into other sources. I got the name many years after its creation.
The perft of OliThink5 (https://github.com/olithink/OliThink/tree/oliperft)
is better than OliThink4.
But this is still no decisive argument which to use, because the move generation is supposed to be compatable with the rest of the programm.
If you were to use C++ all your macros should be replaced by constexpr / consteval functions and you get access to more modern compiler backends.
Also compilers can do more to optimize int& paramters vs int* parameters. So the very core of poplsb is surely not optimal in C vs C++.
Just start by replacing (int c) with template<int c> and your code will speedup by more than 2x.
Code: Select all
#define PCA3(x, c) (pcaps[c][(x) | 64] & (P.color[c^1] | (BIT[ENPASS] & (c ? 0xFF0000 : 0xFF0000000000))))
All "ifs" magically disappear. Most array lookups go away. Color becomes a compiletime variable - and most importantly: The code becomes much shorter and cleaner to read and maintain.