Skip to content

Commit 7a90cef

Browse files
authored
Fix node type detection (#55)
Bench: 9702384
1 parent c34e15b commit 7a90cef

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Bit-Genie/src/search.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,12 @@ namespace
114114
}
115115

116116
SearchResult pvs(Position &position, Search &search, TTable &tt,
117-
int depth, int alpha = MinEval, int beta = MaxEval, bool pv_node = false, bool do_null = true)
117+
int depth, int alpha = MinEval, int beta = MaxEval, bool do_null = true)
118118
{
119119
if (search.limits.stopped)
120120
return 0;
121121

122+
bool pv_node = std::abs(alpha - beta) > 1;
122123

123124
if ((search.info.nodes & 2047) == 0)
124125
search.limits.update();
@@ -152,7 +153,7 @@ namespace
152153
if (!pv_node && !in_check && depth > 4 && search.info.ply && do_null && position.should_do_null())
153154
{
154155
position.apply_null_move(search.info.ply);
155-
int score = -pvs(position, search, tt, depth - 4, -beta, -beta + 1, false, false).score;
156+
int score = -pvs(position, search, tt, depth - 4, -beta, -beta + 1, false).score;
156157
position.revert_null_move(search.info.ply);
157158

158159
if (search.limits.stopped)
@@ -197,15 +198,15 @@ namespace
197198

198199
int RDepth = std::clamp(new_depth - R, 1, new_depth - 1);
199200

200-
score = -pvs(position, search, tt, RDepth, -alpha - 1, -alpha, false, false).score;
201+
score = -pvs(position, search, tt, RDepth, -alpha - 1, -alpha).score;
201202

202203
if (score > alpha)
203-
score = -pvs(position, search, tt, depth - 1, -beta, -alpha, false).score;
204+
score = -pvs(position, search, tt, depth - 1, -beta, -alpha).score;
204205
}
205206
else
206207
{
207208
if (move_num == 1)
208-
score = -pvs(position, search, tt, depth - 1, -beta, -alpha, true).score;
209+
score = -pvs(position, search, tt, depth - 1, -beta, -alpha).score;
209210
else
210211
{
211212
score = -pvs(position, search, tt, depth - 1, -alpha - 1, -alpha).score;

Bit-Genie/src/uci.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "benchmark.h"
2626
#include "searchinit.h"
2727

28-
const char *version = "6";
28+
const char *version = "6.1";
2929

3030
namespace
3131
{

0 commit comments

Comments
 (0)