Skip to content

Commit 28115e3

Browse files
fix: bug with where we ignore draws (#169)
SPRT regression test Elo | 22.36 +- 10.16 (95%) SPRT | 8.0+0.08s Threads=1 Hash=16MB LLR | 2.96 (-2.94, 2.94) [-5.00, 0.00] Games | N: 1976 W: 585 L: 458 D: 933 Penta | [34, 202, 424, 259, 69] https://openbench.nocturn9x.space/test/4817/ 10k games self-play (no illegals or crash) Elo | 1.91 +- 4.60 (95%) Conf | 8.0+0.08s Threads=1 Hash=16MB Games | N: 10014 W: 3077 L: 3022 D: 3915 Penta | [301, 1044, 2270, 1083, 309] https://openbench.nocturn9x.space/test/4816/ bench: 1049220
1 parent 0220f74 commit 28115e3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

engine/src/search.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -425,11 +425,6 @@ impl<'a, Log: LogLevel> Search<'a, Log> {
425425
return score;
426426
}
427427

428-
// don't bother searching if the board is in a draw state
429-
if board.is_draw() {
430-
return Score::DRAW;
431-
}
432-
433428
// get all legal moves
434429
let mut move_list = MoveList::new();
435430
let mut order_list = ArrayVec::<MoveOrder, MAX_MOVE_LIST_SIZE>::new();
@@ -497,7 +492,11 @@ impl<'a, Log: LogLevel> Search<'a, Log> {
497492

498493
// make the move
499494
board.make_move_unchecked(&mv).unwrap();
500-
let score : Score =
495+
let mut score = Score::DRAW;
496+
497+
// Don't bother searching drawn positions
498+
if !board.is_draw() {
499+
score =
501500
// Principal Variation Search (PVS)
502501
if Node::PV && i == 0 {
503502
-self.negamax::<PvNode>(board, depth - 1, ply + 1, -beta, -alpha_use, &mut local_pv)
@@ -517,6 +516,7 @@ impl<'a, Log: LogLevel> Search<'a, Log> {
517516
temp_score
518517
}
519518
};
519+
}
520520

521521
// undo the move
522522
board.unmake_move().unwrap();

0 commit comments

Comments
 (0)