Skip to content

Commit 0177fa5

Browse files
Change to not do static null move when move from tt is a quiet move and change beta condition.
60s+0.6 Hash=64 Score of tucanoNEW vs tucanoOLD: 1661 - 1593 - 3808 [0.505] 7062 Elo difference: 3.3 +/- 5.5, LOS: 88.3 %, DrawRatio: 53.9 % SPRT: llr 2.5 (84.8%), lbound -2.94, ubound 2.94 Score of tucanoNEW vs tucanoOLD: 391 - 315 - 914 [0.523] 1620 Elo difference: 16.3 +/- 11.2, LOS: 99.8 %, DrawRatio: 56.4 % SPRT: llr 2.96 (100.6%), lbound -2.94, ubound 2.94 - H1 was accepted
1 parent 0038f5d commit 0177fa5

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

src/globals.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,8 @@ int is_late_moves(MOVE_LIST *ml);
522522
int is_bad_capture(MOVE_LIST *ml);
523523
int is_mate_score(int score);
524524
int is_eval_score(int score);
525+
int is_winning_score(int score);
526+
int is_losing_score(int score);
525527

526528
// Move ordering
527529
void save_beta_cutoff_data(MOVE_ORDER *move_order, int color, int ply, MOVE best_move, MOVE_LIST *ml, MOVE previous_move);

src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#define ENGINE "Tucano"
2222
#define AUTHOR "Alcides Schulz"
23-
#define VERSION "12.10"
23+
#define VERSION "12.11"
2424

2525
void develop_workbench(void);
2626
double bench(int depth, int print);

src/search.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,10 @@ int search(GAME *game, UINT incheck, int alpha, int beta, int depth, MOVE exclud
139139
}
140140

141141
// Static null move: eval score + margin is higher that current beta, so it can skip the search.
142-
if (depth < STAT_NULL_DEPTH && eval_score - STAT_NULL_MARGIN[depth] >= beta && !is_mate_score(beta)) {
143-
return eval_score - STAT_NULL_MARGIN[depth];
142+
if (depth < STAT_NULL_DEPTH && eval_score - STAT_NULL_MARGIN[depth] >= beta && !is_losing_score(beta)) {
143+
if (trans_move == MOVE_NONE || move_is_capture(trans_move)) {
144+
return eval_score - STAT_NULL_MARGIN[depth];
145+
}
144146
}
145147

146148
// Null move heuristic: side to move has advantage that even allowing an extra move to opponent, still keeps advantage.

src/search_utils.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,22 @@ int is_mate_score(int score)
200200
return FALSE;
201201
}
202202

203+
//-------------------------------------------------------------------------------------------------
204+
// Indicate if is winning score from mate or egtb.
205+
//-------------------------------------------------------------------------------------------------
206+
int is_winning_score(int score)
207+
{
208+
return score >= WIN_SCORE;
209+
}
210+
211+
//-------------------------------------------------------------------------------------------------
212+
// Indicate if is losing score from mate or egtb.
213+
//-------------------------------------------------------------------------------------------------
214+
int is_losing_score(int score)
215+
{
216+
return score <= -WIN_SCORE;
217+
}
218+
203219
//-------------------------------------------------------------------------------------------------
204220
// Indicate if is an evaluation score
205221
//-------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)