Permalink
Browse files

Bench: 3540666

  • Loading branch information...
ElbertoOne committed Jan 9, 2019
1 parent 14caa98 commit d370c475bbec4fd915170d220a1de44e32915d48
Showing with 4 additions and 5 deletions.
  1. +4 −5 src/evaluate.cpp
@@ -171,7 +171,7 @@ namespace {
constexpr Score TrappedRook = S( 96, 4);
constexpr Score WeakQueen = S( 49, 15);
constexpr Score WeakUnopposedPawn = S( 12, 23);
constexpr Score HinderMinor = S( 20, 20);
constexpr Score HinderMinor = S( 10, 15);

#undef S

@@ -478,6 +478,9 @@ namespace {
// Transform the kingDanger units into a Score, and subtract it from the evaluation
if (kingDanger > 0)
score -= make_score(kingDanger * kingDanger / 4096, kingDanger / 16);
// Penalty if our king hinders the mobility of a minor.
else if ((attackedBy[Us][BISHOP] | attackedBy[Us][KNIGHT]) & ksq)
score -= HinderMinor;

// Penalty when our king is on a pawnless flank
if (!(pos.pieces(PAWN) & kingFlank))
@@ -486,10 +489,6 @@ namespace {
// King tropism bonus, to anticipate slow motion attacks on our king
score -= CloseEnemies * tropism;

// Penalty if our king hinders the mobility of a minor.
if ((attackedBy[Us][BISHOP] | attackedBy[Us][KNIGHT]) & ksq)
score -= HinderMinor;

if (T)
Trace::add(KING, Us, score);

19 comments on commit d370c47

@ElbertoOne

This comment has been minimized.

Copy link
Owner

ElbertoOne replied Jan 9, 2019

Inspiration for this idea: position 3r4/rp2qpk1/1Np1pb2/Pn4p1/3P2Pp/3RP2P/4QP2/3RB1K1 b - - 5 47
Best move Kh6, giving more mobility to the Bishop.

@protonspring

This comment has been minimized.

Copy link

protonspring replied Jan 9, 2019

Wouldn't this penalize a fianchetto bishop if king is behind the bishop? That doesn't seem good.

@ElbertoOne

This comment has been minimized.

Copy link
Owner

ElbertoOne replied Jan 9, 2019

@protonspring yes, in case the king is on the same diagonal as the bishop and kingDanger is 0. Maybe we should only give the penalty if the mobility of the piece is low (or make it dependent on the piece mobility). That could be tried in another test.

@protonspring

This comment has been minimized.

Copy link

protonspring replied Jan 9, 2019

@xoto10

This comment has been minimized.

Copy link

xoto10 replied Jan 11, 2019

You could increase the throughput of this test to 5000 or 10000 to get it to move faster, see discussion on fishcooking.

@miguel-l

This comment has been minimized.

Copy link

miguel-l replied Jan 12, 2019

Congrats!

@noobpwnftw

This comment has been minimized.

Copy link

noobpwnftw replied Jan 12, 2019

What a comeback! Congrats.

@crossbr

This comment has been minimized.

Copy link

crossbr replied Jan 12, 2019

Congrats!

@mstembera

This comment has been minimized.

Copy link

mstembera replied Jan 12, 2019

Congrats!

@DragonMist

This comment has been minimized.

Copy link

DragonMist replied Jan 12, 2019

Go SF!

@31m059

This comment has been minimized.

Copy link

31m059 replied Jan 12, 2019

Congratulations!

@Mindbreaker1

This comment has been minimized.

Copy link

Mindbreaker1 replied Jan 12, 2019

Congrats!

@VoyagerOne

This comment has been minimized.

Copy link

VoyagerOne replied Jan 12, 2019

Nicely done!

@Vizvezdenec

This comment has been minimized.

Copy link

Vizvezdenec replied Jan 12, 2019

Congrats!

@MichaelB7

This comment has been minimized.

Copy link

MichaelB7 replied Jan 12, 2019

Excellent!

@ElbertoOne

This comment has been minimized.

Copy link
Owner

ElbertoOne replied Jan 12, 2019

Thanks! I thought this would be a yellow patch, but luckily it turned green. Currently I don't have time and access to open a PR. I have time on Monday. If someone else would open a PR I'm fine with that.

A few notes:

  • the penalty values are pure guesswork they should be tuned.
  • I'm not sure if the penalty for the bishop is always correct. For instance: a bishop on g2 and a king on h1 gets the penalty. Ideally the penalty should be given if the mobility of the piece is low.
  • Maybe this also works for other pieces like rooks and queens.
@pb00068

This comment has been minimized.

Copy link

pb00068 replied Jan 12, 2019

Congratulations as well!

@31m059

This comment has been minimized.

Copy link

31m059 replied Jan 12, 2019

@ElbertoOne I have opened a PR on your behalf here: official-stockfish#1945 Congratulations once again!

Hopefully this Elo-gainer can be committed before the end of Divsion P of TCEC--about three days away--since Stockfish is very likely to participate in the Superfinal. @snicolet @mcostalba

@ddugovic

This comment has been minimized.

Copy link

ddugovic replied Jan 12, 2019

Congratulations although I'm deeply confused why this gains Elo.

Please sign in to comment.