After tons of games played I think I got LMR now stable.
Next step: futility pruning.
First step is reading http://chessprogramming.wikispaces.com/Futility+Pruning. As we in the Netherlands say: I cannot make cheese of it.
So in the top of my search() I call score = evalute() and check if score + some_value < alpha.Futility Pruning in its pure form is implemented at the frontier nodes (depth == 1). It discards the moves that have no potential of raising alpha, which in turn requires some estimate of a potential value of a move. This is calculated by adding a futility margin (representing the largest conceivable positional gain) to the evaluation of the current position.
Ok now what? I set a flag, but what should I do then? Return alpha?If this does not exceed alpha then the futility pruning is triggered (which usually means setting a flag like f_prune = 1).
... or should I then only play capture moves and check-giving-moves and if that gives to play return alpha?For tactical stability, even in such a node we ought to search the following moves:
captures (either all or less typically only those that are capable of raising the score above alpha + margin)
moves that give check
Next question: determing if a move gives check. I think that is a makeMove(), then generate a list of moves, validate which ones are correct and then see if the opponent is in check state. This feels expensive? Or are here smarter ways of finding if a move gives check?