X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=a5b07d2f18c30185d2da0192076dd612578a0480;hp=394f228fb4f59956914ab3d014b199934d245716;hb=1463881153a20690871086208eaf76f20041effb;hpb=29bc1283841c8a935796159c6d3093ec879c246f diff --git a/src/search.cpp b/src/search.cpp index 394f228f..a5b07d2f 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -514,10 +514,16 @@ namespace { Thread* thisThread = pos.this_thread(); inCheck = pos.checkers(); moveCount = captureCount = quietCount = ss->moveCount = 0; - ss->statScore = 0; bestValue = -VALUE_INFINITE; maxValue = VALUE_INFINITE; + // Initialize statScore to zero for the childs of the current position. + // So statScore is shared between sibling positions and only the first sibling + // starts with statScore = 0. Later siblings start with the last calculated + // statScore of the previous sibling. This influences in LMR the reduction rules + // which based on the statScore of parent position. + (ss+1)->statScore = 0; + // Check for the available remaining time if (thisThread == Threads.main()) static_cast(thisThread)->check_time();