From 7f9032a324ba476fde65db51c686cb25d3f0ba00 Mon Sep 17 00:00:00 2001 From: doruk Date: Thu, 4 Aug 2022 18:04:06 +0300 Subject: [PATCH 1/2] 4.7k games --- src/bm/bm_runner/ab_runner.rs | 4 ++-- src/bm/bm_search/search.rs | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/bm/bm_runner/ab_runner.rs b/src/bm/bm_runner/ab_runner.rs index 17edcdde..cf138641 100644 --- a/src/bm/bm_runner/ab_runner.rs +++ b/src/bm/bm_runner/ab_runner.rs @@ -390,11 +390,11 @@ impl AbRunner { if depth == 0 || mv == 0 { 0 } else { - (2.01 + (depth as f32).ln() * (mv as f32).ln() / 1.79) as u32 + (2.02 + (depth as f32).ln() * (mv as f32).ln() / 1.79) as u32 } })), lmp_lookup: Arc::new(LookUp2d::new(|depth, improving| { - let mut x = 2.94 + depth as f32 * depth as f32; + let mut x = 2.98 + depth as f32 * depth as f32; if improving == 0 { x /= 2.07; } diff --git a/src/bm/bm_search/search.rs b/src/bm/bm_search/search.rs index 673911c3..8954f28c 100644 --- a/src/bm/bm_search/search.rs +++ b/src/bm/bm_search/search.rs @@ -41,12 +41,12 @@ impl SearchType for NoNm { type Zw = NoNm; } -const RFP: i16 = 55; -const RFP_IMPR: i16 = 48; -const RFP_DEPTH: u32 = 8; -const FP: i16 = 63; +const RFP: i16 = 54; +const RFP_IMPR: i16 = 50; +const RFP_DEPTH: u32 = 9; +const FP: i16 = 65; const FP_DEPTH: u32 = 6; -const SEE_FP: i16 = 89; +const SEE_FP: i16 = 85; const SEE_FP_DEPTH: u32 = 8; const D_EXT: i16 = 18; const HP: i32 = 70; @@ -118,7 +118,7 @@ fn do_nmp( #[inline] fn nmp_depth(depth: u32, eval: i16, beta: i16) -> u32 { assert!(eval >= beta); - let r = 4 + depth / 3 + ((eval - beta) / 206) as u32; + let r = 3 + depth / 3 + ((eval - beta) / 205) as u32; depth.saturating_sub(r).max(1) } @@ -148,12 +148,12 @@ const fn hp(depth: u32) -> i32 { #[inline] const fn history_lmr(history: i16) -> i16 { - history / 82 + history / 87 } #[inline] const fn q_see_threshold() -> i16 { - 200 + 198 } pub fn search( @@ -852,11 +852,11 @@ pub fn see(board: &Board, make_move: Move) -> i16 { fn piece_pts(piece: Piece) -> i16 { match piece { - Piece::Pawn => 98, - Piece::Knight => 323, - Piece::Bishop => 323, - Piece::Rook => 559, - Piece::Queen => 863, + Piece::Pawn => 95, + Piece::Knight => 320, + Piece::Bishop => 320, + Piece::Rook => 561, + Piece::Queen => 860, Piece::King => 20000, } } From cab65f3ed7f90fdeb1a5ae720fcd11d6dc2fd03c Mon Sep 17 00:00:00 2001 From: doruk Date: Thu, 4 Aug 2022 21:10:20 +0300 Subject: [PATCH 2/2] 7k iterations --- src/bm/bm_runner/ab_runner.rs | 6 ++--- src/bm/bm_search/search.rs | 41 +++++++++++++++-------------------- 2 files changed, 21 insertions(+), 26 deletions(-) diff --git a/src/bm/bm_runner/ab_runner.rs b/src/bm/bm_runner/ab_runner.rs index cf138641..bd740c09 100644 --- a/src/bm/bm_runner/ab_runner.rs +++ b/src/bm/bm_runner/ab_runner.rs @@ -390,13 +390,13 @@ impl AbRunner { if depth == 0 || mv == 0 { 0 } else { - (2.02 + (depth as f32).ln() * (mv as f32).ln() / 1.79) as u32 + (2.03 + (depth as f32).ln() * (mv as f32).ln() / 1.84) as u32 } })), lmp_lookup: Arc::new(LookUp2d::new(|depth, improving| { - let mut x = 2.98 + depth as f32 * depth as f32; + let mut x = 3.02 + depth as f32 * depth as f32; if improving == 0 { - x /= 2.07; + x /= 2.03; } x as usize })), diff --git a/src/bm/bm_search/search.rs b/src/bm/bm_search/search.rs index 8954f28c..671187fa 100644 --- a/src/bm/bm_search/search.rs +++ b/src/bm/bm_search/search.rs @@ -42,14 +42,14 @@ impl SearchType for NoNm { } const RFP: i16 = 54; -const RFP_IMPR: i16 = 50; -const RFP_DEPTH: u32 = 9; -const FP: i16 = 65; -const FP_DEPTH: u32 = 6; -const SEE_FP: i16 = 85; -const SEE_FP_DEPTH: u32 = 8; -const D_EXT: i16 = 18; -const HP: i32 = 70; +const RFP_IMPR: i16 = 49; +const RFP_DEPTH: u32 = 8; +const FP: i16 = 62; +const FP_DEPTH: u32 = 5; +const SEE_FP: i16 = 81; +const SEE_FP_DEPTH: u32 = 7; +const D_EXT: i16 = 19; +const HP: i32 = 71; const HP_DEPTH: u32 = 7; fn threats(board: &Board, threats_of: Color) -> BitBoard { @@ -118,7 +118,7 @@ fn do_nmp( #[inline] fn nmp_depth(depth: u32, eval: i16, beta: i16) -> u32 { assert!(eval >= beta); - let r = 3 + depth / 3 + ((eval - beta) / 205) as u32; + let r = 4 + depth / 3 + ((eval - beta) / 206) as u32; depth.saturating_sub(r).max(1) } @@ -148,12 +148,7 @@ const fn hp(depth: u32) -> i32 { #[inline] const fn history_lmr(history: i16) -> i16 { - history / 87 -} - -#[inline] -const fn q_see_threshold() -> i16 { - 198 + history / 92 } pub fn search( @@ -404,7 +399,7 @@ pub fn search( let s_beta = entry.score() - depth as i16 * 3; local_context.search_stack_mut()[ply as usize].skip_move = Some(make_move); - let multi_cut = depth >= 4; + let multi_cut = depth >= 5; let s_score = if multi_cut { search::( pos, @@ -753,10 +748,10 @@ pub fn q_search( SEE beta cutoff: (Koivisto) If SEE considerably improves evaluation above beta, we can return beta early */ - if stand_pat + see - q_see_threshold() >= beta { + if stand_pat + see - 193 >= beta { return beta; } - if stand_pat + see + q_see_threshold() <= alpha { + if stand_pat + see + 196 <= alpha { continue; } pos.make_move(make_move); @@ -852,11 +847,11 @@ pub fn see(board: &Board, make_move: Move) -> i16 { fn piece_pts(piece: Piece) -> i16 { match piece { - Piece::Pawn => 95, - Piece::Knight => 320, - Piece::Bishop => 320, - Piece::Rook => 561, - Piece::Queen => 860, + Piece::Pawn => 96, + Piece::Knight => 323, + Piece::Bishop => 323, + Piece::Rook => 551, + Piece::Queen => 864, Piece::King => 20000, } }