Razoring

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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

Re: Razoring

Post by Sven »

lucasart wrote:I was more hoping for a discussion on the *actual* topic... If anyone has done some actual testing and has something useful to say on this problem, feel free...

So let's just call it razoring i/o Hyatt razoring, and avoid these discussions about who invented the wheel and who first called it a wheel...
The code snippet published by Bob back in 2008 might indeed have been based on an idea by Tord but initially that was not perfectly clear to me when reading that old thread for the first time.

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

Re: Razoring

Post by bob »

mcostalba wrote:
lucasart wrote: the thread I mentionned suggests that it was Tord's idea in Glaurung in the first place.
Yes it is a Tord's idea.

Perhaps now Bob says that in the 70' he tried already this in an experimental Cray computer in assembly, but it doesn't matter.....it is a Tord's idea.
Razoring came from Kent so far as I know. The specific details mentioned were done in crafty, in what I later decided was an "incorrect solution". It first appeared in 1997 and was used right after the Jakarta WCCC. Details are in main.c and mention Kent in version 11.10
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:
mcostalba wrote:
lucasart wrote: the thread I mentionned suggests that it was Tord's idea in Glaurung in the first place.
Yes it is a Tord's idea.

Perhaps now Bob says that in the 70' he tried already this in an experimental Cray computer in assembly, but it doesn't matter.....it is a Tord's idea.
Razoring came from Kent so far as I know. The specific details mentioned were done in crafty, in what I later decided was an "incorrect solution". It first appeared in 1997 and was used right after the Jakarta WCCC. Details are in main.c and mention Kent in version 11.10
I think the point was whether this snippet:

Code: Select all

/*
 ************************************************************
 *                                                          *
 *   now we try a quick Razoring test.  If we are within 3  *
 *   plies of a tip, and the current eval is 3 pawns (or    *
 *   more) below beta, then we just drop into a q-search    *
 *   to try to get a quick cutoff without searching more in *
 *   a position where we are way down in material.          *
 *                                                          *
 ************************************************************
 */
   if &#40;razoring_allowed && depth <= razor_depth&#41; &#123;
    if &#40;alpha == beta - 1&#41; &#123;
      if &#40;Evaluate&#40;tree, ply, wtm, alpha, beta&#41; + razor_margin < beta&#41; &#123;
        value = QuiesceChecks&#40;tree, alpha, beta, wtm, ply&#41;;
        if &#40;value < beta&#41;
          return &#40;value&#41;;
      &#125;
    &#125;
  &#125;
published by you in this thread from 2008 originated in a specific razoring idea by Tord which you retried in your cluster testing and rejected again (EDIT: for Crafty). After rereading your posts from back then that seems to be case. Just say "yes", please, so Lucas can finally return to the actual topic :-)

Sven
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Razoring

Post by lucasart »

mcostalba wrote:
lucasart wrote: the thread I mentionned suggests that it was Tord's idea in Glaurung in the first place.
Yes it is a Tord's idea.

Perhaps now Bob says that in the 70' he tried already this in an experimental Cray computer in assembly, but it doesn't matter.....it is a Tord's idea.
Please, Marco, don't start a flame war here... You know how it starts, and you know it never ends ;)
I just want this thread to focus on the actual tpoic. I'm currently testing many variations on the idea of razoring in my engine.
ZirconiumX
Posts: 1334
Joined: Sun Jul 17, 2011 11:14 am

Re: Razoring

Post by ZirconiumX »

My engine Magic used Razoring, which was incredibly efficent!

Look at how it takes effect in 168 nodes in a 1.5M node search! Gaze in stark amazement at how useless you feel! Type frantically as you try to figure out the problem! Wonder about how other engines manage to get it to work!

Yours for just a 150 ELO reduction in strength (That bad), and a lot of frustration!

Matthew:out

In the first statement I was referring to my engine, not Razoring(which is s***).
Some believe in the almighty dollar.

I believe in the almighty printf statement.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Razoring

Post by lucasart »

ZirconiumX wrote:My engine Magic used Razoring, which was incredibly efficent!

Look at how it takes effect in 168 nodes in a 1.5M node search! Gaze in stark amazement at how useless you feel! Type frantically as you try to figure out the problem! Wonder about how other engines manage to get it to work!

Yours for just a 150 ELO reduction in strength (That bad), and a lot of frustration!

Matthew:out

In the first statement I was referring to my engine, not Razoring(which is s***).
Razoring is certainly not worth 150 elo. If it was in your program, then something was very wrong somewhere else. As explained by Robert Hyatt in the thread from 2008, Razoring improves very little because of the presence of LMR.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Razoring

Post by bob »

Sven Schüle wrote:
bob wrote:
mcostalba wrote:
lucasart wrote: the thread I mentionned suggests that it was Tord's idea in Glaurung in the first place.
Yes it is a Tord's idea.

Perhaps now Bob says that in the 70' he tried already this in an experimental Cray computer in assembly, but it doesn't matter.....it is a Tord's idea.
Razoring came from Kent so far as I know. The specific details mentioned were done in crafty, in what I later decided was an "incorrect solution". It first appeared in 1997 and was used right after the Jakarta WCCC. Details are in main.c and mention Kent in version 11.10
I think the point was whether this snippet:

Code: Select all

/*
 ************************************************************
 *                                                          *
 *   now we try a quick Razoring test.  If we are within 3  *
 *   plies of a tip, and the current eval is 3 pawns &#40;or    *
 *   more&#41; below beta, then we just drop into a q-search    *
 *   to try to get a quick cutoff without searching more in *
 *   a position where we are way down in material.          *
 *                                                          *
 ************************************************************
 */
   if &#40;razoring_allowed && depth <= razor_depth&#41; &#123;
    if &#40;alpha == beta - 1&#41; &#123;
      if &#40;Evaluate&#40;tree, ply, wtm, alpha, beta&#41; + razor_margin < beta&#41; &#123;
        value = QuiesceChecks&#40;tree, alpha, beta, wtm, ply&#41;;
        if &#40;value < beta&#41;
          return &#40;value&#41;;
      &#125;
    &#125;
  &#125;
published by you in this thread from 2008 originated in a specific razoring idea by Tord which you retried in your cluster testing and rejected again (EDIT: for Crafty). After rereading your posts from back then that seems to be case. Just say "yes", please, so Lucas can finally return to the actual topic :-)

Sven
That didn't come from Tord. That came from Heinz' book "Scalable search ...". I tried several variations and the difference between pruning (throwing it away) and razoring (dropping into qsearch rather than pruning) was something I tried and used for a while. I no longer do razoring... Experimenting more with it is on my long to-do list, however.

I re-tested that again when Tord mentioned he was using it, but if you want some geneologie, I first read about Razoring in the JICCA, from Kent. Then my interest was piqued again by Heinz' book. Razoring was certainly not my idea. Perhaps what I ended up with was a different "take" on it, I don't remember. Just as I ended up with a different "history update" approach over that used by Schaeffer and then Fabien in Fruit... Same "history concept". Totally different way of updating the history counters... Hard to say what name should go with what nowadays since an original idea can be developed in so many different directions at the same time.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Razoring

Post by bob »

lucasart wrote:
ZirconiumX wrote:My engine Magic used Razoring, which was incredibly efficent!

Look at how it takes effect in 168 nodes in a 1.5M node search! Gaze in stark amazement at how useless you feel! Type frantically as you try to figure out the problem! Wonder about how other engines manage to get it to work!

Yours for just a 150 ELO reduction in strength (That bad), and a lot of frustration!

Matthew:out

In the first statement I was referring to my engine, not Razoring(which is s***).
Razoring is certainly not worth 150 elo. If it was in your program, then something was very wrong somewhere else. As explained by Robert Hyatt in the thread from 2008, Razoring improves very little because of the presence of LMR.
I believe he said it LOST 150 Elo for him. I didn't see that at all, but when I changed from razoring to outright forward pruning there was a significant gain.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Razoring

Post by bob »

Sven Schüle wrote:
lucasart wrote:I was more hoping for a discussion on the *actual* topic... If anyone has done some actual testing and has something useful to say on this problem, feel free...

So let's just call it razoring i/o Hyatt razoring, and avoid these discussions about who invented the wheel and who first called it a wheel...
The code snippet published by Bob back in 2008 might indeed have been based on an idea by Tord but initially that was not perfectly clear to me when reading that old thread for the first time.

Sven
As mentioned previously, this idea belongs to "Kent and Birmingham" as published in the JICCA. Razoring is simply a less speculative variation of forward pruning, where you at least leave the q-search to possibly expose errors the razoring might introduce...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Razoring

Post by bob »

bob wrote:
Gerd Isenberg wrote:
bob wrote: Where does that "hyatt code" come from? It does not appear to look anything like the code in recent Crafty versions... I don't do "razoring" at all. I prune or reduce...
I coined Hyatt's Razoring in cpw, because you proposed it as mentioned by Lucas. Should I credit somebody else?
No, that was what I did a good while back. I thought he was looking at Crafty source, which doesn't do razoring any longer, resorting on actual forward pruning instead...
Actually, in retrospect, we might be talking about a "bug" rather than an "idea". Razoring was originally applied to the last ply of the search that was "razored away" and dropped into the q-search. When I did the Heinz futility pruning, and extended futility pruning, where he pruned on the last two plies, I played with going to the last 3-4-5 plies. But rather than pruning, I was unintentionally razoring instead, just dropping into the q-search... Unintentional. I later fixed that when we had a CCC discussion and I had re-read the Scalable Search dissertation and then noticed the error...