mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Remove PvNode dimension from Reductions array
This is a functional simplification: if we simply subtract one to Reductions[] when PvNode is set, we can remove this dimension of the multidimensional array. I think this saves about 8K of memory. STC LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 10118 W: 2282 L: 2138 D: 5698 http://tests.stockfishchess.org/tests/view/5c6332b60ebc5925cffbdfed LTC LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 70765 W: 11617 L: 11575 D: 47573 http://tests.stockfishchess.org/tests/view/5c63379e0ebc5925cffbe0de Closes https://github.com/official-stockfish/Stockfish/pull/2010 Bench 3261078
This commit is contained in:
parent
76d2f5b94a
commit
22ef36803e
1 changed files with 4 additions and 5 deletions
|
@ -73,10 +73,10 @@ namespace {
|
||||||
|
|
||||||
// Futility and reductions lookup tables, initialized at startup
|
// Futility and reductions lookup tables, initialized at startup
|
||||||
int FutilityMoveCounts[2][16]; // [improving][depth]
|
int FutilityMoveCounts[2][16]; // [improving][depth]
|
||||||
int Reductions[2][2][64][64]; // [pv][improving][depth][moveNumber]
|
int Reductions[2][64][64]; // [improving][depth][moveNumber]
|
||||||
|
|
||||||
template <bool PvNode> Depth reduction(bool i, Depth d, int mn) {
|
template <bool PvNode> Depth reduction(bool i, Depth d, int mn) {
|
||||||
return Reductions[PvNode][i][std::min(d / ONE_PLY, 63)][std::min(mn, 63)] * ONE_PLY;
|
return (Reductions[i][std::min(d / ONE_PLY, 63)][std::min(mn, 63)] - PvNode) * ONE_PLY;
|
||||||
}
|
}
|
||||||
|
|
||||||
// History and stats update bonus, based on depth
|
// History and stats update bonus, based on depth
|
||||||
|
@ -162,12 +162,11 @@ void Search::init() {
|
||||||
{
|
{
|
||||||
double r = log(d) * log(mc) / 1.95;
|
double r = log(d) * log(mc) / 1.95;
|
||||||
|
|
||||||
Reductions[NonPV][imp][d][mc] = int(std::round(r));
|
Reductions[imp][d][mc] = std::round(r);
|
||||||
Reductions[PV][imp][d][mc] = std::max(Reductions[NonPV][imp][d][mc] - 1, 0);
|
|
||||||
|
|
||||||
// Increase reduction for non-PV nodes when eval is not improving
|
// Increase reduction for non-PV nodes when eval is not improving
|
||||||
if (!imp && r > 1.0)
|
if (!imp && r > 1.0)
|
||||||
Reductions[NonPV][imp][d][mc]++;
|
Reductions[imp][d][mc]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int d = 0; d < 16; ++d)
|
for (int d = 0; d < 16; ++d)
|
||||||
|
|
Loading…
Add table
Reference in a new issue