1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00

Vary reduction aggressiveness as a function of thinking time

In the beginning use milder reduction and at the end be
more aggressive.

After 1500 games on Joona's QUAD
Mod - Orig: 791 - 720 +16 elo

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Joona Kiiski 2010-03-21 22:44:56 +02:00 committed by Marco Costalba
parent 661d48c27b
commit 7618ee2df1

View file

@ -215,12 +215,14 @@ namespace {
// Step 14. Reduced search // Step 14. Reduced search
int ReductionLevel = 2; // 0 = most aggressive reductions, 7 = minimum reductions
// Reduction lookup tables (initialized at startup) and their getter functions // Reduction lookup tables (initialized at startup) and their getter functions
int8_t PVReductionMatrix[8][64][64]; // [depth][moveNumber] int8_t PVReductionMatrix[8][64][64]; // [depth][moveNumber]
int8_t NonPVReductionMatrix[8][64][64]; // [depth][moveNumber] int8_t NonPVReductionMatrix[8][64][64]; // [depth][moveNumber]
inline Depth pv_reduction(Depth d, int mn) { return (Depth) PVReductionMatrix[0][Min(d / 2, 63)][Min(mn, 63)]; } inline Depth pv_reduction(Depth d, int mn) { return (Depth) PVReductionMatrix[ReductionLevel][Min(d / 2, 63)][Min(mn, 63)]; }
inline Depth nonpv_reduction(Depth d, int mn) { return (Depth) NonPVReductionMatrix[0][Min(d / 2, 63)][Min(mn, 63)]; } inline Depth nonpv_reduction(Depth d, int mn) { return (Depth) NonPVReductionMatrix[ReductionLevel][Min(d / 2, 63)][Min(mn, 63)]; }
// Common adjustments // Common adjustments
@ -671,6 +673,19 @@ namespace {
beta = Min(ValueByIteration[Iteration - 1] + AspirationDelta, VALUE_INFINITE); beta = Min(ValueByIteration[Iteration - 1] + AspirationDelta, VALUE_INFINITE);
} }
// Choose optimum reduction level
ReductionLevel = 2;
if (UseTimeManagement)
{
int level = int(floor(log(float(MaxSearchTime) / current_search_time()) / log(2.0) + 1.0));
ReductionLevel = Min(Max(level, 0), 7);
}
else
{
//FIXME
}
// Search to the current depth, rml is updated and sorted, alpha and beta could change // Search to the current depth, rml is updated and sorted, alpha and beta could change
value = root_search(p, ss, rml, &alpha, &beta); value = root_search(p, ss, rml, &alpha, &beta);