Quad-bard vs bitboard : is it faster ?

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
j_romang
Posts: 79
Joined: Mon May 16, 2011 12:52 am

Quad-bard vs bitboard : is it faster ?

Post by j_romang » Fri May 04, 2018 4:48 am

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: 216
Joined: Fri Jul 10, 2015 7:23 pm
Location: Russia

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

Post by Kotlov » Fri May 04, 2018 6:24 am

I use Quad-board, is very fast.
(in fact, I use Penta-board)
Eugene Kotlov
Hedgehog 2.0 64-bit coming soon...

ZirconiumX
Posts: 1327
Joined: Sun Jul 17, 2011 9:14 am

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

Post by ZirconiumX » Fri May 04, 2018 6:52 am

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 12:52 am

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

Post by j_romang » Fri May 04, 2018 7:21 am

What is your penta-board representation ? What is the 5th board used for ? :)

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

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

Post by j_romang » Fri May 04, 2018 7:22 am

Thanks Matthew, waiting for your data :)

User avatar
Kotlov
Posts: 216
Joined: Fri Jul 10, 2015 7:23 pm
Location: Russia

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

Post by Kotlov » Fri May 04, 2018 8:06 am

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.0 64-bit coming soon...

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

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

Post by j_romang » Fri May 04, 2018 9:41 am

Thanks eugene ! Could you explain what you store in 'e', 's', and 'm' ? 'r' is a repetition counter, right ?

User avatar
Kotlov
Posts: 216
Joined: Fri Jul 10, 2015 7:23 pm
Location: Russia

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

Post by Kotlov » Fri May 04, 2018 10:13 am

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.0 64-bit coming soon...

ZirconiumX
Posts: 1327
Joined: Sun Jul 17, 2011 9:14 am

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

Post by ZirconiumX » Mon May 07, 2018 8:12 pm

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 12:52 am

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

Post by j_romang » Tue May 08, 2018 4:19 pm

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

Post Reply