@@ -102,7 +102,7 @@ private void StorePVinTT(Move[] pv, int depth)
102102
103103 //moves after the PV node are unlikely to raise alpha. skip those that appear clearly futile!
104104 int futilityMargin = ( int ) color * depth * MAX_GAIN_PER_PLY ;
105- if ( expandedNodes > 1 && depth <= 4 && ! isChecked && ! window . Inside ( child . Score + futilityMargin , color ) && ! child . IsChecked ( child . SideToMove ) )
105+ if ( expandedNodes > 1 && depth <= 4 && ! isChecked && window . FailLow ( child . Score + futilityMargin , color ) && ! child . IsChecked ( child . SideToMove ) )
106106 continue ;
107107
108108 //moves after the PV node are unlikely to raise alpha. searching with a null-sized window can save a lot of nodes
@@ -111,26 +111,26 @@ private void StorePVinTT(Move[] pv, int depth)
111111 //we can save a lot of nodes by searching with "null window" first, proving cheaply that the score is below alpha...
112112 SearchWindow nullWindow = window . GetLowerBound ( color ) ;
113113 var nullResult = EvalPositionTT ( child , depth - 1 , nullWindow ) ;
114- if ( ! nullWindow . Inside ( nullResult . Score , color ) )
114+ if ( nullWindow . FailLow ( nullResult . Score , color ) )
115115 continue ;
116116 }
117117
118118 //this node may raise alpha!
119119 var eval = EvalPositionTT ( child , depth - 1 , window ) ;
120- if ( window . Inside ( eval . Score , color ) )
120+ if ( window . FailLow ( eval . Score , color ) )
121+ continue ;
122+
123+ Transpositions . Store ( position . ZobristHash , depth , window , eval . Score , move ) ;
124+ //store the PV beginning with move, followed by the PV of the childnode
125+ pv = Merge ( move , eval . PV ) ;
126+ //...and maybe get a beta cutoff
127+ if ( window . Cut ( eval . Score , color ) )
121128 {
122- Transpositions . Store ( position . ZobristHash , depth , window , eval . Score , move ) ;
123- //store the PV beginning with move, followed by the PV of the childnode
124- pv = Merge ( move , eval . PV ) ;
125- //...and maybe get a beta cutoff
126- if ( window . Cut ( eval . Score , color ) )
127- {
128- //we remember killers like hat!
129- if ( position [ move . ToSquare ] == Piece . None )
130- _killers . Add ( move , depth ) ;
131-
132- return ( window . GetScore ( color ) , pv ) ;
133- }
129+ //we remember killers like hat!
130+ if ( position [ move . ToSquare ] == Piece . None )
131+ _killers . Add ( move , depth ) ;
132+
133+ return ( window . GetScore ( color ) , pv ) ;
134134 }
135135 }
136136
0 commit comments