summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2026-10-10 10:29:48 -0700
committerScott Gasch <[email protected]>2026-10-10 10:29:48 -0700
commit03545c4600df81b1a47dbc63fc606c065e857d8b (patch)
treea433fdce69fd27359679ad91e0ebedd52e2506cd /src/search.c
parentfbdcb9d76dd2444d8bc631331eaeb9435cc247f8 (diff)
Eval mobility/pseudo-mobility tweaks; drop unproductive move-ordering experiments.
eval.c: add bishop/rook x-ray pseudo-mobility terms (squares seen past a directly-attacked higher-value piece), trim pawn-centrality edge penalty and bishop-pair bonus. chess.h/dynamic.c/generate.c/search.c/searchsup.c: revert three move-ordering experiments (recapture bonus, flee-to-safety GOOD_MOVE promotion, ply-2 move-pair bonus) that calibrated with real fail-high signal but never converted into a measurable node-count or solve-rate win on the curated suites -- see MOVE_ORDERING_IDEAS.md for the evidence and reasoning behind each drop. Add MOVE_ORDERING_EVIDENCE_COLLECTION as its own GNUmakefile flag, independent of PERF_COUNTERS, for any future such harness. command.c: remove the KING_DEFECT_DUMP-gated evalkingdump command, dead since the king-safety remine work moved to eval_tune/king_safety_data/. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/src/search.c b/src/search.c
index 0ac0037..89db55c 100644
--- a/src/search.c
+++ b/src/search.c
@@ -244,7 +244,7 @@ _PostReduceDepthBucketEfpAligned(ULONG uNextDepthRaw)
// countermove match's own FH%? See chess.h's CM_EVIDENCE_BUCKETS
// comment. Buckets by log-ish bands rather than linear, since evidence
// values span 0 to ~STRIP_OFF_FLAGS*2 (~16.7M).
-#ifdef PERF_COUNTERS
+#ifdef MOVE_ORDERING_EVIDENCE_COLLECTION
static ULONG
_CMEvidenceBucket(ULONG uEvidence)
{
@@ -261,6 +261,7 @@ _CMEvidenceBucket(ULONG uEvidence)
}
return(0);
}
+
#endif
#ifdef TEST_NULL
@@ -541,9 +542,11 @@ Search(IN SEARCHER_THREAD_CONTEXT *ctx,
// definition gate-1 describes.
FLAG fMoveIsPruneReduceEligible = FALSE;
ULONG uRawDepthB;
-#ifdef PERF_COUNTERS
+#ifdef MOVE_ORDERING_EVIDENCE_COLLECTION
FLAG fThisMoveIsCountermoveMatch = FALSE;
ULONG uCMEvidenceBucket = 0;
+#endif
+#ifdef PERF_COUNTERS
ULONG uThisMoveHangBucket = 0;
ULONG uThisMoveGapBucket = 0;
ULONG uThisMoveNumBucket = 0;
@@ -864,7 +867,7 @@ Search(IN SEARCHER_THREAD_CONTEXT *ctx,
// or hash table results.
if (fThreat)
{
- iPositionalExtend += THREE_QUARTERS_PLY;
+ iPositionalExtend += HALF_PLY;
INC(ctx->sCounters.extension.uMateThreat);
}
@@ -1057,7 +1060,7 @@ Search(IN SEARCHER_THREAD_CONTEXT *ctx,
MVF_MOVE_SEARCHED));
ctx->sMoveStack.mvf[x].bvFlags |= MVF_MOVE_SEARCHED;
#endif
-#ifdef PERF_COUNTERS
+#ifdef MOVE_ORDERING_EVIDENCE_COLLECTION
// Countermove evidence calibration -- ongoing check
// that COUNTERMOVE_EVIDENCE_THRESHOLD (chess.h) is
// still well-calibrated: log every countermove-
@@ -1160,14 +1163,11 @@ Search(IN SEARCHER_THREAD_CONTEXT *ctx,
// mvBest). The killer/counter-move/history-increment
// side of the update below is unaffected.
//
- if (!IS_CAPTURE_OR_PROMOTION(mvBest))
- {
- UpdateDynamicMoveOrdering(ctx,
- uDepth,
- mvBest,
- iBestScore,
- 0);
- }
+ UpdateDynamicMoveOrdering(ctx,
+ uDepth,
+ mvBest,
+ iBestScore,
+ 0);
StoreLowerBound(mvBest, pos, iBestScore, uDepth, fThreat);
if (mvBest.pCaptured && !IS_PAWN(mvBest.pCaptured) &&
(iBeta < +NMATE))
@@ -1336,7 +1336,7 @@ Search(IN SEARCHER_THREAD_CONTEXT *ctx,
(uFHPctThousandths <= EFP_FH_PRUNE_THRESHOLD_PCT_THOUSANDTHS);
fThisMoveEFPPruned =
fThisMoveEFPPruned &&
- (uPredictedFH == 0xFFFF || uPredictedFH < 200);
+ (uPredictedFH == 0xFFFF || uPredictedFH < 300);
#if 0
if (fThisMoveEFPPruned &&
uPredictedFH != 0xFFFF &&
@@ -1525,9 +1525,14 @@ Search(IN SEARCHER_THREAD_CONTEXT *ctx,
}
#endif
}
+#endif // PERF_COUNTERS
+#ifdef MOVE_ORDERING_EVIDENCE_COLLECTION
+ // Deliberately its own gate, not nested under PERF_COUNTERS
+ // above -- see MOI_INC/MOVE_ORDERING_EVIDENCE_COLLECTION
+ // comment (chess.h).
if (TRUE == fThisMoveIsCountermoveMatch)
{
- INC(ctx->sCounters.tree.u64CMEvidenceTries[uCMEvidenceBucket]);
+ MOI_INC(ctx->sCounters.tree.u64CMEvidenceTries[uCMEvidenceBucket]);
}
#endif
// Record the extension/reduction actually applied to
@@ -1877,9 +1882,11 @@ Search(IN SEARCHER_THREAD_CONTEXT *ctx,
[uThisMoveGapBucket][uThisMoveNumBucket]);
}
}
+#endif // PERF_COUNTERS
+#ifdef MOVE_ORDERING_EVIDENCE_COLLECTION
if (TRUE == fThisMoveIsCountermoveMatch)
{
- INC(ctx->sCounters.tree.u64CMEvidenceFH[uCMEvidenceBucket]);
+ MOI_INC(ctx->sCounters.tree.u64CMEvidenceFH[uCMEvidenceBucket]);
}
#endif
// Update history and killers list and store in