diff options
author | eug-vs <eugene@eug-vs.xyz> | 2023-09-04 21:11:38 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2023-09-04 21:11:38 +0300 |
commit | ef1d62f64e3a52c371c29fea8cca400fde86a457 (patch) | |
tree | 6a4776e2cd7dc98b3b0dd6c0f17ffeb9d1f57615 /src/grossmeister | |
parent | 9f3ff7888ed5f2dfa0a42fe3176a4d8a2276f121 (diff) | |
download | chessnost-ef1d62f64e3a52c371c29fea8cca400fde86a457.tar.gz |
feat: display info if PV reconstruction failed
Diffstat (limited to 'src/grossmeister')
-rw-r--r-- | src/grossmeister/search.rs | 18 |
1 files 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) } |