Gigantua: 1.5 Giganodes per Second per Core move generator

Discussion of chess software programming and technical issues.

Moderator: Ras

gflohr
Posts: 57
Joined: Fri Jul 23, 2021 5:24 pm
Location: Elin Pelin
Full name: Guido Flohr

Re: Gigantua: 1.5 Giganodes per Second per Core move generator

Post by gflohr »

dangi12012 wrote: Mon Sep 27, 2021 9:58 pm You can run the executable in a sandbox. Its the current build.
Being the current build qualifies it running in a sandbox? What about making it run on a regular machine?

I am also curious to know whether you have built unit tests into your executable? That is an interesting approach that I have not yet seen before.
gflohr
Posts: 57
Joined: Fri Jul 23, 2021 5:24 pm
Location: Elin Pelin
Full name: Guido Flohr

Re: Gigantua: 1.5 Giganodes per Second per Core move generator

Post by gflohr »

gflohr wrote: Mon Sep 27, 2021 10:07 pm I am also curious to know whether you have built unit tests into your executable? That is an interesting approach that I have not yet seen before.
Maybe I should elaborate on that. The reason that I am asking is that while reading your source code (I mean the .exe file) I stumbled over the integers 3195901860 and 8031647685 which were familiar to me because I had read them before on https://www.chessprogramming.org/Perft_Results

Since nobody but yourself is able or willing to run your program, could you please explain that? Does that mean that before you print your perft results you compare them to the well-known numbers that qperft produces, just to make sure that your users will not see wrong results? I mean, even you could have a bug in your code, couldn't you?
BrokenKeyboard
Posts: 24
Joined: Tue Mar 16, 2021 11:11 pm
Full name: Het Satasiya

Re: Gigantua: 1.5 Giganodes per Second per Core move generator

Post by BrokenKeyboard »

After i ran the exe through virustotal, I ran it on my local machine. Obviously its a tad slower since the build provided is for zen3 while im on intel. But the numbers are different and thus im confident that hes not just printfing the results.

Code: Select all

Perft Start 1: 20 0ms 0.666667 MNodes/s
Perft Start 2: 400 0ms 16.6667 MNodes/s
Perft Start 3: 8902 0ms 189.404 MNodes/s
Perft Start 4: 197281 0ms 520.53 MNodes/s
Perft Start 5: 4865609 6ms 730.243 MNodes/s
Perft Start 6: 119060324 163ms 726.31 MNodes/s
Perft Start 7: 3195901860 3895ms 820.502 MNodes/s
OK

Perft Kiwi 1: 48 0ms 6.85714 MNodes/s
Perft Kiwi 2: 2039 0ms 203.9 MNodes/s
Perft Kiwi 3: 97862 0ms 1008.89 MNodes/s
Perft Kiwi 4: 4085603 3ms 1272.77 MNodes/s
Perft Kiwi 5: 193690690 148ms 1305.49 MNodes/s
Perft Kiwi 6: 8031647685 6502ms 1235.1 MNodes/s
OK

Perft Midgame 1: 46 0ms 4.18182 MNodes/s
Perft Midgame 2: 2079 0ms 346.5 MNodes/s
Perft Midgame 3: 89890 0ms 1198.53 MNodes/s
Perft Midgame 4: 3894594 2ms 1377.64 MNodes/s
Perft Midgame 5: 164075551 120ms 1356.27 MNodes/s
Perft Midgame 6: 6923051137 5295ms 1307.41 MNodes/s
OK

Perft Endgame 1: 38 0ms 12.6667 MNodes/s
Perft Endgame 2: 1129 0ms 188.167 MNodes/s
Perft Endgame 3: 37035 0ms 755.816 MNodes/s
Perft Endgame 4: 1023977 0ms 1214.68 MNodes/s
Perft Endgame 5: 31265700 23ms 1355.9 MNodes/s
Perft Endgame 6: 849167880 710ms 1194.52 MNodes/s
OK

Perft aggregate: 18999768562 16896ms 1124.49 MNodes/s
BrokenKeyboard
Posts: 24
Joined: Tue Mar 16, 2021 11:11 pm
Full name: Het Satasiya

Re: Gigantua: 1.5 Giganodes per Second per Core move generator

Post by BrokenKeyboard »

Providing source would allow us to compile for our native machines, allowing everybody to see just how amazing your movecounter is. So i do reccomend providing it.
klx
Posts: 179
Joined: Tue Jun 15, 2021 8:11 pm
Full name: Emanuel Torres

Re: Gigantua: 1.5 Giganodes per Second per Core move generator

Post by klx »

dangi12012 wrote: Mon Sep 27, 2021 9:58 pm Also maybe it will help someone - the fastest way I have found to loop over all set bits in a uint64_t in terms of squares is this:
Lol, again it takes me about 20 seconds to come up with something substantially faster. Just imagine what I could do in 2 years.

Code: Select all

for (; Rooks; Rooks &= Rooks-1) {
    uint64_t sq = _tzcnt_u64(Rooks);
    ...
}
And, I'm not done yet. Even faster is unrolled:

Code: Select all

switch (_popcnt64(Rooks)) {
    case 64: sq = _tzcnt_u64(Rooks); Rooks &= Rooks-1; ...
    case 63: sq = _tzcnt_u64(Rooks); Rooks &= Rooks-1; ...
    case 62: sq = _tzcnt_u64(Rooks); Rooks &= Rooks-1; ...
    ...
    case  1: sq = _tzcnt_u64(Rooks); Rooks &= Rooks-1; ...
}
dangi12012 wrote: Mon Sep 27, 2021 9:58 pm Latest Release v1.2 now 20% faster
20% faster, I'm assuming from the previous optimization I gave you. Hah. I expect 30% faster with the trick above. You're welcome. Remember to credit me.
[Moderation warning] This signature violated the rule against commercial exhortations.
BrokenKeyboard
Posts: 24
Joined: Tue Mar 16, 2021 11:11 pm
Full name: Het Satasiya

Re: Gigantua: 1.5 Giganodes per Second per Core move generator

Post by BrokenKeyboard »

Have you tested the change to see just how much faster it is?
dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: Gigantua: 1.5 Giganodes per Second per Core move generator

Post by dangi12012 »

klx wrote: Tue Sep 28, 2021 4:13 am 20% faster, I'm assuming from the previous optimization I gave you. Hah. I expect 30% faster with the trick above. You're welcome. Remember to credit me.
Stop trolling. You dont read my posts and you didnt make anything faster. As I wrote that was a failed movegen no need to make it faster (which you did not because you optimized a single branch out of 4 * 64). 99% of your posts are very negative - so go away.
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: Gigantua: 1.5 Giganodes per Second per Core move generator

Post by dangi12012 »

klx wrote: Tue Sep 28, 2021 4:13 am
Lets "optimize" more...

Code: Select all

for (; Rooks; Rooks &= Rooks-1) {
    uint64_t sq = _tzcnt_u64(Rooks);
}

//Inline pop lsb
for (; Rooks; Rooks = _blsr_u64(Rooks)) {
    uint64_t sq = _tzcnt_u64(Rooks);
    ...
}

//For -> While. This literally my code from previous page...
while(Rooks){
	uint64_t sq = _tzcnt_u64(Rooks = _blsr_u64(Rooks));
	
}
So congratulations. You copied my code. Made it more verbose. And Slower... As I said go away and troll somewhere else.
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
klx
Posts: 179
Joined: Tue Jun 15, 2021 8:11 pm
Full name: Emanuel Torres

Re: Gigantua: 1.5 Giganodes per Second per Core move generator

Post by klx »

dangi12012 wrote: Tue Sep 28, 2021 11:21 am So congratulations. You copied my code. Made it more verbose. And Slower... As I said go away and troll somewhere else.
1. That's not the code from your previous post. That code did some xoring and who knows what else.
2. Your code is more verbose.
3. Your code is slower (benchmark it, or look at the assembly; I did).
4. The code you pasted above doesn't even do what you think it does.

You have to be the one trolling with us, or are you really this ignorant?
[Moderation warning] This signature violated the rule against commercial exhortations.
R. Tomasi
Posts: 307
Joined: Wed Sep 01, 2021 4:08 pm
Location: Germany
Full name: Roland Tomasi

Re: Gigantua: 1.5 Giganodes per Second per Core move generator

Post by R. Tomasi »

This
dangi12012 wrote: Tue Sep 28, 2021 11:21 am

Code: Select all

for (; Rooks; Rooks = _blsr_u64(Rooks)) {
    uint64_t sq = _tzcnt_u64(Rooks);
    ...
}
and that
dangi12012 wrote: Tue Sep 28, 2021 11:21 am

Code: Select all

while(Rooks){
	uint64_t sq = _tzcnt_u64(Rooks = _blsr_u64(Rooks));
}
are not equivalent. Just using Rooks=1 as initial value proves it...

Fixed it for you:

Code: Select all

while(Rooks){
	uint64_t sq = _tzcnt_u64(Rooks);
	Rooks = _blsr_u64(Rooks);
}