fast(er) movegen

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
hgm
Posts: 23149
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: fast(er) movegen

Post by hgm » Mon Dec 10, 2018 8:01 pm

Ratosh wrote:
Mon Dec 10, 2018 7: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: 9491
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: fast(er) movegen

Post by Dann Corbit » Mon Dec 10, 2018 8:20 pm

hgm wrote:
Mon Dec 10, 2018 8:01 pm
Ratosh wrote:
Mon Dec 10, 2018 7: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: 61
Joined: Mon Apr 16, 2018 4:56 pm

Re: fast(er) movegen

Post by Ratosh » Mon Dec 10, 2018 9:50 pm

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: 3015
Joined: Fri May 26, 2006 1:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: fast(er) movegen

Post by Michael Sherwin » Mon Dec 10, 2018 10:09 pm

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.
I hate if statements. Pawns demand if statements. Therefore I hate pawns.

User avatar
gbtami
Posts: 361
Joined: Wed Sep 26, 2012 11:29 am
Location: Hungary
Contact:

Re: fast(er) movegen

Post by gbtami » Mon Dec 10, 2018 10:16 pm

It would be very kind if you can put these sources to a github repo.

Michael Sherwin
Posts: 3015
Joined: Fri May 26, 2006 1:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: fast(er) movegen

Post by Michael Sherwin » Mon Dec 10, 2018 10:22 pm

gbtami wrote:
Mon Dec 10, 2018 10: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. :?
I hate if statements. Pawns demand if statements. Therefore I hate pawns.

tttony
Posts: 259
Joined: Sat Apr 23, 2011 10:33 pm
Contact:

Re: fast(er) movegen

Post by tttony » Mon Dec 10, 2018 10:34 pm

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: 3015
Joined: Fri May 26, 2006 1:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: fast(er) movegen

Post by Michael Sherwin » Mon Dec 10, 2018 10:39 pm

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
I hate if statements. Pawns demand if statements. Therefore I hate pawns.

Michael Sherwin
Posts: 3015
Joined: Fri May 26, 2006 1:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: fast(er) movegen

Post by Michael Sherwin » Mon Dec 10, 2018 10:54 pm

Michael Sherwin wrote:
Mon Dec 10, 2018 10:22 pm
gbtami wrote:
Mon Dec 10, 2018 10: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!
I hate if statements. Pawns demand if statements. Therefore I hate pawns.

Ratosh
Posts: 61
Joined: Mon Apr 16, 2018 4:56 pm

Re: fast(er) movegen

Post by Ratosh » Mon Dec 10, 2018 11:02 pm

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

Post Reply