fast(er) movegen

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: fast(er) movegen

Post by hgm »

Ratosh wrote: Mon Dec 10, 2018 8:58 pm HGM's move generation on qperft is a good reference for speed. If you want to change your board representation there is no doubt that bitboard representation is the fastest.
Actually I doubt that.
Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: fast(er) movegen

Post by Dann Corbit »

hgm wrote: Mon Dec 10, 2018 9:01 pm
Ratosh wrote: Mon Dec 10, 2018 8:58 pm HGM's move generation on qperft is a good reference for speed. If you want to change your board representation there is no doubt that bitboard representation is the fastest.
Actually I doubt that.
The fastest is using GPUs.
Ankan's GPU perft is absurdly faster than anything else.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
Ratosh
Posts: 77
Joined: Mon Apr 16, 2018 6:56 pm

Re: fast(er) movegen

Post by Ratosh »

Oh, i assumed it since most top engines use bitboard. What would be the reason why they would chose it over other options?
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: fast(er) movegen

Post by Michael Sherwin »

For people that have no idea how to program a GPU, like me, I did some CPU perft examples about 15 years ago.

On my computer, an i7-3930k, running at 3.2 GHz single threaded I get the following results.

Stockfish 10 bench 6 1,697,099 nodes/sec

My Examples: Every move made and unmade and no move counts cashed.

Carnivor: GNU 4 style move generator - enhanced
36,649,859 nodes/sec

Halfwit: Classic Chess 4.5 style bitboards - enhanced
25,930,980 nodes/sec

Conundrum: Move generation as a state machine (I think or maybe just incremental) 100% original
38,679,036 nodes/sec

Godzilla: A purely jump table driven move generator in x86 32 bit assembly 100% original with a top level C main() module
66,799,849 nodes/sec

NOTE: These examples are just for speed and not accuracy as they just count pseudo legal moves.

My processor i7-3930k CPU MARK 1935 an i9-9900k CPU MARK 2898

Source code for the examples is available on request.
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through
User avatar
gbtami
Posts: 389
Joined: Wed Sep 26, 2012 1:29 pm
Location: Hungary

Re: fast(er) movegen

Post by gbtami »

It would be very kind if you can put these sources to a github repo.
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: fast(er) movegen

Post by Michael Sherwin »

gbtami wrote: Mon Dec 10, 2018 11:16 pm It would be very kind if you can put these sources to a github repo.
I'll see if I can figure out how to do that. But, I'm an old dog and it's not easy for me to learn new tricks, wuf wuf. :?
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through
tttony
Posts: 268
Joined: Sun Apr 24, 2011 12:33 am

Re: fast(er) movegen

Post by tttony »

This is Skiull 0.3 perft 6

Code: Select all

 depth                 nodes    elapsed ms
     1                    20          0
     2                   400          0
     3                 8,902          0
     4               197,281         16
     5             4,865,609        203
     6           119,060,324       5226

depth       : 6
nodes       : 124,132,536
nps         : 22,734,896
time        : 5460ms
Bitboard with magic moves from Pradyumna Kannan
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: fast(er) movegen

Post by Michael Sherwin »

Once in a while I'll overclock my CPU from 3.2 GHz to 4.6 GHz. I never did that for my move generator examples so I thought it might be interesting.

Carnivor: 36,649,859 nodes/sec => 45,176,777
Halfwit: 25,930,980 nodes/sec => 32,259,852
Conundrum: 38,679,036 nodes/sec => 47,856,608
Godzilla: 66,799,849 nodes/sec => 82,814,118 :P
:D
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: fast(er) movegen

Post by Michael Sherwin »

Michael Sherwin wrote: Mon Dec 10, 2018 11:22 pm
gbtami wrote: Mon Dec 10, 2018 11:16 pm It would be very kind if you can put these sources to a github repo.
I'll see if I can figure out how to do that. But, I'm an old dog and it's not easy for me to learn new tricks, wuf wuf. :?
That cost $7 dollars a month. Does not seem worth it to me!
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through
Ratosh
Posts: 77
Joined: Mon Apr 16, 2018 6:56 pm

Re: fast(er) movegen

Post by Ratosh »

From GitHub pricing page: "GitHub is free to use for public and open source projects."