Skip to content

Commit

Permalink
SEE pruning in qsearch
Browse files Browse the repository at this point in the history
Bench: 2525875
  • Loading branch information
SzilBalazs committed Jul 18, 2023
1 parent e898c8f commit 6b1dd10
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/search/move_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "../core/movegen.h"
#include "history.h"
#include "see.h"

namespace search {
template<bool captures_only>
Expand Down
2 changes: 2 additions & 0 deletions src/search/search_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ namespace search {
while (!move_list.empty()) {
core::Move move = move_list.next_move();

if (alpha > -WORST_MATE && !see(board, move, 0)) continue;

shared.node_count++;
board.make_move(move, &nnue);
Score score = -qsearch<node_type>(-beta, -alpha);
Expand Down
2 changes: 1 addition & 1 deletion src/search/see.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace search {
stm = color_enemy(stm);

if (value >= 0) {
if (type == KING && (attackers & board.pieces(stm))) {
if (type == KING && (attackers & board.sides(stm))) {
stm = color_enemy(stm);
}
break;
Expand Down

0 comments on commit 6b1dd10

Please sign in to comment.