Skip to content

Commit

Permalink
Count only quiet moves for move count pruning.
Browse files Browse the repository at this point in the history
  • Loading branch information
petur committed Oct 11, 2022
1 parent 1d0f83d commit 8351334
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
18 changes: 11 additions & 7 deletions compare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@

set -e

hash='4'
tc='3+0.03'
base='main'
for arg in "$@"; do
case "$arg" in
tc=*)
tc="${arg#tc=}"
;;
base=*)
base="${arg#base=}"
;;
hash=*)
hash="${arg#hash=}"
;;
tc=*)
tc="${arg#tc=}"
;;
base=*)
base="${arg#base=}"
;;
esac
done

Expand All @@ -21,7 +25,7 @@ branch=$(git branch --show-current)
c-chess-cli \
-engine cmd="./branches/seawall-${branch}" \
-engine cmd="./branches/seawall-${base}" \
-each option.Hash=256 tc="$tc" \
-each option.Hash="$hash" tc="$tc" \
-openings file=./books/testing.fen order=random \
-games 20000 -repeat \
-concurrency 2 -log -sprt
2 changes: 1 addition & 1 deletion sample.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ branch=$(git branch --show-current)
c-chess-cli \
-engine cmd="./branches/seawall-${branch}" \
-engine cmd="./branches/seawall-main" \
-each option.Hash=16 tc=1+0.01 \
-each option.Hash=4 tc=1+0.01 \
-openings file=./books/training.fen order=random \
-games 500 -concurrency 2 \
-sample freq=0.24 decay=0.005 resolve=y file="samples/$(date '+%Y%m%d-%H%M%S').csv" format=csv
9 changes: 7 additions & 2 deletions seawall.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1420,14 +1420,19 @@ std::pair<int, Move> Search::search(bool pv, int ply, int depth, int alpha, int
int orig_alpha = alpha;

int move_count = 0;
int mcp = 0;

while (Move mv = gen.next())
{
if (!checkers && move_count && depth <= 5 && eval < alpha - (depth * 240 - 140) && !(type(mv) & (CAPTURE | PROMOTION)))
continue;
if (!checkers && depth <= 5 && alpha > -SCORE_WIN && move_count > 5 + 5 * depth && eval < alpha - 50 * depth &&
if (!checkers && depth <= 5 && alpha > -SCORE_WIN && eval < alpha - 25 - 25 * depth &&
!(type(mv) & (CAPTURE | PROMOTION)) && mv != prev_best && mv != stack[ply].killer_moves[0] && mv != stack[ply].killer_moves[1])
break;
{
++mcp;
if (mcp > 4 * (depth - 1) + 2)
break;
}

int extension = 0;
if (checkers)
Expand Down

0 comments on commit 8351334

Please sign in to comment.