X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=9756add8278d01fd5fece9ac98fe620a255ab2ce;hp=40c98a982d897af633ef4f8315f771f8d7229bbc;hb=3cf6471738dc704ddf553d5f8d2dc9875c2ccbe7;hpb=e304db9d1ecf6a2318708483c90fadecf4fac4ee diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 40c98a98..9756add8 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -36,8 +36,8 @@ namespace { struct EvalInfo { // Pointers to material and pawn hash table entries - MaterialEntry* mi; - PawnEntry* pi; + Material::Entry* mi; + Pawns::Entry* pi; // attackedBy[color][piece type] is a bitboard representing all squares // attacked by a given color and piece type, attackedBy[color][0] contains @@ -361,11 +361,12 @@ namespace { template Value do_evaluate(const Position& pos, Value& margin) { - assert(!pos.in_check()); + assert(!pos.checkers()); EvalInfo ei; Value margins[COLOR_NB]; Score score, mobilityWhite, mobilityBlack; + Thread* th = pos.this_thread(); // margins[] store the uncertainty estimation of position's evaluation // that typically is used by the search for pruning decisions. @@ -377,7 +378,7 @@ Value do_evaluate(const Position& pos, Value& margin) { score = pos.psq_score() + (pos.side_to_move() == WHITE ? Tempo : -Tempo); // Probe the material hash table - ei.mi = pos.this_thread()->materialTable.probe(pos); + ei.mi = Material::probe(pos, th->materialTable, th->endgames); score += ei.mi->material_value(); // If we have a specialized evaluation function for the current material @@ -389,7 +390,7 @@ Value do_evaluate(const Position& pos, Value& margin) { } // Probe the pawn hash table - ei.pi = pos.this_thread()->pawnTable.probe(pos); + ei.pi = Pawns::probe(pos, th->pawnsTable); score += ei.pi->pawns_value(); // Initialize attack and king safety bitboards @@ -998,7 +999,7 @@ Value do_evaluate(const Position& pos, Value& margin) { // Opponent king cannot block because path is defended and position // is not in check. So only friendly pieces can be blockers. - assert(!pos.in_check()); + assert(!pos.checkers()); assert((queeningPath & pos.pieces()) == (queeningPath & pos.pieces(c))); // Add moves needed to free the path from friendly pieces and retest condition