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

Remove history aging #268

Merged
merged 1 commit into from
Aug 2, 2024
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: 0 additions & 6 deletions simbelmyne/src/history_tables/capthist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ impl TacticalHistoryTable {
Box::from_raw(ptr.cast())
}
}

pub fn age_entries(&mut self) {
for mut history in self.tables {
history.age_entries();
}
}
}

impl Index<PieceType> for TacticalHistoryTable {
Expand Down
12 changes: 1 addition & 11 deletions simbelmyne/src/history_tables/corrhist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
//! Those are clearly the ones that need more correction, because the eval got
//! it _very_ wrong.
use chess::piece::Color;
use crate::{evaluate::Score, search::params::hist_age_divisor, zobrist::ZHash};
use crate::{evaluate::Score, zobrist::ZHash};

#[derive(Debug)]
pub struct CorrHistTable {
Expand All @@ -51,16 +51,6 @@ impl CorrHistTable {
}
}

/// Age the entries in the history table by dividing them by
/// [HIST_AGE_DIVISOR].
pub fn age_entries(&mut self) {
for color in 0..Color::COUNT {
for key in 0..Self::SIZE {
self.table[color][key].0 /= hist_age_divisor() as i32;
}
}
}

/// Get a reference to the correction history entry for a given STM and
/// pawn hash.
pub fn get(&self, side: Color, hash: ZHash) -> &CorrHistEntry {
Expand Down
11 changes: 0 additions & 11 deletions simbelmyne/src/history_tables/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
/// tree the move was played), so we don't flood the scores with moves played at
/// the leaves, which are inherently less valuable.

use crate::search::params::hist_age_divisor;
use crate::search::params::hist_bonus_const;
use crate::search::params::hist_bonus_const_cutoff;
use crate::search::params::hist_bonus_linear;
Expand Down Expand Up @@ -45,16 +44,6 @@ impl HistoryTable {
scores: [[HistoryScore(0); Square::COUNT]; Piece::COUNT]
}
}

/// Reduce the values from previous searches so they don't swamp this
/// search's history values.
pub fn age_entries(&mut self) {
for piece_idx in 0..Piece::COUNT {
for sq_idx in 0..Square::COUNT {
self.scores[piece_idx][sq_idx] = HistoryScore(self.scores[piece_idx][sq_idx].0 / hist_age_divisor());
}
}
}
}

impl Index<HistoryIndex> for HistoryTable {
Expand Down
6 changes: 0 additions & 6 deletions simbelmyne/src/history_tables/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,4 @@ impl History {
pub fn clear_countermoves(&mut self) {
self.countermoves = CountermoveTable::boxed();
}

pub fn age_entries(&mut self) {
self.main_hist.age_entries();
self.tact_hist.age_entries();
self.corr_hist.age_entries();
}
}
8 changes: 0 additions & 8 deletions simbelmyne/src/history_tables/threats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ impl ThreatsHistoryTable {
Box::from_raw(ptr.cast())
}
}

pub fn age_entries(&mut self) {
for tables in self.tables {
for mut table in tables {
table.age_entries();
}
}
}
}

impl Index<ThreatIndex> for ThreatsHistoryTable {
Expand Down
3 changes: 0 additions & 3 deletions simbelmyne/src/search/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,6 @@ pub mod tunable_params {
#[uci(min = 0, max = 100, step = 10)]
const HIST_BONUS_QUADRATIC: i16 = 16;

#[uci(min = 1, max = 4, step = 1)]
const HIST_AGE_DIVISOR: i16 = 2;

#[uci(min = 1, max = 16382, step = 100)]
const HIST_LMR_DIVISOR: i32 = 8191;

Expand Down
1 change: 0 additions & 1 deletion simbelmyne/src/uci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ impl SearchThread {
for msg in rx.iter() {
match msg {
SearchCommand::Search(position, mut tc) => {
history.age_entries();
tt.increment_age();

let report = position.search::<DEBUG>(
Expand Down
Loading