Stockfish version with hash saving capability

Discussion of anything and everything relating to chess playing software and machines.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
giovanni
Posts: 136
Joined: Wed Jul 08, 2015 10:30 am

Re: Stockfish version with hash saving capability

Post by giovanni » Tue Aug 22, 2017 7:10 pm

cdani wrote:
giovanni wrote: Thanks. However I tried to compile it on my ubuntu linux box and I didn't succeed:

...
for (long long i = 0; i < clusterCount * sizeof(Cluster); i += (1 << 30)) { //1GB
^
tt.cpp:107:71: error: ‘__min’ was not declared in this scope
long long j = __min((1 << 30), (clusterCount * sizeof(Cluster)) - i);
^
Is far from the best solution, but you can try adding this line in tt.cpp before the use of __min

Code: Select all

#define __min&#40;a,b&#41; ((&#40;a&#41; < &#40;b&#41;) ? &#40;a&#41; &#58; &#40;b&#41;)
Sure someone will understand what is happening.
Thanks. Now compiles fine.

User avatar
cdani
Posts: 2105
Joined: Sat Jan 18, 2014 9:24 am
Location: Andorra
Contact:

Re: Stockfish version with hash saving capability

Post by cdani » Tue Aug 22, 2017 7:54 pm

Rodolfo Leoni wrote: I gave it this epd (1 position) and engine still stops working.

r3kb1r/1bqn1p1p/p1Np1P2/3P4/1p6/5Q1B/PPP4P/2KR2R1 b kq - 4 20 acd 40; ce 2426; bm Bh3
Can you try this format?

Code: Select all

r3kb1r/1bqn1p1p/p1Np1P2/3P4/1p6/5Q1B/PPP4P/2KR2R1 b kq - 4 20 acd 40;; bm Bh3; ce 2426;;

Dann Corbit
Posts: 10291
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: Stockfish version with hash saving capability

Post by Dann Corbit » Wed Aug 23, 2017 1:04 am

cdani wrote:Done:

www.andscacs.com/downloads/stockfish_x6 ... vehash.zip

It has a new option
option name LoadEpdToHash type button

First you set
HashFile
to an epd file and then press this new button.

It does what is supposed to do, but I don't know if this influences Stockfish search a lot, as I have not tried.
I hope is useful to someone.
I do not have this button.
I searched the code base for LoadEpdToHash but it found nothing.
Perhaps the new version did not get pushed to the archive?
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.

Dann Corbit
Posts: 10291
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: Stockfish version with hash saving capability

Post by Dann Corbit » Wed Aug 23, 2017 1:06 am

Dann Corbit wrote:
cdani wrote:Done:

www.andscacs.com/downloads/stockfish_x6 ... vehash.zip

It has a new option
option name LoadEpdToHash type button

First you set
HashFile
to an epd file and then press this new button.

It does what is supposed to do, but I don't know if this influences Stockfish search a lot, as I have not tried.
I hope is useful to someone.
These are the new options that I see in the code:
//dani170724
o["NeverClearHash"] << Option(false);
o["HashFile"] << Option("hash.hsh", on_HashFile);
o["SaveHashtoFile"] << Option(SaveHashtoFile);
o["LoadHashfromFile"] << Option(LoadHashfromFile);
//enddani170724

I do not have this button.
I searched the code base for LoadEpdToHash but it found nothing.
Perhaps the new version did not get pushed to the archive?
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.

Rodolfo Leoni
Posts: 544
Joined: Tue Jun 06, 2017 2:49 pm
Location: Italy

Re: Stockfish version with hash saving capability

Post by Rodolfo Leoni » Wed Aug 23, 2017 1:31 am

Dann Corbit wrote:
cdani wrote:Done:

www.andscacs.com/downloads/stockfish_x6 ... vehash.zip

It has a new option
option name LoadEpdToHash type button

First you set
HashFile
to an epd file and then press this new button.

It does what is supposed to do, but I don't know if this influences Stockfish search a lot, as I have not tried.
I hope is useful to someone.
I do not have this button.
I searched the code base for LoadEpdToHash but it found nothing.
Perhaps the new version did not get pushed to the archive?
Hi Dann.

I have the button. It's just below the LoadFileToHash button.
F.S.I. Chess Teacher

Dann Corbit
Posts: 10291
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: Stockfish version with hash saving capability

Post by Dann Corbit » Wed Aug 23, 2017 3:14 am

Rodolfo Leoni wrote:
Dann Corbit wrote:
cdani wrote:Done:

www.andscacs.com/downloads/stockfish_x6 ... vehash.zip

It has a new option
option name LoadEpdToHash type button

First you set
HashFile
to an epd file and then press this new button.

It does what is supposed to do, but I don't know if this influences Stockfish search a lot, as I have not tried.
I hope is useful to someone.
I do not have this button.
I searched the code base for LoadEpdToHash but it found nothing.
Perhaps the new version did not get pushed to the archive?
Hi Dann.

I have the button. It's just below the LoadFileToHash button.
Mystery solved. I did not notice that his archive started at root folder level, so I was looking for the code and executables in the wrong place. I found an older version that he made instead.
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.

Dann Corbit
Posts: 10291
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: Stockfish version with hash saving capability

Post by Dann Corbit » Wed Aug 23, 2017 5:01 am

Dann Corbit wrote:
Rodolfo Leoni wrote:
Dann Corbit wrote:
cdani wrote:Done:

www.andscacs.com/downloads/stockfish_x6 ... vehash.zip

It has a new option
option name LoadEpdToHash type button

First you set
HashFile
to an epd file and then press this new button.

It does what is supposed to do, but I don't know if this influences Stockfish search a lot, as I have not tried.
I hope is useful to someone.
I do not have this button.
I searched the code base for LoadEpdToHash but it found nothing.
Perhaps the new version did not get pushed to the archive?
Hi Dann.

I have the button. It's just below the LoadFileToHash button.
Mystery solved. I did not notice that his archive started at root folder level, so I was looking for the code and executables in the wrong place. I found an older version that he made instead.
I had to fiddle with it to make it work in a way that I understood.

It loaded 4 million EPD rows in 22 seconds.
In the first game, it got a draw with Asmfish.

I will need a deeper pile of EPD for sure.

I saw an advantage develop for the hash loaded version, but it got slowly drained away. With only 4 million hash entries loaded, it would be pretty sparse in reality.

I figure with a billion entries in the hash, it might have a terrific advantage. Further, after it minimaxes for a while, the hash should get stronger and stronger (in theory). I imagine that a lot of good entries will get aged out of the table, though.
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.

Dann Corbit
Posts: 10291
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: Stockfish version with hash saving capability

Post by Dann Corbit » Wed Aug 23, 2017 5:04 am

Game 2, got a pawn advantage on Komodo, but ended in a draw.
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.

User avatar
cdani
Posts: 2105
Joined: Sat Jan 18, 2014 9:24 am
Location: Andorra
Contact:

Re: Stockfish version with hash saving capability

Post by cdani » Wed Aug 23, 2017 5:07 am

Dann Corbit wrote: It loaded 4 million EPD rows in 22 seconds.
In the first game, it got a draw with Asmfish.

I will need a deeper pile of EPD for sure.

I saw an advantage develop for the hash loaded version, but it got slowly drained away. With only 4 million hash entries loaded, it would be pretty sparse in reality.

I figure with a billion entries in the hash, it might have a terrific advantage. Further, after it minimaxes for a while, the hash should get stronger and stronger (in theory). I imagine that a lot of good entries will get aged out of the table, though.
Nice first attempt!
If you want to make it load faster the epd file, you probably know that you can remove all the "sync_cout <<" lines in the source.
Also I understand that you will load the full epd file before the start of each game.

Dann Corbit
Posts: 10291
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: Stockfish version with hash saving capability

Post by Dann Corbit » Fri Aug 25, 2017 8:02 am

giovanni wrote:
Dann Corbit wrote:Built fine for me.
I am going to test it this evening.
Did you compile it on ubuntu?
I compiled the wrong version altogether.

When I got the right version, I included the algorithm header and changed the macro to the template method.

I do have Ubuntu here. My 64 core box runs Ubuntu.
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.

Post Reply