Quad-bard vs bitboard : is it faster ?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

j_romang
Posts: 79
Joined: Mon May 16, 2011 2:52 am

Quad-bard vs bitboard : is it faster ?

Post 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 ?
User avatar
Kotlov
Posts: 266
Joined: Fri Jul 10, 2015 9:23 pm
Location: Russia

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

Post by Kotlov »

I use Quad-board, is very fast.
(in fact, I use Penta-board)
Eugene Kotlov
Hedgehog 2.1 64-bit coming soon...
ZirconiumX
Posts: 1334
Joined: Sun Jul 17, 2011 11:14 am

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

Post 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.
Some believe in the almighty dollar.

I believe in the almighty printf statement.
j_romang
Posts: 79
Joined: Mon May 16, 2011 2:52 am

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

Post by j_romang »

What is your penta-board representation ? What is the 5th board used for ? :)
j_romang
Posts: 79
Joined: Mon May 16, 2011 2:52 am

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

Post by j_romang »

Thanks Matthew, waiting for your data :)
User avatar
Kotlov
Posts: 266
Joined: Fri Jul 10, 2015 9:23 pm
Location: Russia

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

Post 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;
Eugene Kotlov
Hedgehog 2.1 64-bit coming soon...
j_romang
Posts: 79
Joined: Mon May 16, 2011 2:52 am

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

Post by j_romang »

Thanks eugene ! Could you explain what you store in 'e', 's', and 'm' ? 'r' is a repetition counter, right ?
User avatar
Kotlov
Posts: 266
Joined: Fri Jul 10, 2015 9:23 pm
Location: Russia

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

Post 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
Eugene Kotlov
Hedgehog 2.1 64-bit coming soon...
ZirconiumX
Posts: 1334
Joined: Sun Jul 17, 2011 11:14 am

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

Post 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.
Some believe in the almighty dollar.

I believe in the almighty printf statement.
j_romang
Posts: 79
Joined: Mon May 16, 2011 2:52 am

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

Post by j_romang »

Thanks ! Is your raspberry Pi B+ running in 32 or 64 bit mode ?