]> git.sesse.net Git - stockfish/commitdiff
Allow SearchStack to link an EvalInfo object
authorMarco Costalba <mcostalba@gmail.com>
Mon, 18 Jan 2010 09:01:49 +0000 (10:01 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 18 Jan 2010 09:03:09 +0000 (10:03 +0100)
This will allow to have wider access to attack
information, for instance from MovePicker.

Note that 'eval' field become obsolete, it is kept
just becasue when we get a position score from TT
we update 'eval' even without an EvalInfo object.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp
src/search.h

index d659fab6a1654f6bce5b1ed4d26e120d3962cb3a..403c9363abee5d95ea5589a4d524c92680ec324c 100644 (file)
@@ -653,6 +653,7 @@ void SearchStack::init(int ply) {
   currentMove = threatMove = MOVE_NONE;
   reduction = Depth(0);
   eval = VALUE_NONE;
+  evalInfo = NULL;
 }
 
 void SearchStack::initKillers() {
@@ -1375,14 +1376,15 @@ namespace {
     const int FutilityValueMargin = 112 * bitScanReverse32(int(depth) * int(depth) / 2);
 
     // Evaluate the position statically
-    if (isCheck)
-        ss[ply].eval = VALUE_NONE;
-    else
+    if (!isCheck)
     {
         if (tte && (tte->type() & VALUE_TYPE_EVAL))
             staticValue = value_from_tt(tte->value(), ply);
         else
+        {
             staticValue = evaluate(pos, ei, threadID);
+            ss[ply].evalInfo = &ei;
+        }
 
         ss[ply].eval = staticValue;
         futilityValue = staticValue + FutilityValueMargin;
index db9bef3c69fec6bed8d21a0386a08972321b7160..7b114bf2126ec4b20639bf8772219c8d2130888b 100644 (file)
@@ -47,6 +47,7 @@ const int KILLER_MAX = 2;
 /// from nodes shallower and deeper in the tree during the search.  Each
 /// search thread has its own array of SearchStack objects, indexed by the
 /// current ply.
+struct EvalInfo;
 
 struct SearchStack {
   Move pv[PLY_MAX_PLUS_2];
@@ -56,6 +57,7 @@ struct SearchStack {
   Move killers[KILLER_MAX];
   Depth reduction;
   Value eval;
+  EvalInfo* evalInfo;
 
   void init(int ply);
   void initKillers();