Skip to content

File tree

7 files changed

+35
-22
lines changed

7 files changed

+35
-22
lines changed

src/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
### ==========================================================================
2626

2727
### Executable name
28-
### Honey bench nodes -----> 4276713 > based on commits up to 6/14/2019
29-
### stockfish bench nodes -> 3883245 > based on commits up to 6/14/2019
28+
### Honey bench nodes -----> 4976520 > based on commits up to 6/22/2019
29+
### stockfish bench nodes -> 3398333 > based on commits up to 6/22/2019
3030

3131
#### Always leave the three lines below as is (any subsequent defines will override)
3232
DATE=$(shell date +"%m%d%y")

src/evaluate.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -747,10 +747,8 @@ constexpr Score WeakQueen = S( 10, 2);// Gunther Dementz weak queen mo
747747
// If the pawn is free to advance, then increase the bonus
748748
if (pos.empty(blockSq))
749749
{
750-
// If there is a rook or queen attacking/defending the pawn from behind,
751-
// consider all the squaresToQueen. Otherwise consider only the squares
752-
// in the pawn's path attacked or occupied by the enemy.
753-
defendedSquares = unsafeSquares = squaresToQueen = forward_file_bb(Us, s);
750+
defendedSquares = squaresToQueen = forward_file_bb(Us, s);
751+
unsafeSquares = passed_pawn_span(Us, s);
754752

755753
bb = forward_file_bb(Them, s) & pos.pieces(ROOK, QUEEN);
756754

@@ -760,9 +758,13 @@ constexpr Score WeakQueen = S( 10, 2);// Gunther Dementz weak queen mo
760758
if (!(pos.pieces(Them) & bb))
761759
unsafeSquares &= attackedBy[Them][ALL_PIECES] | pos.pieces(Them);
762760

763-
// If there aren't any enemy attacks, assign a big bonus. Otherwise
764-
// assign a smaller bonus if the block square isn't attacked.
765-
int k = !unsafeSquares ? 20 : !(unsafeSquares & blockSq) ? 9 : 0;
761+
// If there are no enemy attacks on passed pawn span, assign a big bonus.
762+
// Otherwise assign a smaller bonus if the path to queen is not attacked
763+
// and even smaller bonus if it is attacked but block square is not.
764+
int k = !unsafeSquares ? 35 :
765+
!(unsafeSquares & squaresToQueen) ? 20 :
766+
!(unsafeSquares & blockSq) ? 9 :
767+
0 ;
766768

767769
// Assign a larger bonus if the block square is defended.
768770
if (defendedSquares & blockSq)

src/misc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ const string engine_info(bool to_uci) {
173173

174174

175175
/// Debug functions used mainly to collect run-time statistics
176-
static int64_t hits[2], means[2];
176+
static std::atomic<int64_t> hits[2], means[2];
177177

178178
void dbg_hit_on(bool b) { ++hits[0]; if (b) ++hits[1]; }
179179
void dbg_hit_on(bool c, bool b) { if (c) dbg_hit_on(b); }

src/movepick.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,15 @@ Move MovePicker::next_move(bool skipQuiets) {
200200
/* fallthrough */
201201

202202
case QUIET_INIT:
203-
cur = endBadCaptures;
204-
endMoves = generate<QUIETS>(pos, cur);
203+
if (!skipQuiets)
204+
{
205+
cur = endBadCaptures;
206+
endMoves = generate<QUIETS>(pos, cur);
205207

206-
score<QUIETS>();
207-
partial_insertion_sort(cur, endMoves, -4000 * depth / ONE_PLY);
208+
score<QUIETS>();
209+
partial_insertion_sort(cur, endMoves, -4000 * depth / ONE_PLY);
210+
}
211+
208212
++stage;
209213
/* fallthrough */
210214

src/search.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,10 +1492,11 @@ namespace {
14921492
// Multi-cut pruning
14931493
// Our ttMove is assumed to fail high, and now we failed high also on a reduced
14941494
// search without the ttMove. So we assume this expected Cut-node is not singular,
1495-
// that is multiple moves fail high, and we can prune the whole subtree by returning
1496-
// the hard beta bound.
1497-
else if (cutNode && singularBeta > beta)
1498-
return beta;
1495+
// that multiple moves fail high, and we can prune the whole subtree by returning
1496+
// a soft bound.
1497+
else if ( eval >= beta
1498+
&& singularBeta >= beta)
1499+
return singularBeta;
14991500
}
15001501

15011502
// Check extension (~2 Elo)
@@ -1525,7 +1526,7 @@ namespace {
15251526
else if ( PvNode
15261527
&& pos.rule50_count() > 18
15271528
&& depth < 3 * ONE_PLY
1528-
&& ss->ply < 3 * thisThread->rootDepth / ONE_PLY) // To avoid too deep searches
1529+
&& ++thisThread->shuffleExts < thisThread->nodes.load(std::memory_order_relaxed) / 4) // To avoid too many extensions
15291530
extension = ONE_PLY;
15301531
#endif
15311532
#ifdef Sullivan //see above for Passed pawn extension
@@ -2435,6 +2436,12 @@ void Tablebases::rank_root_moves(Position& pos, Search::RootMoves& rootMoves) {
24352436
if (dtz_available || rootMoves[0].tbScore <= VALUE_DRAW)
24362437
Cardinality = 0;
24372438
}
2439+
else
2440+
{
2441+
// Clean up if root_probe() and root_probe_wdl() have failed
2442+
for (auto& m : rootMoves)
2443+
m.tbRank = 0;
2444+
}
24382445
}
24392446
#ifdef Sullivan //from SugaR by Marco Zerbinati from Kelly
24402447
void kelly(bool start)

src/thread.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ void ThreadPool::start_thinking(Position& pos, StateListPtr& states,
191191

192192
for (Thread* th : *this)
193193
{
194-
th->nodes = th->tbHits = th->nmpMinPly = 0;
194+
th->shuffleExts = th->nodes = th->tbHits = th->nmpMinPly = 0;
195195
th->rootDepth = th->completedDepth = DEPTH_ZERO;
196196
th->rootMoves = rootMoves;
197197
th->rootPos.set(pos.fen(), pos.is_chess960(), &setupStates->back(), th);

src/thread.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ class Thread {
6464
Material::Table materialTable;
6565

6666
#ifdef Sullivan
67-
size_t pvIdx, multiPV, pvLast; // Improve multiPV mode by joergoster
67+
size_t pvIdx, multiPV, pvLast, shuffleExts; // Improve multiPV mode by joergoster
6868
int selDepth, nmpMinPly, zugzwangMates; // Gunther Demetz zugzwangSolver
6969
int64_t visits, allScores; // Moez Jellouli -> Save_probcut #e05dc73
7070
#else
71-
size_t pvIdx, pvLast;
71+
size_t pvIdx, pvLast, shuffleExts;
7272
int selDepth, nmpMinPly;
7373
#endif
7474

0 commit comments

Comments
 (0)