@@ -62,8 +62,7 @@ namespace {
6262 constexpr uint64_t TtHitAverageWindow = 4096 ;
6363 constexpr uint64_t TtHitAverageResolution = 1024 ;
6464
65- // Razor and futility margins
66- constexpr int RazorMargin = 510 ;
65+ // Futility margin
6766 Value futility_margin (Depth d, bool improving) {
6867 return Value (234 * (d - improving));
6968 }
@@ -822,12 +821,6 @@ namespace {
822821 thisThread->mainHistory [~us][from_to ((ss-1 )->currentMove )] << bonus;
823822 }
824823
825- // Step 7. Razoring (~1 Elo)
826- if ( !rootNode // The required rootNode PV handling is not available in qsearch
827- && depth == 1
828- && eval <= alpha - RazorMargin)
829- return qsearch<NT>(pos, ss, alpha, beta);
830-
831824 // Set up improving flag that is used in various pruning heuristics
832825 // We define position as improving if static evaluation of position is better
833826 // Than the previous static evaluation at our turn
@@ -836,14 +829,14 @@ namespace {
836829 ? ss->staticEval > (ss-4 )->staticEval || (ss-4 )->staticEval == VALUE_NONE
837830 : ss->staticEval > (ss-2 )->staticEval ;
838831
839- // Step 8 . Futility pruning: child node (~50 Elo)
832+ // Step 7 . Futility pruning: child node (~50 Elo)
840833 if ( !PvNode
841834 && depth < 9
842835 && eval - futility_margin (depth, improving) >= beta
843836 && eval < VALUE_KNOWN_WIN) // Do not return unproven wins
844837 return eval;
845838
846- // Step 9 . Null move search with verification search (~40 Elo)
839+ // Step 8 . Null move search with verification search (~40 Elo)
847840 if ( !PvNode
848841 && (ss-1 )->currentMove != MOVE_NULL
849842 && (ss-1 )->statScore < 22977
@@ -895,7 +888,7 @@ namespace {
895888
896889 probCutBeta = beta + 194 - 49 * improving;
897890
898- // Step 10 . ProbCut (~10 Elo)
891+ // Step 9 . ProbCut (~10 Elo)
899892 // If we have a good enough capture and a reduced search returns a value
900893 // much above beta, we can (almost) safely prune the previous move.
901894 if ( !PvNode
@@ -968,7 +961,7 @@ namespace {
968961 ss->ttPv = ttPv;
969962 }
970963
971- // Step 11 . If the position is not in TT, decrease depth by 2
964+ // Step 10 . If the position is not in TT, decrease depth by 2
972965 if ( PvNode
973966 && depth >= 6
974967 && !ttMove)
@@ -997,7 +990,7 @@ namespace {
997990 // Mark this node as being searched
998991 ThreadHolding th (thisThread, posKey, ss->ply );
999992
1000- // Step 12 . Loop through all pseudo-legal moves until no moves remain
993+ // Step 11 . Loop through all pseudo-legal moves until no moves remain
1001994 // or a beta cutoff occurs.
1002995 while ((move = mp.next_move (moveCountPruning)) != MOVE_NONE)
1003996 {
@@ -1035,7 +1028,7 @@ namespace {
10351028 // Calculate new depth for this move
10361029 newDepth = depth - 1 ;
10371030
1038- // Step 13 . Pruning at shallow depth (~200 Elo)
1031+ // Step 12 . Pruning at shallow depth (~200 Elo)
10391032 if ( !rootNode
10401033 && pos.non_pawn_material (us)
10411034 && bestValue > VALUE_TB_LOSS_IN_MAX_PLY)
@@ -1083,7 +1076,7 @@ namespace {
10831076 }
10841077 }
10851078
1086- // Step 14 . Extensions (~75 Elo)
1079+ // Step 13 . Extensions (~75 Elo)
10871080
10881081 // Singular extension search (~70 Elo). If all moves but one fail low on a
10891082 // search of (alpha-s, beta-s), and just one fails high on (alpha, beta),
@@ -1155,10 +1148,10 @@ namespace {
11551148 [movedPiece]
11561149 [to_sq (move)];
11571150
1158- // Step 15 . Make the move
1151+ // Step 14 . Make the move
11591152 pos.do_move (move, st, givesCheck);
11601153
1161- // Step 16 . Reduced depth search (LMR, ~200 Elo). If the move fails high it will be
1154+ // Step 15 . Reduced depth search (LMR, ~200 Elo). If the move fails high it will be
11621155 // re-searched at full depth.
11631156 if ( depth >= 3
11641157 && moveCount > 1 + 2 * rootNode
@@ -1258,7 +1251,7 @@ namespace {
12581251 didLMR = false ;
12591252 }
12601253
1261- // Step 17 . Full depth search when LMR is skipped or fails high
1254+ // Step 16 . Full depth search when LMR is skipped or fails high
12621255 if (doFullDepthSearch)
12631256 {
12641257 value = -search<NonPV>(pos, ss+1 , -(alpha+1 ), -alpha, newDepth, !cutNode);
@@ -1285,12 +1278,12 @@ namespace {
12851278 std::min (maxNextDepth, newDepth), false );
12861279 }
12871280
1288- // Step 18 . Undo move
1281+ // Step 17 . Undo move
12891282 pos.undo_move (move);
12901283
12911284 assert (value > -VALUE_INFINITE && value < VALUE_INFINITE);
12921285
1293- // Step 19 . Check for a new best move
1286+ // Step 18 . Check for a new best move
12941287 // Finished searching the move. If a stop occurred, the return value of
12951288 // the search cannot be trusted, and we return immediately without
12961289 // updating best move, PV and TT.
@@ -1367,7 +1360,7 @@ namespace {
13671360 return VALUE_DRAW;
13681361 */
13691362
1370- // Step 20 . Check for mate and stalemate
1363+ // Step 19 . Check for mate and stalemate
13711364 // All legal moves have been searched and if there are no legal moves, it
13721365 // must be a mate or a stalemate. If we are in a singular extension search then
13731366 // return a fail low score.
0 commit comments