summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2026-08-30 19:08:01 -0700
committerScott Gasch <[email protected]>2026-08-30 19:08:01 -0700
commite8021f3938179e38c24b995777213fd6d629192a (patch)
treefdd6ec670e5a576d25de7b526965c7ae603bc399
parentdbf71219abeb51d386b0f7294f1664f2906d2b82 (diff)
Oops, a couple of issues with that last one.
-rwxr-xr-xsrc/debug_smoke_test.sh4
-rwxr-xr-xsrc/run_tests.sh44
-rwxr-xr-xsrc/search.c24
-rw-r--r--src/searchsup.c2
4 files changed, 60 insertions, 14 deletions
diff --git a/src/debug_smoke_test.sh b/src/debug_smoke_test.sh
index 1d2ba0e..d8ef228 100755
--- a/src/debug_smoke_test.sh
+++ b/src/debug_smoke_test.sh
@@ -14,7 +14,7 @@
# Defaults: ./_typhoon, sd 4, 10 positions
BIN="${1:-./_typhoon}"
-DEPTH="${2:-4}"
+DEPTH="${2:-5}"
COUNT="${3:-10}"
SUITE=../tests/ecm.ep_
LOGDIR=/tmp/typhoon/smoke_test
@@ -66,7 +66,7 @@ echo " FENs chosen (reproduce a failure with: script $SAMPLE_SAVED):"
grep '^setboard' "$SAMPLE_SAVED" | sed 's/^setboard / /'
START=$(date +%s)
-"$BIN" --cpus 1 --hash 64m --logfile "$LOG" \
+"$BIN" --cpus 4 --hash 64m --logfile "$LOG" \
--batch --command "force; book name /nonexistent.book.bin; sd $DEPTH; script $SAMPLE" \
> "$OUT" 2>&1
STATUS=$?
diff --git a/src/run_tests.sh b/src/run_tests.sh
new file mode 100755
index 0000000..aaa1ba1
--- /dev/null
+++ b/src/run_tests.sh
@@ -0,0 +1,44 @@
+#!/usr/bin/env bash
+
+set -e
+
+LOGDIR="/tmp/typhoon/manual"
+HEAD_LOGDIR="../head_reference/logs"
+TESTS="../tests"
+
+/bin/rm -rf "${LOGDIR}/*"
+
+clear
+echo -n "Launching "
+for suite in ecm_ringers ecm_confident_quick ecm_hard_quick; do
+ echo -n "$suite@sd10 "
+ ./typhoon \
+ --cpus 1 \
+ --hash 256m \
+ --logfile "$LOGDIR/sd10_${suite}.log" \
+ --batch \
+ --command "force; book name /nonexistent.book.bin; sd 10; script $TESTS/${suite}.ep_" \
+ > "$LOGDIR/sd10_${suite}.out" 2>&1 &
+ echo -n "$suite@sn5M "
+ ./typhoon \
+ --cpus 1 \
+ --hash 256m \
+ --logfile "$LOGDIR/sn5m_${suite}.log" \
+ --batch \
+ --command "force; book name /nonexistent.book.bin; sn 5000000; script $TESTS/${suite}.ep_" \
+ > "$LOGDIR/sn5m_${suite}.out" 2>&1 &
+done
+echo
+echo
+wait
+
+for suite in ecm_ringers ecm_confident_quick ecm_hard_quick; do
+ echo "----[ $suite sd=10 ]----"
+ tail -32 $LOGDIR/sd10_${suite}.out | head -3 | prefix "CANDIDATE>"
+ tail -32 $HEAD_LOGDIR/sd10_${suite}.out | head -3 | prefix " HEAD>"
+ echo
+ echo "----[ $suite sn=5M ]----"
+ tail -32 $LOGDIR/sn5m_${suite}.out | head -3 | prefix "CANDIDATE>"
+ tail -32 $HEAD_LOGDIR/sn5m_${suite}.out | head -3 | prefix " HEAD>"
+ echo
+done
diff --git a/src/search.c b/src/search.c
index 4a153aa..6352f97 100755
--- a/src/search.c
+++ b/src/search.c
@@ -526,18 +526,20 @@ Search(IN SEARCHER_THREAD_CONTEXT *ctx,
(ctx->sPlyInfo[ctx->uPly - 2].iExtensionAmount <= 0))
{
ASSERT(uDepth >= THREE_QUARTERS_PLY);
- if ((uDepth <= ONE_PLY + THREE_QUARTERS_PLY) &&
- (iEval + VALUE_KNIGHT + iImprovement <= iAlpha))
- {
- uFutilityMargin = (iAlpha - iEval) / 2;
- ASSERT(uFutilityMargin);
- }
- else if ((uDepth > ONE_PLY + THREE_QUARTERS_PLY) &&
- (uDepth <= TWO_PLY + THREE_QUARTERS_PLY) &&
- (iEval + VALUE_ROOK + iImprovement <= iAlpha))
+
+ if (iEval < iAlpha)
{
- uFutilityMargin = (iAlpha - iEval) / 2;
- ASSERT(uFutilityMargin);
+ if ((uDepth <= ONE_PLY + THREE_QUARTERS_PLY) &&
+ (iEval + VALUE_KNIGHT + iImprovement <= iAlpha))
+ {
+ uFutilityMargin = (iAlpha - iEval) / 2;
+ }
+ else if ((uDepth > ONE_PLY + THREE_QUARTERS_PLY) &&
+ (uDepth <= TWO_PLY + THREE_QUARTERS_PLY) &&
+ (iEval + VALUE_ROOK + iImprovement <= iAlpha))
+ {
+ uFutilityMargin = (iAlpha - iEval) / 2;
+ }
}
}
uStage++;
diff --git a/src/searchsup.c b/src/searchsup.c
index 9ad4303..172413f 100644
--- a/src/searchsup.c
+++ b/src/searchsup.c
@@ -1112,7 +1112,7 @@ FLAG WeShouldTryNullmovePruning(SEARCHER_THREAD_CONTEXT *ctx,
ASSERT(IS_VALID_SCORE(iAlpha) && IS_VALID_SCORE(iBeta));
ASSERT(iAlpha < iBeta);
- ASSERT(IS_VALID_SCORE(iRoughEval));
+ ASSERT(IS_VALID_SCORE(iEval));
ASSERT(uNullDepth < MAX_PLY_PER_SEARCH * ONE_PLY);
if ((FALSE == pf->fAvoidNullmove) &&