diff options
author | eug-vs <eugene@eug-vs.xyz> | 2023-09-04 13:40:23 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2023-09-04 13:40:23 +0300 |
commit | 6a91432045963b00bbb79938e918d100f171b3d4 (patch) | |
tree | 27c02240ba37d8d2c764cedc11df202cc6265b85 /src/grossmeister/search.rs | |
parent | 20dd36d4b39654c4d8d2f5d28817fa308eb4c624 (diff) | |
download | chessnost-6a91432045963b00bbb79938e918d100f171b3d4.tar.gz |
feat: do not return PV score out of current bounds
Diffstat (limited to 'src/grossmeister/search.rs')
-rw-r--r-- | src/grossmeister/search.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/grossmeister/search.rs b/src/grossmeister/search.rs index 09c8bc1..d5d6b30 100644 --- a/src/grossmeister/search.rs +++ b/src/grossmeister/search.rs @@ -2,7 +2,7 @@ use std::f32::INFINITY; use crate::{moves::{Move, MoveKind}, board::io::IO}; -use super::{Grossmeister, ttable::{NodeType, TTABLE_SIZE, TranspositionTableItem}, evaluation::Score}; +use super::{Grossmeister, ttable::{NodeType, TranspositionTableItem}, evaluation::Score}; const SCORE_MATE: Score = 20_000.0; @@ -50,10 +50,7 @@ impl Grossmeister { if let Some(transposition) = self.transposition() { if transposition.depth >= depth_left { match transposition.node_type { - NodeType::PV => { // PV-nodes have exact score - return transposition.score - } - NodeType::Cut => { + NodeType::PV | NodeType::Cut => { if transposition.score >= beta { return beta } @@ -65,9 +62,6 @@ impl Grossmeister { if transposition.score <= alpha { return alpha } - if transposition.score < beta { - beta = transposition.score - } } } } |