1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 08:43:09 +00:00

Allow SearchStack to link an EvalInfo object

This will allow to have wider access to attack
information, for instance from MovePicker.

Note that 'eval' field become obsolete, it is kept
just becasue when we get a position score from TT
we update 'eval' even without an EvalInfo object.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2010-01-18 10:01:49 +01:00
parent 419c5b69ca
commit b833c8247a
2 changed files with 7 additions and 3 deletions

View file

@ -653,6 +653,7 @@ void SearchStack::init(int ply) {
currentMove = threatMove = MOVE_NONE; currentMove = threatMove = MOVE_NONE;
reduction = Depth(0); reduction = Depth(0);
eval = VALUE_NONE; eval = VALUE_NONE;
evalInfo = NULL;
} }
void SearchStack::initKillers() { void SearchStack::initKillers() {
@ -1375,14 +1376,15 @@ namespace {
const int FutilityValueMargin = 112 * bitScanReverse32(int(depth) * int(depth) / 2); const int FutilityValueMargin = 112 * bitScanReverse32(int(depth) * int(depth) / 2);
// Evaluate the position statically // Evaluate the position statically
if (isCheck) if (!isCheck)
ss[ply].eval = VALUE_NONE;
else
{ {
if (tte && (tte->type() & VALUE_TYPE_EVAL)) if (tte && (tte->type() & VALUE_TYPE_EVAL))
staticValue = value_from_tt(tte->value(), ply); staticValue = value_from_tt(tte->value(), ply);
else else
{
staticValue = evaluate(pos, ei, threadID); staticValue = evaluate(pos, ei, threadID);
ss[ply].evalInfo = &ei;
}
ss[ply].eval = staticValue; ss[ply].eval = staticValue;
futilityValue = staticValue + FutilityValueMargin; futilityValue = staticValue + FutilityValueMargin;

View file

@ -47,6 +47,7 @@ const int KILLER_MAX = 2;
/// from nodes shallower and deeper in the tree during the search. Each /// from nodes shallower and deeper in the tree during the search. Each
/// search thread has its own array of SearchStack objects, indexed by the /// search thread has its own array of SearchStack objects, indexed by the
/// current ply. /// current ply.
struct EvalInfo;
struct SearchStack { struct SearchStack {
Move pv[PLY_MAX_PLUS_2]; Move pv[PLY_MAX_PLUS_2];
@ -56,6 +57,7 @@ struct SearchStack {
Move killers[KILLER_MAX]; Move killers[KILLER_MAX];
Depth reduction; Depth reduction;
Value eval; Value eval;
EvalInfo* evalInfo;
void init(int ply); void init(int ply);
void initKillers(); void initKillers();