Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ltc spsa #143

Merged
merged 2 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -41,15 +41,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 @@ -148,12 +148,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 @@ -404,7 +399,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 @@ -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);
Expand Down Expand Up @@ -852,11 +847,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,
}
}