Skip to content

Commit 1d3efff

Browse files
Rocky640vondele
authored andcommitted
Dynamic Complexity based on psqt
Adjust initiative score by psqt/2 instead of materialScore/2 which simplifies #2516 Passed STC http://tests.stockfishchess.org/tests/view/5e2e667dab2d69d58394fc73 LLR: 2.94 (-2.94,2.94) {-1.50,0.50} Total: 23198 W: 4506 L: 4353 D: 14339 Ptnml(0-2): 396, 2615, 5380, 2728, 418 Passed LTC http://tests.stockfishchess.org/tests/view/5e2ed75cab2d69d58394fcbf LLR: 2.94 (-2.94,2.94) {-1.50,0.50} Total: 8519 W: 1179 L: 1062 D: 6278 Ptnml(0-2): 50, 775, 2472, 843, 74 closes #2522 Bench: 4684459
1 parent 39437f4 commit 1d3efff

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/evaluate.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)