From ef1d62f64e3a52c371c29fea8cca400fde86a457 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Mon, 4 Sep 2023 21:11:38 +0300 Subject: feat: display info if PV reconstruction failed --- src/grossmeister/search.rs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/grossmeister/search.rs b/src/grossmeister/search.rs index 485e4d3..0ca5ef4 100644 --- a/src/grossmeister/search.rs +++ b/src/grossmeister/search.rs @@ -78,8 +78,6 @@ impl Grossmeister { // Mate distance pruning let mating_score = Grossmeister::MDP(&mut alpha, &mut beta, root_distance); if mating_score != 0.0 { - transposition.score = mating_score; - self.store_transposition(transposition); return mating_score } @@ -153,12 +151,8 @@ impl Grossmeister { if !legal_move_found { if self.board.is_king_in_check(color) { - transposition.score = -SCORE_MATE + root_distance as Score; - self.store_transposition(transposition); return -SCORE_MATE + root_distance as Score } else { - transposition.score = 0.0; - self.store_transposition(transposition); return 0.0 } } @@ -262,8 +256,6 @@ impl Grossmeister { } if !legal_move_found && self.board.is_king_in_check(color) { - transposition.score = -SCORE_MATE + root_distance as Score; - self.store_transposition(transposition); return -SCORE_MATE + root_distance as Score } @@ -366,11 +358,13 @@ impl Grossmeister { println!("info hashfull {}", 1000 * self.transposition_table.iter().filter(|item| item.is_some()).count() / self.transposition_table.len()); if !pv.is_empty() { print!("bestmove {}", pv[0]); + if pv.len() > 1 { + print!(" ponder {}", pv[1]) + } + println!(); + } else { + println!("info no PV found"); } - if pv.len() > 1 { - print!(" ponder {}", pv[1]) - } - println!(); (best_score, pv) } -- cgit v1.2.3