Answers.Body: <p><strong>Short answer</strong></p>
  
  <p>No, don't set it to zero, in fact the more the better. Stockfish <em>is</em> using the hash table <em>very</em> heavily, just that you can't see it.</p>
  
  <p><strong>Long answer</strong></p>
  
  <p>Let's briefly cover hashing in a non-technical way</p>
  
  <p><em>Q: What is hash table?</em></p>
  
  <p>Hash table is an internal data structure in chess engines to "memorize" previously searched positions. It's like the black-hole; you can't see it but it's part of the galaxy.</p>
  
  <p><em>Q: Why hash table?</em></p>
  
  <p>Because we don't want to the engine search the same position again and again. There're lots of repetitions in chess, hash table is a simple but very effective strategy to deal with them. Hash table also helps move reductions and pruncing.</p>
  
  <p>Let's look at the quote:</p>
  
  <blockquote>
    <p>Hash size is the amount of memory you want to designate for Stockfish
    to store positions (a temporary hash). You don't want your hash size
    to exceed your physical memory, but you don't want it to be too small
    either.</p>
  </blockquote>
  
  <p>If your computer has 4GB of RAM, you wouldn't set it over 4GB (google virtual memory if you are interested to learn more). But at the same time, making it too small would be a waste of resources. You would have to pay for the electricity to power up the computer anyway, so we want to maximise the size of the hash table as much as possible without affecting the overall performance.</p>
  
  <p>Let's pretend we are using Stockfish to analyze the starting position.</p>
  
  <p>You were confused because you thought hashing is like just storing the initial position:</p>
  
  <p>Hash Table :  { default position }</p>
  
  <p>This is not correct, because the table is actually being used in the engine search. The hash table would look something like:</p>
  
  <p>Hash Table : { default position, 1.e4, 1.d4, 1.e4 e5, 1.a4, 1.a4 h5 .....}</p>
  
  <p>Although you can't see it, hashing is very important because it memories positions that you will need in the current search and next search. Let's say we play 1.a4, immediately from the hash-table we have an evaluation of 1.a4 h5 from the previous search.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-29T21:00:38.450Z
Answers.Text: Yes, in other words, the hash table is not storing positions the user ever sees (mostly), it is storing all the millions of positions it sees in its forward search to calculate the value of the current position. And as you say, there are tons of repeats all throughout that search (transpositions, but also piece "tours" and backwards moves). If a position (and already-calculated value) is found in the hash table, it saves having to recalculate the value, which could be very significant for moves higher in the tree, where whole swaths of the tree can avoid being recalculated.
Answers.UserDisplayName: Jeff Y
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-22T23:54:55.347Z
Answers.LastActivityDate: 2015-10-22T23:54:55.347Z
Answers.UserDisplayName: SmallChess
Body: <p>I am using a UCI chess engine (stockfish 6) to evaluate the score of specific positions from different games.</p>
  
  <p>On <a href="http://support.stockfishchess.org/discussions/questions/54-search-by-time-and-hash-size" rel="nofollow">this</a> stockfish help forum thread it states: <code>Hash size is the amount of memory you want to designate for Stockfish to store positions (a temporary hash). You don't want your hash size to exceed your physical memory, but you don't want it to be too small either.</code></p>
  
  <p>In my case I am not using the engine to go through subsequent moves in the same game, but different positions entirely. For example:</p>
  
  <p>after 4th move of Aldrovandi vs. Cocozza (2003):</p>
  
  <pre><code>position fen rnbqkbnr/pppp2pp/8/4pp2/8/5P2/PPPPPKPP/RNBQ1BNR w kq f6 0 3
  go movetime 10000
  info depth 16 seldepth 25 multipv 1 score cp -71 nodes 2171367 nps 879095 tbhits 0 time 2470 pv b1c3 b8c6 e2e3 f5f4 g2g3 d7d5 d2d4 g8e7 f2g2 f4e3 c1e3 e7f5
  </code></pre>
  
  <p>after 2nd move of Hirneise vs. Hirneise (2010):</p>
  
  <pre><code>position fen r1bqkbnr/pppppppp/n7/8/8/7N/PPPPPPPP/RNBQKB1R w KQkq - 2 2
  go movetime 10000
  info depth 19 seldepth 24 multipv 1 score cp 16 nodes 7228257 nps 723259 tbhits 0 time 9994 pv d2d4 g8f6 e2e3 e7e6 c2c4 d7d5 b1c3 f8e7 f1e2
  </code></pre>
  
  <p>In these consecutive uses of the engine, I am solely interested in <strong>score cp -71</strong> and <strong>score cp 16</strong></p>
  
  <p>It seems that the Hash is not used at all and thus I can set it to zero. Is that correct? Is there a way to disable the Hash entirely in the UCI specification? The reason I ask is I am using a mobile device so conserving memory is more relevant.</p>
  
Tags: <engines><software><stockfish><evaluation><uci>
Title: When evaluating score of new position with UCI chess engine is the Hash used at all?
ThreadText: # When evaluating score of new position with UCI chess engine is the Hash used at all?
  
  (Asked by: username_0 on 2015-10-22)
  
  I am using a UCI chess engine (stockfish 6) to evaluate the score of specific positions from different games.
  On this stockfish help forum thread it states: Hash size is the amount of memory you want to designate for Stockfish to store positions (a temporary hash). You don't want your hash size to exceed your physical memory, but you don't want it to be too small either.
  In my case I am not using the engine to go through subsequent moves in the same game, but different positions entirely. For example:
  after 4th move of Aldrovandi vs. Cocozza (2003):
  position fen rnbqkbnr/pppp2pp/8/4pp2/8/5P2/PPPPPKPP/RNBQ1BNR w kq f6 0 3
  go movetime 10000
  info depth 16 seldepth 25 multipv 1 score cp -71 nodes 2171367 nps 879095 tbhits 0 time 2470 pv b1c3 b8c6 e2e3 f5f4 g2g3 d7d5 d2d4 g8e7 f2g2 f4e3 c1e3 e7f5
  
  after 2nd move of Hirneise vs. Hirneise (2010):
  position fen r1bqkbnr/pppppppp/n7/8/8/7N/PPPPPPPP/RNBQKB1R w KQkq - 2 2
  go movetime 10000
  info depth 19 seldepth 24 multipv 1 score cp 16 nodes 7228257 nps 723259 tbhits 0 time 9994 pv d2d4 g8f6 e2e3 e7e6 c2c4 d7d5 b1c3 f8e7 f1e2
  
  In these consecutive uses of the engine, I am solely interested in score cp -71 and score cp 16
  It seems that the Hash is not used at all and thus I can set it to zero. Is that correct? Is there a way to disable the Hash entirely in the UCI specification? The reason I ask is I am using a mobile device so conserving memory is more relevant.
  
  **Tags:** engines, software, stockfish, evaluation, uci
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-10-22. Score: 3 | Accepted answer
  
  **Short answer**
  
  No, don't set it to zero, in fact the more the better. Stockfish *is* using the hash table *very* heavily, just that you can't see it.
  
  **Long answer**
  
  Let's briefly cover hashing in a non-technical way
  
  *Q: What is hash table?*
  
  Hash table is an internal data structure in chess engines to "memorize" previously searched positions. It's like the black-hole; you can't see it but it's part of the galaxy.
  
  *Q: Why hash table?*
  
  Because we don't want to the engine search the same position again and again. There're lots of repetitions in chess, hash table is a simple but very effective strategy to deal with them. Hash table also helps move reductions and pruncing.
  
  Let's look at the quote:
  
  > Hash size is the amount of memory you want to designate for Stockfish
  > to store positions (a temporary hash). You don't want your hash size
  > to exceed your physical memory, but you don't want it to be too small
  > either.
  
  If your computer has 4GB of RAM, you wouldn't set it over 4GB (google virtual memory if you are interested to learn more). But at the same time, making it too small would be a waste of resources. You would have to pay for the electricity to power up the computer anyway, so we want to maximise the size of the hash table as much as possible without affecting the overall performance.
  
  Let's pretend we are using Stockfish to analyze the starting position.
  
  You were confused because you thought hashing is like just storing the initial position:
  
  Hash Table : { default position }
  
  This is not correct, because the table is actually being used in the engine search. The hash table would look something like:
  
  Hash Table : { default position, 1.e4, 1.d4, 1.e4 e5, 1.a4, 1.a4 h5 .....}
  
  Although you can't see it, hashing is very important because it memories positions that you will need in the current search and next search. Let's say we play 1.a4, immediately from the hash-table we have an evaluation of 1.a4 h5 from the previous search.
  
  > **Comments:**
  > **username_2**: Yes, in other words, the hash table is not storing positions the user ever sees (mostly), it is storing all the millions of positions it sees in its forward search to calculate the value of the current position. And as you say, there are tons of repeats all throughout that search (transpositions, but also piece "tours" and backwards moves). If a position (and already-calculated value) is found in the hash table, it saves having to recalculate the value, which could be very significant for moves higher in the tree, where whole swaths of the tree can avoid being recalculated.  
  
  ---
  
  