From 02a87211a862e76a5fa7611fe1d1dcdc270a9d47 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Thu, 31 Aug 2023 14:03:07 +0300 Subject: perf: only generate moves needed for current stage --- src/grossmeister/search.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/grossmeister/search.rs') 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; -- cgit v1.2.3