Answers.Body: <p>I actually did the experiment and will answer now. Three main factors go into the evaluation (as king safety doesn't play the slightest role): material, space, and movability.</p>
  <p>The effect of space is rather high at +1.4.</p>
  <pre><code>[FEN &quot;4k3/p1p1p1p1/P1P1P1P1/8/8/8/8/4K3 w - - 0 1&quot;]
  </code></pre>
  <p>Any useless doubled pawn is about +0.7, giving +4.2.</p>
  <pre><code>[FEN &quot;4k3/p1p1p1p1/P1P1P1P1/P1P1P1P1/8/8/8/4K3 w - - 0 1&quot;]
  </code></pre>
  <p>Don't underestimate agility, we're already at +5.9.</p>
  <pre><code>[FEN &quot;4k3/p1p1p1p1/P1P1P1P1/8/8/8/P1P1P1P1/4K3 w - - 0 1&quot;]
  </code></pre>
  <p>You can give White a useless bishop and scratch the 10.0 but I stop here, although it would be a fun challenge for the highest evaluation in a dead drawn position But +99.0 seems to be Lichess/Stockfish cutoff. :-)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-12T21:04:23.193Z
Answers.Text: You could also replace a pawn for another bishop (a promoted one) if you wanted to further pump up the eval
Answers.UserDisplayName: pulsar512b
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-13T10:25:55.130Z
Answers.Text: @pulsar512b - Been there, done that, Lichess doesn't even complain against 32 bishops :-) Likewise, a walled in Q or R works wonders. An engine is hopelessly optimistic: Maybe it can break out somewhere over the horizon...
Answers.UserDisplayName: Hauke Reddmann
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-12T20:22:25.633Z
Answers.LastActivityDate: 2021-02-12T20:51:45.283Z
Answers.LastEditDate: 2021-02-12T20:51:45.283Z
Answers.UserDisplayName: Hauke Reddmann
Body: <p>Let us look at this position.</p>
  <pre><code>[FEN &quot;4k3/8/8/p1p1p1p1/P1P1P1P1/8/8/4K3 w - - 0 1&quot;]
  </code></pre>
  <p>This is obviously a draw. Analyzing this with the Stockfish engine says that it is a balanced position. However, Stockfish does not recognize that it is a draw.</p>
  <p>Slightly rearranging the pawns, we receive a similar position that is an obvious draw.</p>
  <pre><code>[FEN &quot;4k3/3p4/p1pPp3/P1P1P1p1/6P1/8/8/4K3 w - - 0 1&quot;]
  </code></pre>
  <p>Here, Stockfish says that white has an advantage of +0.7.</p>
  <p>Where does this miscalculation come from? I understand that draws in these positions cannot be detected from tablebases, as there are still too many pieces on the board. It seems that these special positions are called <a href="https://www.chessprogramming.org/Pawn_Rams_(Bitboards)" rel="nofollow noreferrer">Pawn Rams</a> or <a href="https://www.chessprogramming.org/Blockage_Detection" rel="nofollow noreferrer">Blockages</a>.</p>
  <p>The chess programming article about <a href="https://www.chessprogramming.org/Blockage_Detection" rel="nofollow noreferrer">Blockage Detection</a> provides code for detecting blockages, but I do not understand how it works.</p>
  <p>What are the underlying factors that make draw detection so hard from a computational point of view?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-09T18:12:25.677Z
Comments.Text: Are you interested in theoretical draws or only dead positions?
Comments.UserDisplayName: Brian McCutchon
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-09T18:16:23.363Z
Comments.Text: @BrianMcCutchon What is the difference?
Comments.UserDisplayName: banana_bunny
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-09T18:22:06.297Z
Comments.Text: A theoretical draw is a draw if both players play perfectly. For example, the starting position might be a theoretical draw (we don't know yet, and maybe never will). A dead position is a draw no matter what you play. Your examples are dead positions.
Comments.UserDisplayName: Brian McCutchon
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-11T01:58:25.903Z
Comments.Text: You might be interested: https://chess.stackexchange.com/questions/32270/lichess-endgame-evaluation
Comments.UserDisplayName: Allure
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-11T01:58:57.220Z
Comments.Text: I do believe the question is answerable, but it is very broad, since there are four questions asked and some of them aren't related to the others (e.g. 4 and 3)
Comments.UserDisplayName: Allure
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-11T15:34:05.513Z
Comments.Text: I think the answer to the main question is obvious: Spaaaaace. Suggested experiment: Place all black pawns on their original square. If I'm right, Whites plus will go further up. Also, blockades are *notorically* difficult to detect by engines. Experiment 2: Give White another useless double pawn, what happens? What has more effect?
Comments.UserDisplayName: Hauke Reddmann
Tags: <engines><programming><draw><50-move-rule><dead-position>
Title: A question about draw detection in chess engines
ThreadText: # A question about draw detection in chess engines
  
  (Asked by: username_0 on 2021-02-09)
  
  Let us look at this position.
  [FEN "4k3/8/8/p1p1p1p1/P1P1P1P1/8/8/4K3 w - - 0 1"]
  
  This is obviously a draw. Analyzing this with the Stockfish engine says that it is a balanced position. However, Stockfish does not recognize that it is a draw.
  Slightly rearranging the pawns, we receive a similar position that is an obvious draw.
  [FEN "4k3/3p4/p1pPp3/P1P1P1p1/6P1/8/8/4K3 w - - 0 1"]
  
  Here, Stockfish says that white has an advantage of +0.7.
  Where does this miscalculation come from? I understand that draws in these positions cannot be detected from tablebases, as there are still too many pieces on the board. It seems that these special positions are called Pawn Rams or Blockages.
  The chess programming article about Blockage Detection provides code for detecting blockages, but I do not understand how it works.
  What are the underlying factors that make draw detection so hard from a computational point of view?
  
  **Tags:** engines, programming, draw, 50-move-rule, dead-position
  
  > **Comments:**
  > **username_1**: Are you interested in theoretical draws or only dead positions?  
  > **username_0**: @BrianMcCutchon What is the difference?  
  > **username_1**: A theoretical draw is a draw if both players play perfectly. For example, the starting position might be a theoretical draw (we don't know yet, and maybe never will). A dead position is a draw no matter what you play. Your examples are dead positions.  
  > **username_2**: You might be interested: https://chess.stackexchange.com/questions/32270/lichess-endgame-evaluation  
  > **username_2**: I do believe the question is answerable, but it is very broad, since there are four questions asked and some of them aren't related to the others (e.g. 4 and 3)  
  > **username_3**: I think the answer to the main question is obvious: Spaaaaace. Suggested experiment: Place all black pawns on their original square. If I'm right, Whites plus will go further up. Also, blockades are *notorically* difficult to detect by engines. Experiment 2: Give White another useless double pawn, what happens? What has more effect?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2021-02-12. Score: 3
  
  I actually did the experiment and will answer now. Three main factors go into the evaluation (as king safety doesn't play the slightest role): material, space, and movability.
  The effect of space is rather high at +1.4.
  [FEN "4k3/p1p1p1p1/P1P1P1P1/8/8/8/8/4K3 w - - 0 1"]
  
  Any useless doubled pawn is about +0.7, giving +4.2.
  [FEN "4k3/p1p1p1p1/P1P1P1P1/P1P1P1P1/8/8/8/4K3 w - - 0 1"]
  
  Don't underestimate agility, we're already at +5.9.
  [FEN "4k3/p1p1p1p1/P1P1P1P1/8/8/8/P1P1P1P1/4K3 w - - 0 1"]
  
  You can give White a useless bishop and scratch the 10.0 but I stop here, although it would be a fun challenge for the highest evaluation in a dead drawn position But +99.0 seems to be Lichess/Stockfish cutoff. :-)
  
  > **Comments:**
  > **username_4**: You could also replace a pawn for another bishop (a promoted one) if you wanted to further pump up the eval  
  > **username_3**: @username_4 - Been there, done that, Lichess doesn't even complain against 32 bishops :-) Likewise, a walled in Q or R works wonders. An engine is hopelessly optimistic: Maybe it can break out somewhere over the horizon...  
  
  ---
  
  