From 57797822f81386fc277de73599a05ad06a7dc7b6 Mon Sep 17 00:00:00 2001 From: Gary Linscott Date: Sat, 26 Jan 2013 15:35:00 -0500 Subject: [PATCH 1/9] Bring back just bishop pins --- src/evaluate.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 984a85a6..e29b9b0f 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -577,6 +577,12 @@ Value do_evaluate(const Position& pos, Value& margin) { mobility += MobilityBonus[Piece][mob]; + if (Piece == BISHOP && (PseudoAttacks[Piece][pos.king_square(Them)] & s)) { + const Bitboard between = BetweenBB[s][pos.king_square(Them)] & pos.pieces(); + if (!more_than_one(between)) + score += make_score(25, 25); + } + // Decrease score if we are attacked by an enemy pawn. Remaining part // of threat evaluation must be done later when we have full attack info. if (ei.attackedBy[Them][PAWN] & s) From a72710c66038f3c5abc8ba84d6a36c49c55d1b6c Mon Sep 17 00:00:00 2001 From: Gary Linscott Date: Sat, 2 Feb 2013 10:19:59 -0500 Subject: [PATCH 2/9] Simplify eval take 2. Bench 5097444 --- src/evaluate.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 49dc07fe..984a85a6 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -577,18 +577,6 @@ Value do_evaluate(const Position& pos, Value& margin) { mobility += MobilityBonus[Piece][mob]; - // Add a bonus if a slider is pinning an enemy piece - if ( (Piece == BISHOP || Piece == ROOK || Piece == QUEEN) - && (PseudoAttacks[Piece][pos.king_square(Them)] & s)) - { - b = BetweenBB[s][pos.king_square(Them)] & pos.pieces(); - - assert(b); - - if (!more_than_one(b) && (b & pos.pieces(Them))) - score += ThreatBonus[Piece][type_of(pos.piece_on(lsb(b)))]; - } - // Decrease score if we are attacked by an enemy pawn. Remaining part // of threat evaluation must be done later when we have full attack info. if (ei.attackedBy[Them][PAWN] & s) @@ -699,8 +687,7 @@ Value do_evaluate(const Position& pos, Value& margin) { & ~ei.attackedBy[Them][0]; if (undefendedMinors) - score += more_than_one(undefendedMinors) ? UndefendedMinorPenalty * 2 - : UndefendedMinorPenalty; + score += UndefendedMinorPenalty; // Enemy pieces not defended by a pawn and under our attack weakEnemies = pos.pieces(Them) From 17b71fe51da9d0803c7cfe9fa5df981c4a8fcb8f Mon Sep 17 00:00:00 2001 From: Gary Linscott Date: Tue, 12 Feb 2013 00:10:21 -0500 Subject: [PATCH 3/9] Add clop parameters --- src/evaluate.cpp | 9 ++++++--- src/ucioption.cpp | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 183f166a..ed1d5cb8 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -150,6 +150,8 @@ namespace { #undef S + Score BishopPinBonus = make_score(15, 25); + // Bonus for having the side to move (modified by Joona Kiiski) const Score Tempo = make_score(24, 11); @@ -306,6 +308,8 @@ namespace Eval { KingDangerTable[0][i] = apply_weight(make_score(t, 0), make_score(KingDanger[0], 0)); KingDangerTable[1][i] = apply_weight(make_score(t, 0), make_score(KingDanger[1], 0)); } + + BishopPinBonus = make_score(Options["pin_open"], Options["pin_end"]); } @@ -584,7 +588,7 @@ Value do_evaluate(const Position& pos, Value& margin) { else if (Piece == BISHOP && (PseudoAttacks[Piece][pos.king_square(Them)] & s)) { const Bitboard between = BetweenBB[s][pos.king_square(Them)] & pos.pieces(); if (!more_than_one(between)) - score += make_score(15, 25); + score += BishopPinBonus; } // Bishop and knight outposts squares @@ -692,8 +696,7 @@ Value do_evaluate(const Position& pos, Value& margin) { & ~ei.attackedBy[Them][0]; if (undefendedMinors) - score += more_than_one(undefendedMinors) ? UndefendedMinorPenalty * 2 - : UndefendedMinorPenalty; + score += UndefendedMinorPenalty; // Enemy pieces not defended by a pawn and under our attack weakEnemies = pos.pieces(Them) diff --git a/src/ucioption.cpp b/src/ucioption.cpp index e59a43a9..345b16dc 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -87,6 +87,8 @@ void init(OptionsMap& o) { o["Slow Mover"] = Option(100, 10, 1000); o["UCI_Chess960"] = Option(false); o["UCI_AnalyseMode"] = Option(false, on_eval); + o["pin_open"] = Option(15, -100, 100, on_eval); + o["pin_end"] = Option(25, -100, 100, on_eval); } From f32f899467ab01624e6c81bcef4bc152b18917bb Mon Sep 17 00:00:00 2001 From: Gary Linscott Date: Wed, 13 Feb 2013 00:12:02 -0500 Subject: [PATCH 4/9] CLOP tuned --- src/evaluate.cpp | 2 +- src/ucioption.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index ed1d5cb8..56bcbc68 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -150,7 +150,7 @@ namespace { #undef S - Score BishopPinBonus = make_score(15, 25); + Score BishopPinBonus = make_score(66, 11); // Bonus for having the side to move (modified by Joona Kiiski) const Score Tempo = make_score(24, 11); diff --git a/src/ucioption.cpp b/src/ucioption.cpp index 345b16dc..bc4a6481 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -87,8 +87,8 @@ void init(OptionsMap& o) { o["Slow Mover"] = Option(100, 10, 1000); o["UCI_Chess960"] = Option(false); o["UCI_AnalyseMode"] = Option(false, on_eval); - o["pin_open"] = Option(15, -100, 100, on_eval); - o["pin_end"] = Option(25, -100, 100, on_eval); + o["pin_open"] = Option(66, -100, 100, on_eval); + o["pin_end"] = Option(11, -100, 100, on_eval); } From d0c2faa5fd9ad05f865d2a69b59efab43b2be421 Mon Sep 17 00:00:00 2001 From: Gary Linscott Date: Wed, 13 Feb 2013 12:21:16 -0500 Subject: [PATCH 5/9] Use CLOP mean value instead of max --- src/evaluate.cpp | 2 +- src/ucioption.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 56bcbc68..4642b34f 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -150,7 +150,7 @@ namespace { #undef S - Score BishopPinBonus = make_score(66, 11); + Score BishopPinBonus = make_score(27, 12); // Bonus for having the side to move (modified by Joona Kiiski) const Score Tempo = make_score(24, 11); diff --git a/src/ucioption.cpp b/src/ucioption.cpp index bc4a6481..8622b52d 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -87,8 +87,8 @@ void init(OptionsMap& o) { o["Slow Mover"] = Option(100, 10, 1000); o["UCI_Chess960"] = Option(false); o["UCI_AnalyseMode"] = Option(false, on_eval); - o["pin_open"] = Option(66, -100, 100, on_eval); - o["pin_end"] = Option(11, -100, 100, on_eval); + o["pin_open"] = Option(27, -100, 100, on_eval); + o["pin_end"] = Option(12, -100, 100, on_eval); } From cd0ecace1952f5366c836f79846d55624104a956 Mon Sep 17 00:00:00 2001 From: Gary Linscott Date: Wed, 13 Feb 2013 21:40:38 -0500 Subject: [PATCH 6/9] Revert "Use CLOP mean value instead of max" This reverts commit d0c2faa5fd9ad05f865d2a69b59efab43b2be421. --- src/evaluate.cpp | 2 +- src/ucioption.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 4642b34f..56bcbc68 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -150,7 +150,7 @@ namespace { #undef S - Score BishopPinBonus = make_score(27, 12); + Score BishopPinBonus = make_score(66, 11); // Bonus for having the side to move (modified by Joona Kiiski) const Score Tempo = make_score(24, 11); diff --git a/src/ucioption.cpp b/src/ucioption.cpp index 8622b52d..bc4a6481 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -87,8 +87,8 @@ void init(OptionsMap& o) { o["Slow Mover"] = Option(100, 10, 1000); o["UCI_Chess960"] = Option(false); o["UCI_AnalyseMode"] = Option(false, on_eval); - o["pin_open"] = Option(27, -100, 100, on_eval); - o["pin_end"] = Option(12, -100, 100, on_eval); + o["pin_open"] = Option(66, -100, 100, on_eval); + o["pin_end"] = Option(11, -100, 100, on_eval); } From 3922ac2fe48806b75580892d48b9ddc545531402 Mon Sep 17 00:00:00 2001 From: Gary Linscott Date: Thu, 14 Feb 2013 20:29:24 -0500 Subject: [PATCH 7/9] Add new clop tuned value --- src/evaluate.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 56bcbc68..c8124eee 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -150,6 +150,7 @@ namespace { #undef S + // CLOP now likes 85, 31 - try next Score BishopPinBonus = make_score(66, 11); // Bonus for having the side to move (modified by Joona Kiiski) From d570260a28c6229ca75078dc616011e994fe6378 Mon Sep 17 00:00:00 2001 From: Gary Linscott Date: Sat, 16 Feb 2013 22:36:58 -0500 Subject: [PATCH 8/9] Back to CLOP average values --- src/evaluate.cpp | 4 +--- src/ucioption.cpp | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index c8124eee..2cb9979d 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -151,7 +151,7 @@ namespace { #undef S // CLOP now likes 85, 31 - try next - Score BishopPinBonus = make_score(66, 11); + const Score BishopPinBonus = make_score(34, 17); // Bonus for having the side to move (modified by Joona Kiiski) const Score Tempo = make_score(24, 11); @@ -309,8 +309,6 @@ namespace Eval { KingDangerTable[0][i] = apply_weight(make_score(t, 0), make_score(KingDanger[0], 0)); KingDangerTable[1][i] = apply_weight(make_score(t, 0), make_score(KingDanger[1], 0)); } - - BishopPinBonus = make_score(Options["pin_open"], Options["pin_end"]); } diff --git a/src/ucioption.cpp b/src/ucioption.cpp index bc4a6481..e59a43a9 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -87,8 +87,6 @@ void init(OptionsMap& o) { o["Slow Mover"] = Option(100, 10, 1000); o["UCI_Chess960"] = Option(false); o["UCI_AnalyseMode"] = Option(false, on_eval); - o["pin_open"] = Option(66, -100, 100, on_eval); - o["pin_end"] = Option(11, -100, 100, on_eval); } From dc8c6ea2d149cfe9ce17fc9652b9ff90585c7fd8 Mon Sep 17 00:00:00 2001 From: Gary Linscott Date: Tue, 19 Feb 2013 10:31:50 -0500 Subject: [PATCH 9/9] Bring back original bonus --- src/evaluate.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 2cb9979d..e17a3e34 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -150,8 +150,7 @@ namespace { #undef S - // CLOP now likes 85, 31 - try next - const Score BishopPinBonus = make_score(34, 17); + const Score BishopPinBonus = make_score(66, 11); // Bonus for having the side to move (modified by Joona Kiiski) const Score Tempo = make_score(24, 11);