Improving #61
No files matched your search
+11
-1
@@ -240,7 +240,17 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
|
|||||||
const int staticEval = NNUE::net.Evaluate(board);
|
const int staticEval = NNUE::net.Evaluate(board);
|
||||||
ctx.ss[ply].eval = staticEval;
|
ctx.ss[ply].eval = staticEval;
|
||||||
|
|
||||||
const bool improving = ply >= 2 ? ctx.ss[ply].eval > ctx.ss[ply-2].eval : false;
|
const bool improving = [&]
|
||||||
|
{
|
||||||
|
if (board.InCheck())
|
||||||
|
return false;
|
||||||
|
if (ply > 1 && ctx.ss[ply - 2].eval != ScoreNone)
|
||||||
|
return staticEval > ctx.ss[ply - 2].eval;
|
||||||
|
if (ply > 3 && ctx.ss[ply - 4].eval != ScoreNone)
|
||||||
|
return staticEval > ctx.ss[ply - 4].eval;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}();
|
||||||
|
|
||||||
if (!board.InCheck()) {
|
if (!board.InCheck()) {
|
||||||
if (ply) {
|
if (ply) {
|
||||||
|
|||||||
+2
-1
@@ -21,6 +21,7 @@ constexpr int MAX_DEPTH = 64;
|
|||||||
constexpr int MAX_PLY = 128;
|
constexpr int MAX_PLY = 128;
|
||||||
constexpr int MAX_HISTORY = 16384;
|
constexpr int MAX_HISTORY = 16384;
|
||||||
|
|
||||||
|
constexpr int32_t ScoreNone = -255000;
|
||||||
constexpr int inf = 100000;
|
constexpr int inf = 100000;
|
||||||
|
|
||||||
inline int lmrTable[MAX_DEPTH+1][MAX_MOVES];
|
inline int lmrTable[MAX_DEPTH+1][MAX_MOVES];
|
||||||
@@ -86,7 +87,7 @@ public:
|
|||||||
|
|
||||||
class Stack {
|
class Stack {
|
||||||
public:
|
public:
|
||||||
int32_t eval = 0;
|
int32_t eval = ScoreNone;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SearchContext {
|
class SearchContext {
|
||||||
|
|||||||
Reference in new issue
Block a user