Don't overwrite exsisting TT with null search value
authorMarco Costalba <mcostalba@gmail.com>
Wed, 14 Apr 2010 05:13:24 +0000 (06:13 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 16 Apr 2010 04:52:18 +0000 (05:52 +0100)
Real search is considered of higher quality then null
search one.

This allows to fix the zugzwang issue with a minimal
impact on ELO.

Zugzwang verified on position:

8/7P/8/8/K2b4/p7/1k6/1B6 b - -

After 999 games at 1+0 on my QUAD
Mod vs Orig(94bb196) +168 =657 -174  -2 ELO

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

index 043c433a648cba38fb0bab2be01cf3a45b2d2385..4c7e1e463dc553ae53c2efee850c215fb5f24223 100644 (file)
@@ -1395,7 +1395,9 @@ namespace {
             {
                 assert(value_to_tt(nullValue, ply) == nullValue);
 
-                TT.store(posKey, nullValue, VALUE_TYPE_NS_LO, depth, MOVE_NONE);
+                if (!tte)
+                    TT.store(posKey, nullValue, VALUE_TYPE_NS_LO, depth, MOVE_NONE);
+
                 return nullValue;
             }
         } else {