@@ -168,7 +168,7 @@ namespace {
168168 template <Color Us> Score passed () const ;
169169 template <Color Us> Score space () const ;
170170 ScaleFactor scale_factor (Value eg) const ;
171- Score initiative (Score score, Score materialScore ) const ;
171+ Score initiative (Score score) const ;
172172
173173 const Position& pos;
174174 Material::Entry* me;
@@ -696,7 +696,7 @@ namespace {
696696 // known attacking/defending status of the players.
697697
698698 template <Tracing T>
699- Score Evaluation<T>::initiative(Score score, Score materialScore ) const {
699+ Score Evaluation<T>::initiative(Score score) const {
700700
701701 int outflanking = distance<File>(pos.square <KING>(WHITE), pos.square <KING>(BLACK))
702702 - distance<Rank>(pos.square <KING>(WHITE), pos.square <KING>(BLACK));
@@ -722,7 +722,7 @@ namespace {
722722 - 100 ;
723723
724724 // Give more importance to non-material score
725- score = ( score * 2 - materialScore ) / 2 ;
725+ score = score - pos. psq_score ( ) / 2 ;
726726 Value mg = mg_value (score);
727727 Value eg = eg_value (score);
728728
@@ -794,9 +794,6 @@ namespace {
794794 if (abs (v) > LazyThreshold + pos.non_pawn_material () / 64 )
795795 return pos.side_to_move () == WHITE ? v : -v;
796796
797- // Remember this score
798- Score materialScore = score;
799-
800797 // Main evaluation begins here
801798
802799 initialize<WHITE>();
@@ -815,7 +812,7 @@ namespace {
815812 + passed< WHITE>() - passed< BLACK>()
816813 + space< WHITE>() - space< BLACK>();
817814
818- score += initiative (score, materialScore );
815+ score += initiative (score);
819816
820817 // Interpolate between a middlegame and a (scaled by 'sf') endgame score
821818 ScaleFactor sf = scale_factor (eg_value (score));
0 commit comments