Skip to content

Commit 3f5afc7

Browse files
authored
Simplify RFP and NMP if guards (#906)
STC Elo | -0.13 +- 1.02 (95%) SPRT | 4.0+0.04s Threads=1 Hash=16MB LLR | 2.94 (-2.25, 2.89) [-2.75, 0.00] Games | N: 116302 W: 29835 L: 29880 D: 56587 Penta | [509, 13020, 31175, 12901, 546] https://recklesschess.space/test/13533/ No functional change. Bench: 3083392
1 parent 6631de7 commit 3f5afc7

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

src/search.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -523,12 +523,14 @@ fn search<NODE: NodeType>(
523523
if !tt_pv
524524
&& !in_check
525525
&& !excluded
526-
&& estimated_score >= beta
527526
&& estimated_score
528-
>= beta + 1165 * depth * depth / 128 + 25 * depth - (80 * improving as i32)
529-
+ 560 * correction_value.abs() / 1024
530-
- 59 * (td.board.all_threats() & td.board.colors(stm)).is_empty() as i32
531-
+ 30
527+
>= beta
528+
+ (1165 * depth * depth / 128 - (80 * improving as i32)
529+
+ 25 * depth
530+
+ 560 * correction_value.abs() / 1024
531+
- 59 * (td.board.all_threats() & td.board.colors(stm)).is_empty() as i32
532+
+ 30)
533+
.max(0)
532534
&& !is_loss(beta)
533535
&& !is_win(estimated_score)
534536
{
@@ -540,10 +542,13 @@ fn search<NODE: NodeType>(
540542
&& !in_check
541543
&& !excluded
542544
&& !potential_singularity
543-
&& estimated_score >= beta
544545
&& estimated_score
545-
>= beta - 8 * depth + 116 * tt_pv as i32 - 106 * improvement / 1024 + 304
546-
- 20 * (td.stack[ply + 1].cutoff_count < 2) as i32
546+
>= beta
547+
+ (-8 * depth + 116 * tt_pv as i32
548+
- 106 * improvement / 1024
549+
- 20 * (td.stack[ply + 1].cutoff_count < 2) as i32
550+
+ 304)
551+
.max(0)
547552
&& ply as i32 >= td.nmp_min_ply
548553
&& td.board.material() > 600
549554
&& !is_loss(beta)

0 commit comments

Comments
 (0)