Razoring / Lazy eval question

Discussion of chess software programming and technical issues.

Moderator: Ras

Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Razoring / Lazy eval question

Post by Sven »

jd1 wrote:Hi Matthew,

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?

Sven
Michel
Posts: 2292
Joined: Mon Sep 29, 2008 1:50 am

Re: Razoring / Lazy eval question

Post by Michel »

Ok,

Here is how I understand it.

Pruning at a node is done using lazy eval with a margin depending among other things on the full eval of the parent.

If there are non-pruned moves and the node needs to be expanded then a full eval is done. This is then used for the margins in the children etc...
Michel
Posts: 2292
Joined: Mon Sep 29, 2008 1:50 am

Re: Razoring / Lazy eval question

Post by Michel »

This seems to be logically equivalent to the following:

There are two functions

QuickEval(node) (Material+PST)
FullEval(node)

An approximate Eval for the current node can be computed as follows

ApproxEval(node)=FullEval(parent)-QuickEval(parent)+QuickEval(node)

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.
jd1
Posts: 269
Joined: Wed Oct 24, 2012 2:07 am

Re: Razoring / Lazy eval question

Post by jd1 »

Thanks Michel and Sven,

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.

Jerry
jd1
Posts: 269
Joined: Wed Oct 24, 2012 2:07 am

Re: Razoring / Lazy eval question

Post by jd1 »

Thanks Ed. So what I what missing was that one QuickEval (or i_score) value is from one ply back.

Jerry
diep
Posts: 1822
Joined: Thu Mar 09, 2006 11:54 pm
Location: The Netherlands

Re: Razoring / Lazy eval question

Post by diep »

Rebel wrote:One more time :wink:

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...
User avatar
Rebel
Posts: 7297
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: Razoring / Lazy eval question

Post by Rebel »

diep wrote:
Rebel wrote:One more time :wink:

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...