Answers.Body: <p>Just guessing without reading all of the code to understand completely.</p>
  
  <p>1) The third condition to not preform a Null Move is zugswang.  Another hint is that INF is used to report a mate-in-x. </p>
  
  <p>2)  The purpose of a Null Move is to determine if we could do nothing and still be better so to cause an early cutoff.  I assume that they represent a pawn value as 100, so they want a slightly higher favorable eval before it causes a cutoff.  </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-07T06:54:49.257Z
Answers.LastActivityDate: 2020-06-07T06:54:49.257Z
Answers.UserDisplayName: Mike Jones
Body: <p>I have two questions about a code implementing a static null move. The questions are in the code.</p>
  
  <p>The code is extracted from here: <a href="https://github.com/nescitus/cpw-engine/blob/2054969ef201c23e44774fd667c2b6843f04eede/search.cpp#L280" rel="nofollow noreferrer">CPW engine search code</a></p>
  
  <pre><code> if (depth &lt; 3
              &amp;&amp; !is_pv
              &amp;&amp; !flagInCheck
              &amp;&amp;  abs(beta - 1) &gt; -INF + 100) // 1. Why this condition?
          {
              int static_eval = eval(alpha, beta, 1);
  
              int eval_margin = 120 * depth; // 2. Why 120? What does it mean?
              if (static_eval - eval_margin &gt;= beta)
                  return static_eval - eval_margin;
          }
  </code></pre>
  
Tags: <engines><programming>
Title: Static null move CPW engine
ThreadText: # Static null move CPW engine
  
  (Asked by: username_0 on 2020-06-07)
  
  I have two questions about a code implementing a static null move. The questions are in the code.
  The code is extracted from here: CPW engine search code
   if (depth < 3
              && !is_pv
              && !flagInCheck
              &&  abs(beta - 1) > -INF + 100) // 1. Why this condition?
          {
              int static_eval = eval(alpha, beta, 1);
  
              int eval_margin = 120 * depth; // 2. Why 120? What does it mean?
              if (static_eval - eval_margin >= beta)
                  return static_eval - eval_margin;
          }
  
  **Tags:** engines, programming
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-06-07. Score: 1
  
  Just guessing without reading all of the code to understand completely.
  
  1) The third condition to not preform a Null Move is zugswang. Another hint is that INF is used to report a mate-in-x.
  
  2) The purpose of a Null Move is to determine if we could do nothing and still be better so to cause an early cutoff. I assume that they represent a pawn value as 100, so they want a slightly higher favorable eval before it causes a cutoff.
  
  
  ---
  
  