aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2024-01-19 00:08:58 +0100
committereug-vs <eugene@eug-vs.xyz>2024-01-19 00:11:56 +0100
commitd03c8f026d660d8e1f828f8e4e6ad48df61f1566 (patch)
tree52a3a2781d866c0100bd4aad48d3bec438cb2f36 /src
parent0553aebec3bb56f17087573322f078179f090d95 (diff)
downloadchessnost-d03c8f026d660d8e1f828f8e4e6ad48df61f1566.tar.gz
feat!: remove transposition table from quiescence
Diffstat (limited to 'src')
-rw-r--r--src/grossmeister/search.rs42
1 files changed, 0 insertions, 42 deletions
diff --git a/src/grossmeister/search.rs b/src/grossmeister/search.rs
index a5696d6..eafb8a7 100644
--- a/src/grossmeister/search.rs
+++ b/src/grossmeister/search.rs
@@ -171,38 +171,9 @@ impl Grossmeister {
return 0.0
}
- if let Some(transposition) = self.transposition() {
- match transposition.node_type {
- NodeType::PV => {
- return transposition.score.clamp(alpha, beta);
- }
- NodeType::Cut => {
- if transposition.score >= beta {
- return beta;
- }
- alpha = transposition.score.clamp(alpha, beta);
- }
- NodeType::All => {
- if transposition.score <= alpha {
- return alpha;
- }
- beta = transposition.score.clamp(alpha, beta);
- }
- }
- }
-
- let mut transposition = TranspositionTableItem {
- hash: self.board.hash,
- depth: 0,
- mov: None,
- score: alpha,
- node_type: NodeType::All,
- };
-
// Mate distance pruning
let mating_score = Grossmeister::MDP(&mut alpha, &mut beta, root_distance);
if mating_score != 0.0 {
- transposition.score = mating_score;
return mating_score
}
@@ -237,22 +208,10 @@ impl Grossmeister {
self.board.unmake_move(mov, captured_piece, ep_target_before, castling_rights_before, hash_before);
if evaluation >= beta {
- transposition.mov = Some(mov);
- transposition.score = beta;
- transposition.node_type = NodeType::Cut;
- self.store_transposition(transposition);
-
return beta; // Fail-hard beta-cutoff
}
if evaluation > alpha {
- transposition.mov = Some(mov);
- transposition.score = evaluation;
- transposition.node_type = NodeType::Cut;
alpha = evaluation;
- } else if transposition.node_type == NodeType::All {
- transposition.mov = None;
- transposition.score = alpha;
- transposition.node_type = NodeType::All;
}
} else {
self.board.unmake_move(mov, captured_piece, ep_target_before, castling_rights_before, hash_before);
@@ -263,7 +222,6 @@ impl Grossmeister {
return -SCORE_MATE + root_distance as Score
}
- self.store_transposition(transposition);
alpha
}