diff options
Diffstat (limited to 'src/script.c')
| -rwxr-xr-x | src/script.c | 51 |
1 files changed, 44 insertions, 7 deletions
diff --git a/src/script.c b/src/script.c index 4fb413d..085f9ec 100755 --- a/src/script.c +++ b/src/script.c @@ -23,6 +23,11 @@ Revision History: #include "chess.h" +// Declared directly instead of #include <math.h> -- that header #defines +// its own INFINITY, which collides with ours (chess.h:198, MAX_SHORT) and +// would silently change what INFINITY means for the rest of this file. +extern double pow(double, double); + // ---------------------------------------------------------------------- // // Global testsuite position counters @@ -50,7 +55,12 @@ typedef struct _SUITE_COUNTERS ULONG uSigmaDepth; double dSigmaSolutionTime; double dAverageNps; - double dAverageFirstMoveBeta; + UINT64 u64TotalBetaCutoffs; + UINT64 u64TotalBetaCutoffsOnFirstMove; + UINT64 u64TotalCounterMoveTries; + UINT64 u64TotalCounterMoveHits; + double dSigmaEBF; // sum of per-problem nodes^(1/depth) + ULONG uEBFCount; // number of problems with depth > 0 double dAverageTimeToSolution; ULONG uHistogram[SUITE_NUM_HISTOGRAM]; } @@ -400,8 +410,16 @@ Return value: if (!STRNCMPI(szLine, "go", 2)) { (void)Think(pos); - g_SuiteCounters.u64TotalNodeCount += + g_SuiteCounters.u64TotalNodeCount += g_Options.u64NodesSearched; + g_SuiteCounters.u64TotalBetaCutoffs += + g_Options.u64BetaCutoffs; + g_SuiteCounters.u64TotalBetaCutoffsOnFirstMove += + g_Options.u64BetaCutoffsOnFirstMove; + g_SuiteCounters.u64TotalCounterMoveTries += + g_Options.u64CounterMoveTries; + g_SuiteCounters.u64TotalCounterMoveHits += + g_Options.u64CounterMoveHits; } else { @@ -426,17 +444,29 @@ Return value: " avg. search speed : %6.1f nps\n" " avg. solution time : %3.1f sec\n" " avg. search depth : %4.1f ply\n" + " 1st move beta cut : %5.2f percent\n" + " avg. eff. branching : %5.3f\n" + " counter move hit %% : %5.2f percent (%" + COMPILER_LONGLONG_UNSIGNED_FORMAT " tries)\n" " script time : %6.1f sec\n\n", g_SuiteCounters.uCorrect, g_SuiteCounters.uIncorrect, g_SuiteCounters.uTotal, g_SuiteCounters.u64TotalNodeCount, - ((double)g_SuiteCounters.u64TotalNodeCount / + ((double)g_SuiteCounters.u64TotalNodeCount / (SystemTimeStamp() - dSuiteStart)), - (g_SuiteCounters.dSigmaSolutionTime / - (double)g_SuiteCounters.uCorrect), - ((double)g_SuiteCounters.uSigmaDepth / + ((g_SuiteCounters.uCorrect > 0) ? + (g_SuiteCounters.dSigmaSolutionTime / + (double)g_SuiteCounters.uCorrect) : 0.0), + ((double)g_SuiteCounters.uSigmaDepth / (double)g_SuiteCounters.uTotal), + (100.0 * (double)g_SuiteCounters.u64TotalBetaCutoffsOnFirstMove / + ((double)g_SuiteCounters.u64TotalBetaCutoffs + 1.0)), + (g_SuiteCounters.dSigmaEBF / + ((double)g_SuiteCounters.uEBFCount + 1.0)), + (100.0 * (double)g_SuiteCounters.u64TotalCounterMoveHits / + ((double)g_SuiteCounters.u64TotalCounterMoveTries + 1.0)), + g_SuiteCounters.u64TotalCounterMoveTries, (SystemTimeStamp() - dSuiteStart)); // Histogram stuff @@ -634,7 +664,14 @@ Return value: { g_SuiteCounters.uTotal++; g_SuiteCounters.uSigmaDepth += uDepth; - + if (uDepth > 0) + { + g_SuiteCounters.dSigmaEBF += + pow((double)ctx->sCounters.tree.u64TotalNodeCount, + 1.0 / (double)uDepth); + g_SuiteCounters.uEBFCount++; + } + if (CheckTestSuiteMove(mv, -1, uDepth)) { Trace("Problem %s solved in %3.1f sec.\n", |
