summaryrefslogtreecommitdiff
path: root/src/root.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/root.c')
-rwxr-xr-xsrc/root.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/root.c b/src/root.c
index 0ab42f7..d7113c0 100755
--- a/src/root.c
+++ b/src/root.c
@@ -460,6 +460,19 @@ Return value:
ASSERT(d);
n = (double)(ctx->sCounters.pawnhash.u64Hits);
Trace("Pawn hash hitrate: %5.3f percent.\n", (n/d) * 100.0);
+ // EXPERIMENTAL, measurement-only -- see eval.c's Eval() /
+ // rgKingSafetyHashProbe.
+ d = (double)(ctx->sCounters.kingsafetyhash.u64Probes) + 1;
+ ASSERT(d);
+ n = (double)(ctx->sCounters.kingsafetyhash.u64Hits);
+ Trace("[EXPERIMENTAL] King safety hash: %5.3f%% hitrate, "
+ "avg %.1f cyc hit / %.1f cyc miss (%" COMPILER_LONGLONG_UNSIGNED_FORMAT
+ " probes)\n",
+ (n/d) * 100.0,
+ (n > 0 ? (double)ctx->sCounters.kingsafetyhash.u64CyclesHit / n : 0.0),
+ ((d - 1 - n) > 0 ?
+ (double)ctx->sCounters.kingsafetyhash.u64CyclesMiss / (d - 1 - n) : 0.0),
+ ctx->sCounters.kingsafetyhash.u64Probes);
n = (double)(ctx->sCounters.tree.u64NullMoveSuccess);
d = (double)(ctx->sCounters.tree.u64NullMoves) + 1;
ASSERT(d);
@@ -615,6 +628,22 @@ Return value:
(u64Total ? (100.0 * (double)u64AttackPop / (double)u64Total) : 0.0),
(u64Total ? (100.0 * (double)u64Unaccounted / (double)u64Total) : 0.0));
{
+ UINT64 u64LazyDecision = ctx->sCounters.tree.u64CyclesEvalLazyDecision;
+ UINT64 u64CKSD = ctx->sCounters.tree.u64CyclesEvalCountKingSafetyDefects;
+ UINT64 u64Storm = ctx->sCounters.tree.u64CyclesEvalFileStormDefects;
+ UINT64 u64PreLazyRest = (u64PreLazyOther >= u64LazyDecision) ?
+ (u64PreLazyOther - u64LazyDecision) : 0;
+ Trace(" -- of which, pre-lazy breakdown --\n");
+ Trace(" material/passers/badtrades/bishoppairs: %5.1f%%\n",
+ (u64Total ? (100.0 * (double)u64PreLazyRest / (double)u64Total) : 0.0));
+ Trace(" lazy gate + EstimatePositionalScore: %5.1f%% "
+ "(of which CountKingSafetyDefects: %5.1f%%, "
+ "_GetFileStormDefects: %5.1f%%)\n",
+ (u64Total ? (100.0 * (double)u64LazyDecision / (double)u64Total) : 0.0),
+ (u64Total ? (100.0 * (double)u64CKSD / (double)u64Total) : 0.0),
+ (u64Total ? (100.0 * (double)u64Storm / (double)u64Total) : 0.0));
+ }
+ {
UINT64 u64PHits = ctx->sCounters.tree.u64CountEvalPawnsHit;
UINT64 u64PMisses = ctx->sCounters.tree.u64CountEvalPawnsMiss;
UINT64 u64PHitCycles = ctx->sCounters.tree.u64CyclesEvalPawnsHit;