]> git.sesse.net Git - stockfish/commitdiff
Reduce VALUE_KNOWN_WIN to 10000
authorUri Blass <uriblass@gmail.com>
Mon, 27 Jan 2014 19:08:31 +0000 (20:08 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 27 Jan 2014 19:09:51 +0000 (20:09 +0100)
With some positions like

8/8/8/2p2K2/1pp5/br1p1b2/2p2r2/qqkqq3 w - -

The eval score is higher than VALUE_INFINITE because
is the sum of VALUE_KNOWN_WIN plus a big material
advantage. This leads to an assert. Here are the
steps to reproduce:

Compile SF with debug=yes then do

./stockfish
position fen 8/8/8/2p2K2/1pp5/br1p1b2/2p2r2/qqkqq3 w - -
go depth 1

This patch fixes the issue in this case, but do exsist
other positions for which the patch is not enough and
we will need to limit the eval score to be sure not
overflow the limit.

Note that is not possible to increase the value of
VALUE_INFINITE because should remain within int16_t
type to be stored in a TT entry.

bench: 7356053

src/types.h

index 6d558de9b7e9bd657992fa8ed5ec8977ec79bc55..cae315a150180a542569c57b7c3352ad54f1284b 100644 (file)
@@ -155,7 +155,7 @@ enum Bound {
 enum Value {
   VALUE_ZERO      = 0,
   VALUE_DRAW      = 0,
 enum Value {
   VALUE_ZERO      = 0,
   VALUE_DRAW      = 0,
-  VALUE_KNOWN_WIN = 15000,
+  VALUE_KNOWN_WIN = 10000,
   VALUE_MATE      = 30000,
   VALUE_INFINITE  = 30001,
   VALUE_NONE      = 30002,
   VALUE_MATE      = 30000,
   VALUE_INFINITE  = 30001,
   VALUE_NONE      = 30002,