mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 18:17:02 +08:00
Small cleanups 13
No functional change
This commit is contained in:
@@ -1025,7 +1025,7 @@ Value Eval::evaluate(const Position& pos) {
|
||||
{
|
||||
// Scale and shift NNUE for compatibility with search and classical evaluation
|
||||
auto adjusted_NNUE = [&](){
|
||||
int mat = pos.non_pawn_material() + PieceValue[MG][PAWN] * pos.count<PAWN>();
|
||||
int mat = pos.non_pawn_material() + PawnValueMg * pos.count<PAWN>();
|
||||
return NNUE::evaluate(pos) * (720 + mat / 32) / 1024 + Tempo;
|
||||
};
|
||||
|
||||
@@ -1041,10 +1041,10 @@ Value Eval::evaluate(const Position& pos) {
|
||||
// For the case of opposite colored bishops, switch to NNUE eval with
|
||||
// small probability if the classical eval is less than the threshold.
|
||||
if ( largePsq
|
||||
&& (abs(v) * 16 < NNUEThreshold2 * r50
|
||||
|| ( pos.opposite_bishops()
|
||||
&& abs(v) * 16 < (NNUEThreshold1 + pos.non_pawn_material() / 64) * r50
|
||||
&& !(pos.this_thread()->nodes & 0xB))))
|
||||
&& ( abs(v) * 16 < NNUEThreshold2 * r50
|
||||
|| ( pos.opposite_bishops()
|
||||
&& abs(v) * 16 < (NNUEThreshold1 + pos.non_pawn_material() / 64) * r50
|
||||
&& !(pos.this_thread()->nodes & 0xB))))
|
||||
v = adjusted_NNUE();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user