Answers.Body: <ol>
  <li><p>Depends on the program and how they implemented it. Many have memorized openings and transpositions later on in the game are usually short enough that the depth of analysis handles it.</p></li>
  <li><p>Not for me.  But I am old school when it comes to programming.  You may or may not like C++.</p></li>
  <li><p>Nodes/sec depends on the hardware, opsys, language, and your coding.  The algorithm is far more important for good results. </p></li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-08T15:15:07.810Z
Answers.Text: thank you for your answer! 
  What exactly do you mean by "transpositions [...] are usually short enough that the depth [...] handles it"
  
  Do transpositions only store the evaluation of leafs?
Answers.UserDisplayName: Finn Eggers
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-08T17:52:06.403Z
Answers.Text: @Finn Eggers  -- I can only speak from when I ran into transpositions in my games.  They were always in the openings, and well within the book values that were stored from GM games.  None of them were more than a half dozen moves into the opening.  Later in the game I have seen some alternative lines but they are rarely more  than a few moves and are usually restricted by a choice of sequencing forcing moves.
Answers.UserDisplayName: yobamamama
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-08T17:54:31.760Z
Answers.Text: That makes sense to me but they are only for node leafs, right?
Answers.UserDisplayName: Finn Eggers
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-08T17:58:41.017Z
Answers.Text: @FinnEggers  --  That should be the case.  I see no problems with transpositions.  Not sure what the actual concern is.
Answers.UserDisplayName: yobamamama
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-08T18:02:11.163Z
Answers.Text: Oh I see. It makes sense. I just thought about it for a second and realised that its actually simpler than I expected. Thank you for your help!
  
  One last question, is PV important to implement? Is there a huge benefit of principal variation?
Answers.UserDisplayName: Finn Eggers
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-08T18:17:57.103Z
Answers.Text: @FinnEggers  --  It would make sense in that it would seem good to take the PV deeper in the analysis.  Why take what looks bad so much farther when there is a line that looks better.  Crude example:  one variation white loses the Queen. IF the next few moves don't appear to lead to mate then do not follow that one much farther.  But in the variation that white wins a piece then it should be done farther to ensure no surprises later on.   Although for true sacrifices the 'surprise' usually comes well within the normal depth you would search anyway.  Still  why not continue PV in more depth.
Answers.UserDisplayName: yobamamama
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-08T15:02:44.507Z
Answers.LastActivityDate: 2019-12-08T15:02:44.507Z
Answers.UserDisplayName: yobamamama
Body: <p>I hope this is the right place to post this question. So I like to implement things myself without using libraries and one of my first projects was a chess engine and I would like to improve this one.</p>
  
  <p>I got multiple questions:</p>
  
  <hr>
  
  <ol>
  <li><blockquote>
    <p>How are transposition tables used? Usually the serch algorithm has a
    fixed depth so we cannot "evaluate" non-leafs with the transposition
    tables, right? So the only purpose would be to hash the board
    evaluation of the leafs. Is this correct?</p>
  </blockquote></li>
  <li><blockquote>
    <p>I am using Java without multithreads. Is it worth to look into magic bitboards and switch to C++? They seem to be pretty messy at the first glance.</p>
  </blockquote></li>
  <li><blockquote>
    <p>How many nodes per second are realistic to reach with a "simple" engine. I got up to 1E6. I know that Stockfish reaches 80E6. Is it more worth to improve on nodes per second or on the algorithm itself?</p>
  </blockquote></li>
  </ol>
  
  <p>I am very happy for any help.</p>
  
Tags: <engines>
Title: Use of transposition tables in chess engines
ThreadText: # Use of transposition tables in chess engines
  
  (Asked by: username_0 on 2019-12-08)
  
  I hope this is the right place to post this question. So I like to implement things myself without using libraries and one of my first projects was a chess engine and I would like to improve this one.
  
  I got multiple questions:
  
  ---
  
  1. > How are transposition tables used? Usually the serch algorithm has a
     > fixed depth so we cannot "evaluate" non-leafs with the transposition
     > tables, right? So the only purpose would be to hash the board
     > evaluation of the leafs. Is this correct?
  2. > I am using Java without multithreads. Is it worth to look into magic bitboards and switch to C++? They seem to be pretty messy at the first glance.
  3. > How many nodes per second are realistic to reach with a "simple" engine. I got up to 1E6. I know that Stockfish reaches 80E6. Is it more worth to improve on nodes per second or on the algorithm itself?
  
  I am very happy for any help.
  
  **Tags:** engines
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-12-08. Score: 2 | Accepted answer
  
  1. Depends on the program and how they implemented it. Many have memorized openings and transpositions later on in the game are usually short enough that the depth of analysis handles it.
  2. Not for me. But I am old school when it comes to programming. You may or may not like C++.
  3. Nodes/sec depends on the hardware, opsys, language, and your coding. The algorithm is far more important for good results.
  
  > **Comments:**
  > **username_0**: thank you for your answer!  What exactly do you mean by "transpositions [...] are usually short enough that the depth [...] handles it"  Do transpositions only store the evaluation of leafs?  
  > **username_1**: @username_0  -- I can only speak from when I ran into transpositions in my games.  They were always in the openings, and well within the book values that were stored from GM games.  None of them were more than a half dozen moves into the opening.  Later in the game I have seen some alternative lines but they are rarely more  than a few moves and are usually restricted by a choice of sequencing forcing moves.  
  > **username_0**: That makes sense to me but they are only for node leafs, right?  
  > **username_1**: @FinnEggers  --  That should be the case.  I see no problems with transpositions.  Not sure what the actual concern is.  
  > **username_0**: Oh I see. It makes sense. I just thought about it for a second and realised that its actually simpler than I expected. Thank you for your help!  One last question, is PV important to implement? Is there a huge benefit of principal variation?  
  > **username_1**: @FinnEggers  --  It would make sense in that it would seem good to take the PV deeper in the analysis.  Why take what looks bad so much farther when there is a line that looks better.  Crude example:  one variation white loses the Queen. IF the next few moves don't appear to lead to mate then do not follow that one much farther.  But in the variation that white wins a piece then it should be done farther to ensure no surprises later on.   Although for true sacrifices the 'surprise' usually comes well within the normal depth you would search anyway.  Still  why not continue PV in more depth.  
  
  ---
  
  