]> git.sesse.net Git - stockfish/commitdiff
Raise VALUE_INFINITE
authorMarco Costalba <mcostalba@gmail.com>
Sat, 29 Mar 2014 10:12:37 +0000 (11:12 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 29 Mar 2014 10:13:42 +0000 (11:13 +0100)
In some legal positions like this one:
R6R/3Q4/1Q4Q1/4Q3/2Q4Q/Q4Q2/Np1Q4/kB1N1KB1  b -- 0 1

We can have a very high score, in this case 30177 and 29267
for midgame and endgame respectively, and because
VALUE_INFINITE = 30001 we have an assert in interpolate()

Midgame and endgame scores are stored in 16 bit signed integers
so we can rise VALUE_INFINITE a little bit. This does not fix
the possibility of overflow in general case, just makes the
condition more difficult to trigger and anyhow better uses all
the score width.

Raising VALUE_INFINITE to 32000 seems to fix the problem for this
particular case.

No functional change.

src/types.h

index 5a80402d94c2d1838cc5d84ad9d169695e28618c..ea52fe6cb5216c5c85cc5a6910b86e0ef3662812 100644 (file)
@@ -165,9 +165,9 @@ enum Value {
   VALUE_ZERO      = 0,
   VALUE_DRAW      = 0,
   VALUE_KNOWN_WIN = 10000,
-  VALUE_MATE      = 30000,
-  VALUE_INFINITE  = 30001,
-  VALUE_NONE      = 30002,
+  VALUE_MATE      = 32000,
+  VALUE_INFINITE  = 32001,
+  VALUE_NONE      = 32002,
 
   VALUE_MATE_IN_MAX_PLY  =  VALUE_MATE - MAX_PLY,
   VALUE_MATED_IN_MAX_PLY = -VALUE_MATE + MAX_PLY,