In order to compensate for the lack for check counts
in the input features of the NNUE evaluation,
add an additional evaluation term on top of it.
3check STC
Score of patch vs master: 114 - 73 - 13 [0.603] 200
Elo difference: 72.2 +/- 47.8, LOS: 99.9 %, DrawRatio: 6.5 %
3check LTC
Score of patch vs master: 105 - 79 - 16 [0.565] 200
Elo difference: 45.4 +/- 46.8, LOS: 97.2 %, DrawRatio: 8.0 %
// Scale and shift NNUE for compatibility with search and classical evaluation
auto adjusted_NNUE = [&](){
int mat = pos.non_pawn_material() + PawnValueMg * pos.count<PAWN>();
- return NNUE::evaluate(pos) * (679 + mat / 32) / 1024 + Tempo;
+ int v2 = VALUE_ZERO;
+ if (pos.check_counting())
+ {
+ Color us = pos.side_to_move();
+ v2 = mat / (30 * pos.checks_remaining( us))
+ - mat / (30 * pos.checks_remaining(~us));
+ }
+ return NNUE::evaluate(pos) * (679 + mat / 32) / 1024 + Tempo + v2;
};
// If there is PSQ imbalance use classical eval, with small probability if it is small