Stockfish version with hash saving capability

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

Moderators: hgm, Rebel, chrisw

User avatar
Guenther
Posts: 4605
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: Stockfish version with hash saving capability

Post by Guenther »

zullil wrote:
Anyone know who tthsqe12 is? Is that Mohammed?
Yes
https://rwbc-chess.de

trollwatch:
Chessqueen + chessica + AlexChess + Eduard + Sylwy
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Stockfish version with hash saving capability

Post by zullil »

Guenther wrote:
zullil wrote:
Anyone know who tthsqe12 is? Is that Mohammed?
Yes
Thanks. I thought he had abandoned the project due to burnout.

Now the TT Save/Load seem to be working properly. :D
duncan
Posts: 12038
Joined: Mon Jul 07, 2008 10:50 pm

Re: Stockfish version with hash saving capability

Post by duncan »

zullil wrote: Perhaps your expectations are unrealistic? After finding the mate-in-9, you saved the hash. So, when you reloaded that hash and searched the original position, the engine now had an exact score (mate-in-9) for that one position. I wouldn't expect that knowledge to be all that helpful in determining the evaluation of the original position. There are so many other nodes that still need to be considered.
thanks for the explanation.something else I would like to know. I believe 7 pawns is mate in 12 (not found it yet) others have said 8 pawns on the board is mate in 14. is there anything unusual about that that it takes 2 moves to wipe off one pawn and get to equivalent of 7 pawns.?
User avatar
Zerbinati
Posts: 122
Joined: Mon Aug 18, 2014 7:12 pm
Location: Trento (Italy)

Re: Stockfish version with hash saving capability

Post by Zerbinati »

Rodolfo Leoni wrote:
duncan wrote: is there a reason why LoadHashfromFile has to be clicked for it to work, as opposed to loading by default from current directory. ?as there is a danger if you forget to click LoadHashfromFile and then save it. you can overwrite days of analysis.
In addition to what Daniel wrote, I'd say your engine needs its hash free and available for other uses than positions analysis. It's matter of performance. So you need the command buttons, until this system will become a structured, additional hashes one (like in Stockfish PA GTB and Critter). When done, you'll "only" need a checkbox for using the PHs, and all other tuneable setting options.
Hi Daniel
Confirm that maximum hash size is 2gb?
Beyond this value I get (0kb)
peter
Posts: 3185
Joined: Sat Feb 16, 2008 7:38 am
Full name: Peter Martan

Re: Stockfish version with hash saving capability

Post by peter »

zullil wrote:
Guenther wrote: Now the TT Save/Load seem to be working properly. :D
Can confirm that as for Fritz14 GUI and Win7x64pro (popcount- compile)
Peter.
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Stockfish version with hash saving capability

Post by zullil »

peter wrote:
zullil wrote:
Guenther wrote: Now the TT Save/Load seem to be working properly. :D
Can confirm that as for Fritz14 GUI and Win7x64pro (popcount- compile)
Sorry, Peter. I can only confirm that the Linux version seemed to work properly from a command line.

What are these other things you mention? Windows? GUI? :wink:
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: Stockfish version with hash saving capability

Post by cdani »

Zerbinati wrote: Hi Daniel
Confirm that maximum hash size is 2gb?
Beyond this value I get (0kb)
Didn't know that happens. I try to see the cause.
Thanks.
User avatar
Zerbinati
Posts: 122
Joined: Mon Aug 18, 2014 7:12 pm
Location: Trento (Italy)

Re: Stockfish version with hash saving capability

Post by Zerbinati »

cdani wrote:
Zerbinati wrote: Hi Daniel
Confirm that maximum hash size is 2gb?
Beyond this value I get (0kb)
Didn't know that happens. I try to see the cause.
Thanks.
Thanks Daniel :D
duncan
Posts: 12038
Joined: Mon Jul 07, 2008 10:50 pm

Re: Stockfish version with hash saving capability

Post by duncan »

zullil wrote: asmFish eventually found mate-in-11 from the original position. But it took a while.

Code: Select all

info depth 54 seldepth 24 multipv 1 time 5491130 nps 50956798 score mate 11 nodes 279810404462 hashfull 999 tbhits 0 pv a2a4 h7h5 d2d4 c7c6 e2e4 g7g6 d4d5 g6g5 d1h5 e8d8 h5f7 c6d5 f1b5 d5e4 f7d5 d8c8 d5d7 c8b8 b5a6 b8a8 d7b7

is your nps 50956798 which is very fast and quicker than threadripper.? May I ask what sytem you are using?
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: Stockfish version with hash saving capability

Post by cdani »

Done! Now they can work with files larger than 2 GB.

Andscacs:

www.andscacs.com/downloads/andscacs091237.zip

Stockfish:

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

Stockfish changes:

Code: Select all

bool TranspositionTable::save() {
	std::ofstream b_stream(hashfilename,
		std::fstream::out | std::fstream::binary);
	if (b_stream)
	{
		//b_stream.write&#40;reinterpret_cast<char const *>&#40;table&#41;, clusterCount * sizeof&#40;Cluster&#41;);
		for &#40;long long i = 0; i < clusterCount * sizeof&#40;Cluster&#41;; i += &#40;1 << 30&#41;) &#123; //1GB
			long long j = __min&#40;&#40;1 << 30&#41;, &#40;clusterCount * sizeof&#40;Cluster&#41;) - i&#41;;
			b_stream.write&#40;reinterpret_cast<char const *>&#40;table&#41; + i, j&#41;;
		&#125;
		return &#40;b_stream.good&#40;));
	&#125;
	return false;
&#125;

void TranspositionTable&#58;&#58;load&#40;) &#123;
	//file size&#58; https&#58;//stackoverflow.com/questions/2409504/using-c-filestreams-fstream-how-can-you-determine-the-size-of-a-file
	std&#58;&#58;ifstream file;
	file.open&#40;hashfilename, std&#58;&#58;ios&#58;&#58;in | std&#58;&#58;ios&#58;&#58;binary&#41;;
	file.ignore&#40;std&#58;&#58;numeric_limits<std&#58;&#58;streamsize>&#58;&#58;max&#40;));
	std&#58;&#58;streamsize size = file.gcount&#40;);
	file.clear&#40;);   //  Since ignore will have set eof.
	resize&#40;size / 1024 / 1024&#41;;
	file.seekg&#40;0, std&#58;&#58;ios&#58;&#58;beg&#41;;
	file.read&#40;reinterpret_cast<char *>&#40;table&#41;, clusterCount * sizeof&#40;Cluster&#41;);
&#125;