A question about the code as you posted. I'm not sure I understand it.
Since margin = previous_full_eval - i_score +50, surely
i_score + margin = previous_full_eval + 50?
Then it does not matter how good the move appears to be by lazy eval. For example the move captures a queen. i_score goes up by a queen, but the margin will become negative. Or am I missing something?
Wouldn't previous_full_eval go up by a queen as well in this case, from one node to its successor?
Since supposedly ApproxEval(node) is much more accurate than QuickEval(node) it can be used with a much smaller margin.
If I ever have time maybe I'll experiment with this in GNU Chess. GNU Chess has a crappy LE but unfortunately ripping it out completely gives substantial Elo loss. I do not understand why exactly.
I get it now. It is similar with Toga - the lazy eval is really bad (as Lucas pointed out), but ripping it out causes a significant elo loss. I'm wondering why too.
You are at RD <=0 depths and you have to decide whether to do a full eval or just a quick lazy one.
What you want to know is: when doing a full eval at this point can the current_material score + safety_margin (LE) bring the value above ALPHA or not. If not return material score + safety_margin, else full eval.
That's the basic idea.
And it's full of dangers when the safety_margin is small (say 0.50) or not effective when the safety_margin is large (say 5.00).
And yet there is an easy solution. I am using 0.50 myself and can do that because I keep track of the difference between material_score and the eval_score of RD+1. And that value is simply added to current_material score (the green above) when doing LE and thus overcoming the problems with large eval scores.
Think about the logic behind, basically you are saying: 0.50 is a reasonable compromise the evaluation will increase compared to the previous one (RD+1).
========
The thing I have how LE is described on the CPW is involving BETA as well. I recently I have tried it anyway and as expected it did not work. It may differ from engine to engine and the search techniques involved but doing BETA-LE is asking for researches.
You assume that your evaluation cannot improve more than 0.50 positional within 1 move.
In Diep that is not the case. It happens regurarly that moving a knight from a6 to c5 into the game suddenly makes the evaluation realize that black has a mighty position. Center control kicks in. Mobility suddenly is great.
Pressure onto the kingsafety possible (if white castled long) and so on.
That can easily jump up the score 2 pawns there. From say -1.5 to +0.5 (from blacks viewpoint seen).
You'd lazy eval that as <= alfa instead of >= beta
And this is just a simple normal development move. We didn't discuss the more extreme cases yet...
You are at RD <=0 depths and you have to decide whether to do a full eval or just a quick lazy one.
What you want to know is: when doing a full eval at this point can the current_material score + safety_margin (LE) bring the value above ALPHA or not. If not return material score + safety_margin, else full eval.
That's the basic idea.
And it's full of dangers when the safety_margin is small (say 0.50) or not effective when the safety_margin is large (say 5.00).
And yet there is an easy solution. I am using 0.50 myself and can do that because I keep track of the difference between material_score and the eval_score of RD+1. And that value is simply added to current_material score (the green above) when doing LE and thus overcoming the problems with large eval scores.
Think about the logic behind, basically you are saying: 0.50 is a reasonable compromise the evaluation will increase compared to the previous one (RD+1).
========
The thing I have how LE is described on the CPW is involving BETA as well. I recently I have tried it anyway and as expected it did not work. It may differ from engine to engine and the search techniques involved but doing BETA-LE is asking for researches.
You assume that your evaluation cannot improve more than 0.50 positional within 1 move.
Look what I have said, the green above.
In Diep that is not the case. It happens regurarly that moving a knight from a6 to c5 into the game suddenly makes the evaluation realize that black has a mighty position. Center control kicks in. Mobility suddenly is great.
Pressure onto the kingsafety possible (if white castled long) and so on.
That can easily jump up the score 2 pawns there. From say -1.5 to +0.5 (from blacks viewpoint seen).
Same here.
But because we are using the eval of the parent (RD+1) the danger of LE is limited to only new cases since we are at RD<=0 The real danger of LE lies in the big eval scores of the parents at RD>0.
For the record, RD=remaining depth.
You'd lazy eval that as <= alfa instead of >= beta
And this is just a simple normal development move. We didn't discuss the more extreme cases yet...