Skip to content

Commit c5af2ce

Browse files
Introduce PCM updates to TT early cutoffs (#615)
Elo | 2.28 +- 1.75 (95%) SPRT | 8.0+0.08s Threads=1 Hash=16MB LLR | 2.90 (-2.25, 2.89) [0.00, 3.00] Games | N: 38936 W: 9854 L: 9599 D: 19483 Penta | [80, 4541, 9964, 4810, 73] https://recklesschess.space/test/9576/ Bench: 3652331
1 parent 38c3a4a commit c5af2ce

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/search.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,27 @@ fn search<NODE: NodeType>(
327327
update_continuation_histories(td, ply, td.board.moved_piece(tt_move), tt_move.to(), conthist_bonus);
328328
}
329329

330+
if tt_score <= alpha && td.stack[ply - 1].move_count > 8 {
331+
let pcm_move = td.stack[ply - 1].mv;
332+
if pcm_move.is_quiet() {
333+
let mut factor = 90;
334+
factor += 158 * (initial_depth > 5) as i32;
335+
factor += 125 * (pcm_move == td.stack[ply - 1].tt_move) as i32;
336+
factor +=
337+
327 * (is_valid(td.stack[ply - 1].eval) && tt_score <= -td.stack[ply - 1].eval - 97) as i32;
338+
339+
let scaled_bonus = factor * (164 * initial_depth - 40).min(2143) / 128;
340+
341+
td.quiet_history.update(td.board.prior_threats(), !td.board.side_to_move(), pcm_move, scaled_bonus);
342+
343+
let entry = &td.stack[ply - 2];
344+
if entry.mv.is_some() {
345+
let bonus = (152 * initial_depth - 39).min(1486);
346+
td.continuation_history.update(entry.conthist, td.stack[ply - 1].piece, pcm_move.to(), bonus);
347+
}
348+
}
349+
}
350+
330351
if td.board.halfmove_clock() < 90 {
331352
return tt_score;
332353
}

0 commit comments

Comments
 (0)