Your question about the search depth dropping from 16 to 12 has already been answered: yes, it is normal, considering the jump in eval quality from "material only" to "material + PST". I can't say much about your move ordering. You use MVV/LVA, it seems you do not use the TT hash for move ordering yet, but since your effective branching factor does not look too bad I would assume that you do not have a move ordering problem at the moment.Daniel Anulliero wrote:Please look at my code and give your advice about my PV / LMR and NUlmove method.
Also : do you think if it is normal the search drop from depth 16 to 12 when just adding pst ?
Or my move ordering is may be bad ?
So far PV handling looks normal to me. Your short PVs are not unusual, they probably result from using the TT hash so almost everyone suffers from it. If you reach a position P for the first time and you do a regular tree search you get back a (local) PV. Maybe later it turns out that P and its local PV become part of the root PV. Now after a while (within the same iteration at root) you reach again P through a transposition and your hash table allows to avoid another tree search, returning a score from TT instead. But the former local PV of P is lost in the meantime. For some reason the new path to P becomes your new root PV but now it ends at P already and is shorter than the current search depth at root.
There might as well be other similar reasons for getting short PVs. A possible way to avoid most of them is to maintain a small PV hash table, a concept of which I know that it has been applied successfully by Bob Hyatt at least.
What I found in the code you posted is that you apply the check extension after having tested for depth <= 0. This means that you do a normal qsearch even in a depth=0 position where your king is currently in check. You might get in trouble that way, at least iteration N will usually not find a mate in N plies. I suggest to check for depth <= 0 after possibly applying a check extension.