It is losely related to one lookup method - https://www.chessprogramming.org/Rotated_Indices but works much more streamlined and has nothing to do with rotation.
I want to call it hypercube because I imagined the pext indices to "come out of the board" in a 3d way and how they are calculated - then how that caluclation can be done during make unmake without using pext. It would look like a 3d cube with electrical wires in between 8x8x32 cells. (still a cube with 32===8 elements you will see what i mean).
I played around with cross referencing bitfields for all 64 squares - but one night I had the idea that that is not needed at all.
Because you can attach your code to the boardstate and with 1 small branchless function you get all new 128 possible pext values and the preliminary tests and implementation of the prototype look very very promising.
Code: Select all
Megalookups/s:
Reference: 103.93MOps
Fancy: 818.23MOps
PEXT: 848.86MOps
HYPER: 1045.74MOps
During makemove 1 jumptable operation is needed. No branches - no ifs. Works with bitboards and mailslot algorithms (the board representation does not matter in fact) - you only need from/to squares in 0..63 index form:
This is the output for -O1 with -O3 its smaller (and uglier - but faster)
Code: Select all
or DWORD PTR cfg[rip+68], 1024
or DWORD PTR cfg[rip+72], 1024
or DWORD PTR cfg[rip+76], 1024
or DWORD PTR cfg[rip+80], 1024
or DWORD PTR cfg[rip+84], 1024
or DWORD PTR cfg[rip+88], 1024
or DWORD PTR cfg[rip+32], 64
or DWORD PTR cfg[rip+96], 64
or DWORD PTR cfg[rip+128], 128
or DWORD PTR cfg[rip+160], 256
or DWORD PTR cfg[rip+192], 512
or DWORD PTR cfg[rip+36], 2097152
or DWORD PTR cfg[rip+100], 2097152
or DWORD PTR cfg[rip+136], 8388608
or DWORD PTR cfg[rip+172], 8388608
or DWORD PTR cfg[rip+208], 2097152
Code: Select all
Rook/Bishop(int):
movsx
movzx
mov
mov
I am looking forward to sharing my code and I am happy to answer if you have questions!