Skip to content

Commit

Permalink
Merge pull request #143 from dsekercioglu/ltc-spsa
Browse files Browse the repository at this point in the history
Ltc spsa
  • Loading branch information
jnlt3 authored Aug 4, 2022
2 parents 40d6096 + cab65f3 commit 4c9f1b8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
6 changes: 3 additions & 3 deletions src/bm/bm_runner/ab_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,13 +390,13 @@ impl AbRunner {
if depth == 0 || mv == 0 {
0
} else {
(2.01 + (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.94 + 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
})),
Expand Down
35 changes: 15 additions & 20 deletions src/bm/bm_search/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ impl SearchType for NoNm {
type Zw = NoNm;
}

const RFP: i16 = 55;
const RFP_IMPR: i16 = 48;
const RFP: i16 = 54;
const RFP_IMPR: i16 = 49;
const RFP_DEPTH: u32 = 8;
const FP: i16 = 63;
const FP_DEPTH: u32 = 6;
const SEE_FP: i16 = 89;
const SEE_FP_DEPTH: u32 = 8;
const D_EXT: i16 = 18;
const HP: i32 = 70;
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 {
Expand Down Expand Up @@ -147,12 +147,7 @@ const fn hp(depth: u32) -> i32 {

#[inline]
const fn history_lmr(history: i16) -> i16 {
history / 82
}

#[inline]
const fn q_see_threshold() -> i16 {
200
history / 92
}

pub fn search<Search: SearchType>(
Expand Down Expand Up @@ -403,7 +398,7 @@ pub fn search<Search: SearchType>(
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::<Search::Zw>(
pos,
Expand Down Expand Up @@ -752,10 +747,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);
Expand Down Expand Up @@ -851,11 +846,11 @@ pub fn see<const N: usize>(board: &Board, make_move: Move) -> i16 {

fn piece_pts(piece: Piece) -> i16 {
match piece {
Piece::Pawn => 98,
Piece::Pawn => 96,
Piece::Knight => 323,
Piece::Bishop => 323,
Piece::Rook => 559,
Piece::Queen => 863,
Piece::Rook => 551,
Piece::Queen => 864,
Piece::King => 20000,
}
}

0 comments on commit 4c9f1b8

Please sign in to comment.