reduce size of ints that represent value

This commit is contained in:
2025-03-06 15:39:40 -05:00
parent 38ada710d9
commit 945ec934f5
3 changed files with 11 additions and 11 deletions

View File

@@ -277,8 +277,8 @@ impl FutureMoves {
let children_value = match self.config.children_eval_method {
ChildrenEvalMethod::Average => children_values
.into_iter()
.sum::<i128>()
.checked_div(self.arena[idx].children.len() as i128),
.sum::<i32>()
.checked_div(self.arena[idx].children.len() as i32),
ChildrenEvalMethod::Max => children_values.into_iter().max(),
ChildrenEvalMethod::Min => children_values.into_iter().min(),
}
@@ -288,7 +288,7 @@ impl FutureMoves {
// we should really setup some sort of ELO rating for each commit, playing them against
// each other or something, could be cool to benchmark these more subjective things, not
// just performance (cycles/time wise)
self.arena[idx].value = Some(self.arena[idx].self_value as i128 + children_value);
self.arena[idx].value = Some(self.arena[idx].self_value as i32 + children_value);
}
}
}