mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 11:39:15 +00:00
Raise VALUE_INFINITE
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.
This commit is contained in:
parent
4833887842
commit
9350d0dce5
1 changed files with 3 additions and 3 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue