Skip to content

Commit

Permalink
tweecg.
Browse files Browse the repository at this point in the history
bench 4997591
  • Loading branch information
Vizvezdenec committed Aug 12, 2019
1 parent 007cb18 commit b2b7aca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
13 changes: 2 additions & 11 deletions src/evaluate.cpp
Expand Up @@ -491,7 +491,7 @@ namespace {
constexpr Direction Up = (Us == WHITE ? NORTH : SOUTH);
constexpr Bitboard TRank3BB = (Us == WHITE ? Rank3BB : Rank6BB);

Bitboard b, weak, defended, nonPawnEnemies, stronglyProtected, safe, weakSquare;
Bitboard b, weak, defended, nonPawnEnemies, stronglyProtected, safe;
Score score = SCORE_ZERO;

// Non-pawn enemies
Expand All @@ -506,9 +506,7 @@ namespace {
defended = nonPawnEnemies & stronglyProtected;

// Enemies not strongly protected and under our attack
weakSquare = ~stronglyProtected & attackedBy[Us][ALL_PIECES];
weak = pos.pieces(Them) & weakSquare;
weakSquare = shift<Up>(weakSquare) & pos.pieces(Them, PAWN);
weak = pos.pieces(Them) & ~stronglyProtected & attackedBy[Us][ALL_PIECES];

// Safe or protected squares
safe = ~attackedBy[Them][ALL_PIECES] | attackedBy[Us][ALL_PIECES];
Expand All @@ -534,13 +532,6 @@ namespace {
score += ThreatByRank * (int)relative_rank(Them, s);
}

b = weakSquare & (attackedBy[Us][KNIGHT] | attackedBy[Us][BISHOP] | attackedBy[Us][ROOK]);
while (b)
{
Square s = pop_lsb(&b);
score += ThreatByRank * (int)relative_rank(Them, s);
}

if (weak & attackedBy[Us][KING])
score += ThreatByKing;

Expand Down
4 changes: 2 additions & 2 deletions src/search.cpp
Expand Up @@ -64,7 +64,7 @@ namespace {
// Razor and futility margins
constexpr int RazorMargin = 661;
Value futility_margin(Depth d, bool improving) {
return Value((168 - 51 * improving) * d / ONE_PLY);
return Value((208 - 51 * improving) * d / ONE_PLY);
}

// Reductions lookup table, initialized at startup
Expand Down Expand Up @@ -788,7 +788,7 @@ namespace {

// Step 8. Futility pruning: child node (~30 Elo)
if ( !PvNode
&& depth < 7 * ONE_PLY
&& depth < 9 * ONE_PLY
&& eval - futility_margin(depth, improving) >= beta
&& eval < VALUE_KNOWN_WIN) // Do not return unproven wins
return eval;
Expand Down

0 comments on commit b2b7aca

Please sign in to comment.