Skip to content
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/evaluation.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::{thread::ThreadData, types::Score};

pub fn correct_eval(td: &ThreadData, raw_eval: i32, correction_value: i32) -> i32 {
let mut eval = (raw_eval * (21454 + td.board.material())
+ td.optimism[td.board.side_to_move()] * (1543 + td.board.material()))
/ 26663;
let mut eval = (raw_eval * (21032 + td.board.material())
+ td.optimism[td.board.side_to_move()] * (1548 + td.board.material()))
/ 27015;

eval = eval * (200 - td.board.fiftymove_clock() as i32) / 200;

Expand Down
26 changes: 13 additions & 13 deletions src/movepick.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl MovePicker {
if self.stage == Stage::GoodNoisy {
while !self.list.is_empty() {
let entry = self.get_best_entry();
let threshold = self.threshold.unwrap_or_else(|| -entry.score / 39 + 107);
let threshold = self.threshold.unwrap_or_else(|| -entry.score / 47 + 116);
if (self.tt_move.is_quiet() && self.noisy_count > 2) || !td.board.see(entry.mv, threshold) {
self.bad_noisy.push(entry.mv);
continue;
Expand Down Expand Up @@ -133,9 +133,9 @@ impl MovePicker {
let captured = td.board.type_on(mv.capture_sq());
let pt = td.board.type_on(mv.from());

entry.score = 15704 * captured.value() / 1024
entry.score = 14232 * captured.value() / 1024
+ td.noisy_history.get(threats, td.board.moved_piece(mv), mv.to(), captured)
+ 4057 * (mv.is_promotion() && mv.promo_piece_type() == PieceType::Queen) as i32
+ 4558 * (mv.is_promotion() && mv.promo_piece_type() == PieceType::Queen) as i32
+ (200000 - 20000 * pt as i32) * td.board.in_check() as i32;
}
}
Expand All @@ -159,7 +159,7 @@ impl MovePicker {
[Bitboard(0), pawn_threats, pawn_threats, minor_threats, rook_threats, Bitboard(0)]
};

let escape = [0, 8297, 8292, 13144, 21081, 0];
let escape = [0, 8854, 8170, 14051, 20357, 0];

// safe squares where we can attack an opponent piece
let offense = {
Expand Down Expand Up @@ -197,16 +197,16 @@ impl MovePicker {
let mv = entry.mv;
let pt = td.board.type_on(mv.from());

entry.score = 1973 * td.quiet_history.get(threats, side, mv) / 1024
+ 1573 * td.conthist(ply, 1, mv) / 1024
+ 956 * td.conthist(ply, 2, mv) / 1024
+ 987 * td.conthist(ply, 4, mv) / 1024
+ 944 * td.conthist(ply, 6, mv) / 1024
entry.score = 1763 * td.quiet_history.get(threats, side, mv) / 1024
+ 1614 * td.conthist(ply, 1, mv) / 1024
+ 1066 * td.conthist(ply, 2, mv) / 1024
+ 1086 * td.conthist(ply, 4, mv) / 1024
+ 1051 * td.conthist(ply, 6, mv) / 1024
+ escape[pt] * threatened[pt].contains(mv.from()) as i32
+ 9503 * td.board.checking_squares(pt).contains(mv.to()) as i32
- 8074 * threatened[pt].contains(mv.to()) as i32
+ 5182 * offense[pt].contains(mv.to()) as i32
- 4255 * wall_pawns.contains(mv.from()) as i32;
+ 10723 * td.board.checking_squares(pt).contains(mv.to()) as i32
- 8875 * threatened[pt].contains(mv.to()) as i32
+ 3446 * offense[pt].contains(mv.to()) as i32
- 4494 * wall_pawns.contains(mv.from()) as i32;
}
}
}
Loading
Loading