aboutsummaryrefslogtreecommitdiff
path: root/src/grossmeister/search.rs
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2023-08-31 14:03:07 +0300
committereug-vs <eugene@eug-vs.xyz>2023-08-31 14:03:07 +0300
commit02a87211a862e76a5fa7611fe1d1dcdc270a9d47 (patch)
tree46307a89b94d55bbd649f2e23469f7b0f4726adf /src/grossmeister/search.rs
parent1891aed81193bd8913e806f58cfc802c13f9df1e (diff)
downloadchessnost-02a87211a862e76a5fa7611fe1d1dcdc270a9d47.tar.gz
perf: only generate moves needed for current stage
Diffstat (limited to 'src/grossmeister/search.rs')
-rw-r--r--src/grossmeister/search.rs13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/grossmeister/search.rs b/src/grossmeister/search.rs
index 68756d8..b7a4208 100644
--- a/src/grossmeister/search.rs
+++ b/src/grossmeister/search.rs
@@ -1,11 +1,8 @@
-use std::cmp::Ordering;
use std::f32::INFINITY;
-use smallvec::SmallVec;
+use crate::{moves::{Move, MoveKind}, board::io::IO};
-use crate::{moves::{Move, MoveKind}, board::{io::IO, move_generation::MoveList}};
-
-use super::{Grossmeister, ttable::{NodeType, TTABLE_SIZE, TranspositionTableItem}, move_selector::MoveSelector};
+use super::{Grossmeister, ttable::{NodeType, TTABLE_SIZE, TranspositionTableItem}};
const VALUE_WIN: f32 = 20_000.0;
@@ -166,15 +163,13 @@ impl Grossmeister {
alpha = stand_pat;
}
- tactical_only = true;
-
// If we are not in check, we can only search tactical moves
- // moves.retain(|m| m.is_tactical())
+ tactical_only = true;
}
let mut legal_move_found = false;
self.cleanup_selector();
- while let Some(mov) = if tactical_only { self.next_capture() } else { self.next_move() } {
+ while let Some(mov) = if tactical_only { self.next_tactical() } else { self.next_move() } {
let ep_target_before = self.board.ep_target;
let castling_rights_before = self.board.castling_rights;
let hash_before = self.board.hash;