Page 1 of 2

Quad-bard vs bitboard : is it faster ?

Posted: Fri May 04, 2018 6:48 am
by j_romang
I'm discovering to quad-board structure on chessprogrammingwiki : is it faster than regular bitboards ? Is there any perft benchmark somewhere to compare engines using different structures ?

Re: Quad-bard vs bitboard : is it faster ?

Posted: Fri May 04, 2018 8:24 am
by Kotlov
I use Quad-board, is very fast.
(in fact, I use Penta-board)

Re: Quad-bard vs bitboard : is it faster ?

Posted: Fri May 04, 2018 8:52 am
by ZirconiumX
I don't have data on quad-bitboard versus octa-bitboard, but quad-bitboard engines require a monochrome board representation, and my own testing does show that those are slightly slower than double colour board representations.

I can provide more accurate data in a few hours.

Re: Quad-bard vs bitboard : is it faster ?

Posted: Fri May 04, 2018 9:21 am
by j_romang
What is your penta-board representation ? What is the 5th board used for ? :)

Re: Quad-bard vs bitboard : is it faster ?

Posted: Fri May 04, 2018 9:22 am
by j_romang
Thanks Matthew, waiting for your data :)

Re: Quad-bard vs bitboard : is it faster ?

Posted: Fri May 04, 2018 10:06 am
by Kotlov
j_romang wrote:What is your penta-board representation ? What is the 5th board used for ? :)

Code: Select all

typedef struct
{
    U64 a;  // маска альфа-фигур
    U64 b;  // маска b
    U64 c;  // маска c
    U64 d;  // маска d

    U16 k;  // 0х10110000 00110000 (цвет, рокировки, кол-во фигур)
    U8 e;   // ep 0..7 если есть, 8 если нет
    U8 t;   // счетчик 50-и ходов
    U8 r;   // повтор позиции
    U8 s;   // специфика предыдущего хода
    S16 m;  // материал
} tpos;

Re: Quad-bard vs bitboard : is it faster ?

Posted: Fri May 04, 2018 11:41 am
by j_romang
Thanks eugene ! Could you explain what you store in 'e', 's', and 'm' ? 'r' is a repetition counter, right ?

Re: Quad-bard vs bitboard : is it faster ?

Posted: Fri May 04, 2018 12:13 pm
by Kotlov
j_romang wrote:Thanks eugene ! Could you explain what you store in 'e', 's', and 'm' ? 'r' is a repetition counter, right ?
k - color, castling, number of pieces
e - EP
t - the counter of 50 move rule
r - repeat position
s - specifics of the previous move
m - material

Re: Quad-bard vs bitboard : is it faster ?

Posted: Mon May 07, 2018 10:12 pm
by ZirconiumX
This got sidetracked by the forum migration and me getting ill over the weekend.

So, I ran a Perft benchmark (which admittedly isn't the whole story of a search, but it magnifies the important part).

It turns out that a monochrome move generator is slightly faster:

Code: Select all

AMD FX-6300 @ 3.5GHz: 
Double-colour:
CPW [637,032,715 nodes]:
real    1m16.190s
user    1m15.781s
sys     0m0.063s

Hartmann [4,782,906,132 nodes]:
real    10m9.788s
user    10m6.125s
sys     0m0.141s

Single-colour:
CPW:
real    1m15.089s
user    1m14.719s
sys     0m0.016s

Hartmann:
real    9m44.185s
user    9m40.984s
sys     0m0.188s
However, as a counterpoint:

Code: Select all

RPi 3B+ @ 1.4GHz:
Double-colour CPW:
real    6m14.229s
user    6m13.821s
sys     0m0.026s

Single-colour CPW:
real    8m24.195s
user    8m23.984s
sys     0m0.055s
So it's rather hardware dependent.

Re: Quad-bard vs bitboard : is it faster ?

Posted: Tue May 08, 2018 6:19 pm
by j_romang
Thanks ! Is your raspberry Pi B+ running in 32 or 64 bit mode ?