Skip to content

Commit 76d79e2

Browse files
committed
add improving heuristic
Results of bread_engine_1.5.5 vs bread_engine_1.5.4 (8+0.08, NULL, NULL, UHO_2024_8mvs_big_+115_+134.pgn): Elo: 6.19 +/- 4.94, nElo: 8.52 +/- 6.80 LOS: 99.30 %, DrawRatio: 42.41 %, PairsRatio: 1.09 Games: 10040, Wins: 3578, Losses: 3399, Draws: 3063, Points: 5109.5 (50.89 %) Ptnml(0-2): [379, 1002, 2129, 1081, 429], WL/DD Ratio: 3.34 LLR: 3.00 (102.0%) (-2.94, 2.94) [0.00, 8.00]
1 parent c566476 commit 76d79e2

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.20)
2-
project(bread_engine VERSION 1.5.4)
2+
project(bread_engine VERSION 1.5.5)
33

44
set(CMAKE_CXX_STANDARD 20)
55
set(CMAKE_CXX_STANDARD_REQUIRED True)

dependencies/misc.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ struct Stack {
113113
Move excluded_move = Move::NO_MOVE;
114114
Move current_move = Move::NO_MOVE;
115115
Piece moved_piece = Piece::NONE;
116+
int static_eval = NO_VALUE;
116117
};
117118

118119
class KillerMoves {

src/core.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,11 @@ int Engine::negamax(int depth, int alpha, int beta, Stack* ss){
359359
if (eval == NO_VALUE)
360360
eval = static_eval;
361361

362+
ss->static_eval = static_eval;
363+
364+
bool improving = is_valid(ss->static_eval) && is_valid((ss - 2)->static_eval) &&
365+
ss->static_eval > (ss - 2)->static_eval;
366+
362367
// pruning
363368
if (!pv && !in_check){
364369

@@ -370,9 +375,8 @@ int Engine::negamax(int depth, int alpha, int beta, Stack* ss){
370375
}
371376

372377
// reverse futility pruning
373-
if (depth < 6 && eval - depth*150 - 281 >= beta){
378+
if (depth < 6 && eval - depth*142 - 310 + 100*improving >= beta)
374379
return eval;
375-
}
376380

377381
// null move pruning
378382
// maybe check for zugzwang?

0 commit comments

Comments
 (0)