Skip to content

Commit

Permalink
Store more correct bounds in TT
Browse files Browse the repository at this point in the history
  • Loading branch information
bsamseth committed Aug 21, 2024
1 parent 3d59728 commit 46d7812
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions engine/src/search/negamax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ impl Searcher<'_> {
self.return_evaluation_if_at_forced_leaf(board, ply)?;
self.return_if_draw(board, ply)?;

let alpha_orig = alpha; // Save original alpha for later determinaiton of search bound type.
cuts::mate_distance_pruning(&mut alpha, &mut beta, ply)?;
let tt_move = self.get_bounds_and_move_from_tt(&mut alpha, &mut beta, ply, depth)?;
self.check_tablebase(board, &mut alpha, &mut beta, ply, depth)?;
Expand Down Expand Up @@ -99,12 +98,12 @@ impl Searcher<'_> {
Value::DRAW
};
Bound::Exact
} else if best_value <= alpha_orig {
Bound::Upper
} else if best_value >= beta {
Bound::Lower
} else {
} else if PV && best_move.is_some() {
Bound::Exact
} else {
Bound::Upper
};

self.stack_state_mut(ply).update_killer(best_move);
Expand Down

0 comments on commit 46d7812

Please sign in to comment.