Skip to content

Commit 812fe83

Browse files
Adjust depth based on eval progression.
20s+0.2 Hash=16 Score of tucanoNEW vs tucanoOLD: 1678 - 1595 - 3665 [0.506] 6938 Elo difference: 4.2 +/- 5.6, LOS: 92.7 %, DrawRatio: 52.8 % SPRT: llr 2.98 (101.1%), lbound -2.94, ubound 2.94 - H1 was accepted 60s+0.6 Hash=64 Score of tucanoNEW vs tucanoOLD: 969 - 890 - 2278 [0.510] 4137 Elo difference: 6.6 +/- 7.1, LOS: 96.7 %, DrawRatio: 55.1 % SPRT: llr 2.98 (101.1%), lbound -2.94, ubound 2.94 - H1 was accepted
1 parent 0177fa5 commit 812fe83

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

src/globals.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ typedef struct s_game {
405405
MOVE_ORDER move_order;
406406
EVAL_TABLE eval_table[EVAL_TABLE_SIZE];
407407
int eval_hist[MAX_PLY];
408+
int reductions[MAX_PLY];
408409
int is_main_thread;
409410
THREAD_ID thread_handle;
410411
int thread_number;

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.11"
23+
#define VERSION "12.12"
2424

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

src/search.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ int search(GAME *game, UINT incheck, int alpha, int beta, int depth, MOVE exclud
4848

4949
game->pv_line.size[ply] = ply;
5050
game->search.nodes++;
51+
game->reductions[ply] = 0;
5152

5253
if (!root_node) {
5354
// drawn position
@@ -127,6 +128,16 @@ int search(GAME *game, UINT incheck, int alpha, int beta, int depth, MOVE exclud
127128
int eval_score = evaluate(game);
128129
game->eval_hist[ply] = eval_score;
129130
int improving = ply > 1 && game->eval_hist[ply] > game->eval_hist[ply - 2];
131+
int opponent_worsening = ply > 0 && game->eval_hist[ply] > -game->eval_hist[ply - 1];
132+
int prior_reduction = ply > 0 ? game->reductions[ply - 1] : 0;
133+
134+
// Adjust depth based on eval progress
135+
if (prior_reduction >= 3 && !opponent_worsening) {
136+
depth++;
137+
}
138+
if (prior_reduction >= 1 && depth >= 2 && game->eval_hist[ply] + game->eval_hist[ply - 1] > 175) {
139+
depth--;
140+
}
130141

131142
if (!pv_node && !incheck && !singular_move_search) {
132143

@@ -350,7 +361,9 @@ int search(GAME *game, UINT incheck, int alpha, int beta, int depth, MOVE exclud
350361
score = -search(game, gives_check, -beta, -alpha, depth - 1 + extensions, MOVE_NONE);
351362
}
352363
else {
364+
game->reductions[ply] = reductions;
353365
score = -search(game, gives_check, -alpha - 1, -alpha, depth - 1 + extensions - reductions, MOVE_NONE);
366+
game->reductions[ply] = 0;
354367
if (!game->search.abort && score > alpha && reductions) {
355368
score = -search(game, gives_check, -alpha - 1, -alpha, depth - 1 + extensions, MOVE_NONE);
356369
}

0 commit comments

Comments
 (0)