Skip to content

Commit

Permalink
extend checks during quiescence
Browse files Browse the repository at this point in the history
  • Loading branch information
brunocodutra committed Jul 17, 2023
1 parent 34aba42 commit 6a0c391
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/search/pvs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,9 @@ impl Searcher {
},
};

let kind = if ply < depth {
MoveKind::ANY
} else if ply < Searcher::MAX_PLY {
MoveKind::CAPTURE | MoveKind::PROMOTION
} else {
if ply >= Searcher::MAX_PLY {
return Ok(score);
};
}

if !in_check {
if let Some(d) = self.nmp(pos, score, beta, depth) {
Expand All @@ -195,6 +191,12 @@ impl Searcher {
}
}

let kind = if ply < depth || in_check {
MoveKind::ANY
} else {
MoveKind::CAPTURE | MoveKind::PROMOTION
};

let mut moves = ArrayVec::<_, 256>::from_iter(pos.moves(kind).map(|m| {
let mut next = pos.clone();
next.play(*m).expect("expected legal move");
Expand Down

0 comments on commit 6a0c391

Please sign in to comment.