Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions src/movepick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,7 @@ Move MovePicker::next() {
goto emit_bad_noisy;
}

m_stage = Stage::EmitKiller;

[[fallthrough]];

case Stage::EmitKiller:
m_stage = Stage::ScoreQuiet;
if (m_tt_move != m_killer && m_killer != Move::none() && m_movegen.is_legal(m_killer)) {
return m_killer;
}

[[fallthrough]];

Expand All @@ -81,7 +73,7 @@ Move MovePicker::next() {
case Stage::EmitQuiet:
while (m_current_index < m_quiet.size()) {
auto [curr, score] = pick_next(m_quiet);
if (curr != m_tt_move && curr != m_killer) {
if (curr != m_tt_move) {
return curr;
}
}
Expand All @@ -95,7 +87,7 @@ Move MovePicker::next() {
case Stage::EmitBadNoisy:
while (m_current_index < m_bad_noisy.size()) {
Move curr = m_bad_noisy[m_current_index++];
if (curr != m_tt_move && curr != m_killer) {
if (curr != m_tt_move) {
return curr;
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/movepick.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
m_history(history),
m_movegen(pos),
m_tt_move(tt_move),
m_killer(ss->killer),
m_ply(ply),
m_stack(ss) {
}
Expand All @@ -29,7 +28,6 @@
GenerateMoves,
ScoreNoisy,
EmitGoodNoisy,
EmitKiller,
ScoreQuiet,
EmitQuiet,
EmitBadNoisy,
Expand All @@ -53,7 +51,7 @@
std::pair<Move, i32> pick_next(MoveList& moves);
void score_moves(MoveList& moves);

i32 score_move(Move move) const;

Check warning on line 54 in src/movepick.hpp

View workflow job for this annotation

GitHub Actions / Linter / cpp-linter

src/movepick.hpp:54:5 [modernize-use-nodiscard]

function 'score_move' should be marked [[nodiscard]]

Stage m_stage = Stage::EmitTTMove;

Expand All @@ -68,7 +66,6 @@
std::array<i32, 256> m_scores;

Move m_tt_move;
Move m_killer;
i32 m_ply;
Search::Stack* m_stack;
};
Expand Down
4 changes: 0 additions & 4 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,6 @@ Value Worker::search(
i32 alpha_raises = 0;
Value non_pawn_material = -1;

// Clear child's killer move.
(ss + 1)->killer = Move::none();
// Clear child's fail high count
(ss + 1)->fail_high_count = 0;

Expand Down Expand Up @@ -748,8 +746,6 @@ Value Worker::search(
i32 bonus_depth = depth + (best_value >= beta + 100);
const i32 bonus = stat_bonus(bonus_depth);
if (quiet_move(best_move)) {
ss->killer = best_move;

m_td.history.update_quiet_stats(pos, best_move, ply, ss, bonus);
for (Move quiet : quiets_played) {
m_td.history.update_quiet_stats(pos, quiet, ply, ss, -bonus);
Expand Down
5 changes: 2 additions & 3 deletions src/search.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ struct PV {
};

struct Stack {
Value static_eval = 0;
Move killer = Move::none();
Move excluded_move;
Value static_eval = 0;
Move excluded_move = Move::none();
ContHistEntry* cont_hist_entry = nullptr;
i32 fail_high_count = 0;
PV pv;
Expand Down
Loading