From e8021f3938179e38c24b995777213fd6d629192a Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Sun, 30 Aug 2026 19:08:01 -0700 Subject: Oops, a couple of issues with that last one. --- src/debug_smoke_test.sh | 4 ++-- src/run_tests.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/search.c | 24 +++++++++++++----------- src/searchsup.c | 2 +- 4 files changed, 60 insertions(+), 14 deletions(-) create mode 100755 src/run_tests.sh (limited to 'src') 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) && -- cgit v1.3