@@ -9,27 +9,27 @@ static const int R = 2;
9
9
static const int minDepth = 3 ;
10
10
11
11
// Razoring Values
12
- static const int RazorDepth = 3 ;
13
- static const int RazorMargin [4 ] = {0 , 200 , 400 , 600 };
12
+ static const int RazorDepth = 2 ;
13
+ static const int RazorMargin [3 ] = {0 , 200 , 400 };
14
14
15
15
// Futility Values
16
- static const int FutilityDepth = 5 ;
17
- static const int FutilityMargin [6 ] = {0 , 200 , 325 , 450 , 575 , 700 };
16
+ static const int FutilityDepth = 6 ;
17
+ static const int FutilityMargin [7 ] = {0 , 200 , 325 , 450 , 575 , 700 , 825 };
18
18
19
19
// Reverse Futility Values
20
20
static const int RevFutilityDepth = 4 ;
21
21
static const int RevFutilityMargin [5 ] = {0 , 250 , 500 , 750 , 1000 };
22
22
23
23
// LMR Values
24
24
static const int LateMoveDepth = 3 ;
25
- static const int FullSearchMoves = 3 ;
25
+ static const int FullSearchMoves = 4 ;
26
26
int LMRTable [64 ][64 ];
27
27
28
28
void InitSearch () {
29
29
// creating the LMR table entries (idea from Ethereal)
30
30
for (int moveDepth = 1 ; moveDepth < 64 ; moveDepth ++ )
31
31
for (int played = 1 ; played < 64 ; played ++ )
32
- LMRTable [moveDepth ][played ] = 1 + (log (moveDepth ) * log (played ) / 1.9 );
32
+ LMRTable [moveDepth ][played ] = 1 + (log (moveDepth ) * log (played ) / 1.7 );
33
33
}
34
34
35
35
static void CheckUp (S_SEARCHINFO * info ) {
@@ -284,23 +284,23 @@ static int AlphaBeta(int alpha, int beta, int depth, S_BOARD *pos, S_SEARCHINFO
284
284
285
285
int FoundPv = FALSE;
286
286
287
- // Futility pruning flag (if this flag is on, prune at the futile node )
287
+ // Futility Pruning flag (if node is futile (unlikely to raise alpha), this flag is set )
288
288
int FutileNode = (depth <= FutilityDepth && positionEval + FutilityMargin [depth ] <= alpha && abs (Score ) < ISMATE ) ? 1 : 0 ;
289
289
290
290
for (MoveNum = 0 ; MoveNum < list -> count ; ++ MoveNum ) {
291
291
292
292
PickNextMove (MoveNum , list );
293
293
294
- if ( !MakeMove (pos ,list -> moves [MoveNum ].move )) {
295
- continue ;
296
- }
297
-
298
- // Futility Pruning
294
+ // Futility Pruning (if node is considered futile, and at least 1 legal move has been searched, don't search any more quiet moves in the position)
299
295
if (Legal && FutileNode && !(list -> moves [MoveNum ].move & MFLAGCAP ) && !(list -> moves [MoveNum ].move & MFLAGPROM ) && !SqAttacked (pos -> KingSq [pos -> side ],pos -> side ^1 ,pos )) {
300
- TakeMove (pos );
301
296
continue ;
302
297
}
303
298
299
+ // if move is legal, play it
300
+ if ( !MakeMove (pos ,list -> moves [MoveNum ].move )) {
301
+ continue ;
302
+ }
303
+
304
304
Legal ++ ;
305
305
306
306
// PVS (speeds up search with good move ordering)
0 commit comments