Skip to content

Commit

Permalink
improve cntcv
Browse files Browse the repository at this point in the history
bench 1238978
  • Loading branch information
xu-shawn committed Oct 22, 2024
1 parent 9766db8 commit 2d46d32
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,9 @@ Value to_corrected_static_eval(Value v, const Worker& w, const Position& pos, St
const auto micv = w.minorPieceCorrectionHistory[us][minor_piece_index(pos)];
const auto wnpcv = w.nonPawnCorrectionHistory[WHITE][us][non_pawn_index<WHITE>(pos)];
const auto bnpcv = w.nonPawnCorrectionHistory[BLACK][us][non_pawn_index<BLACK>(pos)];
int cntcv = 1;

if (m.is_ok())
cntcv = int((*(ss - 2)->continuationCorrectionHistory)[pos.piece_on(m.to_sq())][m.to_sq()]);
const auto cntcv =
m.is_ok() ? (*(ss - 2)->continuationCorrectionHistory)[pos.piece_on(m.to_sq())][m.to_sq()]
: 0;

const auto cv =
(5932 * pcv + 2994 * mcv + 3269 * macv + 5660 * micv + 6237 * (wnpcv + bnpcv) + cntcv * 5555)
Expand Down Expand Up @@ -540,7 +539,7 @@ Value Search::Worker::search(

// Dive into quiescence search when the depth reaches zero
if (depth <= 0)
return qsearch < PvNode ? PV : NonPV > (pos, ss, alpha, beta);
return qsearch<PvNode ? PV : NonPV>(pos, ss, alpha, beta);

// Limit the depth if extensions made it too large
depth = std::min(depth, MAX_PLY - 1);
Expand Down

0 comments on commit 2d46d32

Please sign in to comment.