@Override
	public int eval(int player, int alpha, int beta, int depth, int nt, int stackIndex, State4 s) {

		StackFrame frame = stack[stackIndex];

		if(nt != SearchContext.NODE_TYPE_PV &&
				depth <= 3 * Search34.ONE_PLY &&
				!frame.pawnPrePromotion &&
				!frame.alliedKingAttacked &&
				frame.hasNonPawnMaterial &&
				//c.futilityPrune &&
				frame.nonMateScore){

			final int futilityMargin;
			if(depth <= 1 * Search34.ONE_PLY){
				futilityMargin = 250;
			} else if(depth <= 2 * Search34.ONE_PLY){
				futilityMargin = 300;
			} else { //depth <= 3*ONE_PLY
				futilityMargin = 425;
			}

			final int futilityScore = frame.eval - futilityMargin;

			if(futilityScore >= beta){
				return futilityScore;
			}
		}

		return next.eval(player, alpha, beta, depth, nt, stackIndex, s);
	}