Razoring

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Razoring

Post by bob »

Rebel wrote:
bob wrote:At ply=10 I can make a "razoring decision" move by move, by either searching a move normally, or going directly to q-search. OR, at ply=11, I can razor the entire node produced by one or more of the moves at the previous ply by dropping directly to q-search. Those are identical. Only difference is, the former did not do the unnecessary call to search, only to have it immediately call q-search.
We all understand (futility) pruning and reductions.

So then, what is razoring?
A "limited reduction". Namely, limited to the last few plies (3 at most depending on the version. As I said, I do not consider myself to be doing "razoring" any longer. I forward-prune in the last 4 plies, and I reduce everywhere. I think this term could be "retired". Hence no reference to that term in my source code, other than in the comments in main.c that reflect when razoring was first added, before it was subsumed by reductions.
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: Razoring

Post by Michel »

Rebel wrote:
So then, what is razoring?
If you read the prior posts you'll see that your question has already been answered multiple times. The thread is about razoring as implemented by Stockfish (as introduced by Tord). Not about razoring as introduced by Heinz.
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Razoring

Post by Sven »

Michel wrote:
Rebel wrote:
So then, what is razoring?
If you read the prior posts you'll see that your question has already been answered multiple times. The thread is about razoring as implemented by Stockfish (as introduced by Tord). Not about razoring as introduced by Heinz.
But the current subthread is also about Bob's claim that both were essentially the same, which both Ed and myself doubt, and presumably also Marco and you.

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

Re: Razoring

Post by Michel »

Sven Schüle wrote:
Michel wrote:
Rebel wrote:

But the current subthread is also about Bob's claim that both were essentially the same, which both Ed and myself doubt, and presumably also Marco and you.

Sven
I think they are different. Anyway I think we should discuss the Stockfish implementation since that was how the thread opened.

Something else that is not clear in my mind is the following. Perhaps Marco can answer.

In a node that satisfies the razoring condition all moves will presumably
be futility pruned anyway. So what is exactly the saving one expects
from razoring? The fact that one does not generate quiet moves?
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Razoring

Post by Sven »

bob wrote:At ply=10 I can make a "razoring decision" move by move, by either searching a move normally, or going directly to q-search. OR, at ply=11, I can razor the entire node produced by one or more of the moves at the previous ply by dropping directly to q-search. Those are identical. Only difference is, the former did not do the unnecessary call to search, only to have it immediately call q-search.
Those are not identical, Bob.

Whatever you do with one of the moves at ply=10: pruning, reducing, dropping into q-search, you name it, is some kind of reducing the subtree size of a presumably bad move. If you instead call search() on that move then the resulting node at ply=11 is not one that you would razor, prune or whatever, since that node is now presumably going to produce a fail HIGH from the opponent's viewpoint, by one of his moves producing a beta cutoff. (That is also the reason why your point about dropping into q-search on a move-by-move basis at ply=10 is completely wrong: a q-search for a bad move can only confirm, from the opponent's viewpoint, that it was bad since the opponent can presumably win material, but at least does not lose material as a result of the q-search due to "stand pat". The "dropping into q-search" as introduced by Tord is applied to bad positions, i.e. at the node level, not to "bad moves" which would be useless.)

The razoring, pruning, or other kind of subtree size reduction of a move at ply=10 is therefore based on the prediction that the corresponding child node will fail high anyway.

Now that subtree size reduction for some moves at ply=10 typically appears if the position itself at ply=10 is already quite bad so that many moves will be affected. Razoring according to Heinz, combined with his extended futility pruning, does this:
Ernst A. Heinz wrote:Thence, the overall effect of limited razoring at pre-pre-frontier nodes is to cut off quiet moves and non-checking captures with insufficient material gains and a remaining depth of 3 plies while reducing the search depth of all other moves by 1 ply if the side-to-move suffers from a severe disadvantage.
I can imagine that the basic idea of razoring as introduced by Tord (Glaurung/Stockfish) could be to replace the Heinz-like "reduction by 1 ply" for all checks and all non-checking captures with *sufficient* material gains by even more of a reduction through dropping into q-search for the whole node, which covers almost exactly to search only those moves (checks + good captures) but with a much smaller tree size. By doing so you try to verify that the moving side which is in a bad situation has no obvious tactical shot. But this is an entirely different idea than the Heinz-like razoring + extended futility pruning, and may include more of a risk.

I hope that we can agree on that so far.

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

Re: Razoring

Post by Sven »

Michel wrote:
Sven Schüle wrote:But the current subthread is also about Bob's claim that both were essentially the same, which both Ed and myself doubt, and presumably also Marco and you.

Sven
I think they are different. Anyway I think we should discuss the Stockfish implementation since that was how the thread opened.

Something else that is not clear in my mind is the following. Perhaps Marco can answer.

In a node that satisfies the razoring condition all moves will presumably
be futility pruned anyway. So what is exactly the saving one expects
from razoring? The fact that one does not generate quiet moves?
The answer to your question from my viewpoint is part of my reply to Bob from a couple of minutes ago, near the end of my posting.

Note that not "all moves will presumably be futility pruned away", this applies to quiet moves and non-checking "bad captures" only.

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

Re: Razoring

Post by Michel »

Sven Schüle wrote:
Note that not "all moves will presumably be futility pruned away", this applies to quiet moves and non-checking "bad captures" only.

Sven
Well the ones that might not be futility pruned are the good captures (perhaps because there is a queen hanging).
These are precisely the moves that are searched during quiescence search....
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Razoring

Post by Sven »

Michel wrote:
Sven Schüle wrote:
Note that not "all moves will presumably be futility pruned away", this applies to quiet moves and non-checking "bad captures" only.

Sven
Well the ones that might not be futility pruned are the good captures (perhaps because there is a queen hanging).
These are precisely the moves that are searched during quiescence search....
Yes, plus checks, that's exactly what I wrote. The razoring approach discussed here that drops into q-search would not work correctly if the q-search would not include checks at the first ply.

Sven
User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Re: Razoring

Post by Rebel »

Michel wrote:
Rebel wrote:
So then, what is razoring?
If you read the prior posts you'll see that your question has already been answered multiple times. The thread is about razoring as implemented by Stockfish (as introduced by Tord). Not about razoring as introduced by Heinz.
I can read, the question was to Bob.
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: Razoring

Post by Michel »

I can read, the question was to Bob.
But even so it is clear from his postings that Bob uses the term in the sense of Heinz. So there is no ambiguity there either.