Answers.Body: <p>Something very similar is doubtless encoded into AlphaZero and Leela's neural network evaluators, which are very positional.  Most conventional Minimax engines, by contrast, are stronger at tactics and can therefore search very deeply.</p>
  
  <p>Pawn structure is indeed a factor in most of the top engines' evaluation.  This might take the relatively simple form of rewarding connected pawns and penalising isolated and doubled pawns.  The pawn bitboards are mainly a means of recognising when the pawn structure changes (which happens relatively infrequently once established) and recalculating that factor of the evaluation, thereby saving some calculation time.</p>
  
  <p>However, the pawn structure does not directly lead to the bishop mobility analysis you note in your first example.  This would be deferred to threat and control maps, which would put any of the bishop's legal moves low on the priority list for further analysis, since they leave the bishop on a threatened square with no support.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-14T03:31:05.207Z
Answers.Text: I'm thinking of traditional engines in this question, and of creating several hundred "if [pawn structure] = [this bitboard] then ..." loops. One could then have "if the pawn structure is as in the first diagram, impose massive penalties for the bishop on a1" kind of handwritten eval, which I've noted today's top engines still enter into.
Answers.UserDisplayName: Allure
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-14T05:13:01.230Z
Answers.Text: I'm not aware of any handwritten position-specific rules of that sort, and I sincerely doubt that you could feasibly develop such detailed rules by hand.  Although some instances of pawn structure will be more common than others, the sheer number of even "common" positions is too large, and thoroughly analysing each one would take too long.
Answers.UserDisplayName: Chromatix
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-14T05:17:47.390Z
Answers.Text: too long for the programmer, or for the engine (in the sense that the engine searches to lower depth because it has such loops)? If the former, it still sounds like a possible project to me because it can potentially gain elo.
Answers.UserDisplayName: Allure
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-14T05:57:27.013Z
Answers.Text: Too long for the programmer.  And it would only gain elo if the resulting heuristics were more accurate than the simpler heuristics more commonly used, which is very difficult to ensure over such a broad category, without the sort of near-exhaustive analysis that neural-net engines apply.  That's why pawn-structure and threat/control map evaluations use featural heuristics as I described, as those are much easier to show the value of.
Answers.UserDisplayName: Chromatix
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-13T14:23:13.643Z
Answers.LastActivityDate: 2019-11-13T14:23:13.643Z
Answers.UserDisplayName: Chromatix
Body: <p>As I understand it, engines use so-called "bitboards" to generate the current position &amp; possible moves. I'm wondering if any engine uses the pawn bitboard to refine its search and eval.</p>
  
  <p>To illustrate what I mean, suppose this is the current pawn structure:</p>
  
  <pre><code>[FEN "8/8/8/2p5/1pPp4/pP1P4/P7/B7 w - - 0 1"]
  </code></pre>
  
  <p>In this pawn structure, impose massive penalties for the Bishop on a1 because it's more or less permanently stuck.</p>
  
  <pre><code>[FEN "8/1pp4p/p2p4/3Pp1p1/2P1Pp2/5P2/PP4PP/8 w - - 0 1"]
  </code></pre>
  
  <p>In this pawn structure, as White, prioritize searching variations that include the moves b4-c5, and as Black, prioritize searching variations that include h5-g4.</p>
  
  <p>I don't know how many possible pawn bitboards are there, but presumably not too many arise in serious play (a couple hundred perhaps) and one could have handwritten functions for all of them. Some bitboards could even be duplicated, e.g. in the second bitboard it doesn't matter if Black's pawn is on h7 or h6, general plans for both sides remain the same. If there are no special plans for the current pawn structure, one could also default to the current search/eval algorithms.</p>
  
  <p>Question: Is this idea feasible? If so, are there any engines that use it? If not, why not?</p>
  
  <p><strong>EDIT</strong>: seems to me that traditional engines could really use something like this, e.g. in <a href="https://www.tcec-chess.com/archive.html?season=17&amp;div=cpul1redtest1&amp;game=29" rel="nofollow noreferrer">this game</a> no less an engine than Stockfish falls into this trap, when in spite of having a firmly entombed bishop, it thought its position was superior.</p>
  
  <pre><code>[FEN "2r3k1/p2n1r2/4q3/2Pp2b1/PP4p1/B4pPp/2Q2P1P/R2R2KB w - - 1 30"]
  </code></pre>
  
Tags: <engines><evaluation><pawn-structure><bitboard>
Title: Can engines use the current pawn structure to refine its search/eval?
ThreadText: # Can engines use the current pawn structure to refine its search/eval?
  
  (Asked by: username_0 on 2019-11-11)
  
  As I understand it, engines use so-called "bitboards" to generate the current position & possible moves. I'm wondering if any engine uses the pawn bitboard to refine its search and eval.
  To illustrate what I mean, suppose this is the current pawn structure:
  [FEN "8/8/8/2p5/1pPp4/pP1P4/P7/B7 w - - 0 1"]
  
  In this pawn structure, impose massive penalties for the Bishop on a1 because it's more or less permanently stuck.
  [FEN "8/1pp4p/p2p4/3Pp1p1/2P1Pp2/5P2/PP4PP/8 w - - 0 1"]
  
  In this pawn structure, as White, prioritize searching variations that include the moves b4-c5, and as Black, prioritize searching variations that include h5-g4.
  I don't know how many possible pawn bitboards are there, but presumably not too many arise in serious play (a couple hundred perhaps) and one could have handwritten functions for all of them. Some bitboards could even be duplicated, e.g. in the second bitboard it doesn't matter if Black's pawn is on h7 or h6, general plans for both sides remain the same. If there are no special plans for the current pawn structure, one could also default to the current search/eval algorithms.
  Question: Is this idea feasible? If so, are there any engines that use it? If not, why not?
  EDIT: seems to me that traditional engines could really use something like this, e.g. in this game no less an engine than Stockfish falls into this trap, when in spite of having a firmly entombed bishop, it thought its position was superior.
  [FEN "2r3k1/p2n1r2/4q3/2Pp2b1/PP4p1/B4pPp/2Q2P1P/R2R2KB w - - 1 30"]
  
  **Tags:** engines, evaluation, pawn-structure, bitboard
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-11-13. Score: 3
  
  Something very similar is doubtless encoded into AlphaZero and Leela's neural network evaluators, which are very positional. Most conventional Minimax engines, by contrast, are stronger at tactics and can therefore search very deeply.
  
  Pawn structure is indeed a factor in most of the top engines' evaluation. This might take the relatively simple form of rewarding connected pawns and penalising isolated and doubled pawns. The pawn bitboards are mainly a means of recognising when the pawn structure changes (which happens relatively infrequently once established) and recalculating that factor of the evaluation, thereby saving some calculation time.
  
  However, the pawn structure does not directly lead to the bishop mobility analysis you note in your first example. This would be deferred to threat and control maps, which would put any of the bishop's legal moves low on the priority list for further analysis, since they leave the bishop on a threatened square with no support.
  
  > **Comments:**
  > **username_0**: I'm thinking of traditional engines in this question, and of creating several hundred "if [pawn structure] = [this bitboard] then ..." loops. One could then have "if the pawn structure is as in the first diagram, impose massive penalties for the bishop on a1" kind of handwritten eval, which I've noted today's top engines still enter into.  
  > **username_1**: I'm not aware of any handwritten position-specific rules of that sort, and I sincerely doubt that you could feasibly develop such detailed rules by hand.  Although some instances of pawn structure will be more common than others, the sheer number of even "common" positions is too large, and thoroughly analysing each one would take too long.  
  > **username_0**: too long for the programmer, or for the engine (in the sense that the engine searches to lower depth because it has such loops)? If the former, it still sounds like a possible project to me because it can potentially gain elo.  
  > **username_1**: Too long for the programmer.  And it would only gain elo if the resulting heuristics were more accurate than the simpler heuristics more commonly used, which is very difficult to ensure over such a broad category, without the sort of near-exhaustive analysis that neural-net engines apply.  That's why pawn-structure and threat/control map evaluations use featural heuristics as I described, as those are much easier to show the value of.  
  
  ---
  
  