Question about item on Rebel Programming page

Discussion of chess software programming and technical issues.

Moderator: Ras

JVMerlino
Posts: 1404
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Question about item on Rebel Programming page

Post by JVMerlino »

There is one section on the (absolutely marvelous) Rebel Programming page that confuses me, either because I'm stupid or because some critical piece of information was left out.

In the section on reductions....

http://members.home.nl/matador/chess840.htm#REDUCTIONS

...it says:

Code: Select all

REDUCTION-2b : 

We are still in "Reduce_Depth", going to the next formula detecting possible reductions. Reduction 2b is only done in the last "x" plies till the horizon (remaining depth). "x" varies in REBEL, although the definition of "x" is more sophisticated in REBEL it in general comes down to:   middle game     : maximum is 8
  early end game  : maximum is 6
  end game        : maximum is 4
  late end game   : maximum is 3       // rook endings, B/N endings
  pawn ending     : maximum is 2

"x" is defined again after each iteration, table driven, its formula for the middle-game:   x = table_for_mid_game [iteration_depth];

  static char table_for_mid_game [] = { 0,1,1,1,2,2,3,3,3,4,4,5,5,6,6,7,
                                        8,8,8,8,8,8,8,8,8,8,8.... };

You get the picture for the other tables, the idea is not only to limit "x" to 8, but also to excuse the early iterations from the reductions, a safety guard. So when we are in the last "x" plies of the search we try reduction-2b,   

if (remaining_depth<=x && remaining_depth>1) then
{ 
   if (ALPHA > SCORE + THREAT &&  
         ALPHA < SCORE + THREAT + MARGIN) -> reduce depth with one ply. 
}

  SCORE  : score of EVAL
  THREAT : Queen=900, Rook=500, Bishop=300, Knight=300, Pawn=100
  MARGIN : TABLE [remaining_depth];

  static int TABLE[]= { 00,00,10,15,20,25,25,25,25,25,25,25,25,25,
                        25,25,25,25,25,25,25 ........... };

The idea is, if SCORE+THREAT are not going to make it to ALPHA, but with an extra small MARGIN it will then reduce the depth. I can't remember the speed-up this reduction gave. 
However, I don't know which possible value of "THREAT" to the equation, because it seems like it can be the value of any piece, and there is no information on which piece value to choose.

So, AM I an idiot, or is there something missing? :?

Many thanks in advance,
jm
Harald
Posts: 318
Joined: Thu Mar 09, 2006 1:07 am

Re: Question about item on Rebel Programming page

Post by Harald »

JVMerlino wrote:There is one section on the (absolutely marvelous) Rebel Programming page that confuses me, either because I'm stupid or because some critical piece of information was left out.

In the section on reductions....

http://members.home.nl/matador/chess840.htm#REDUCTIONS

...it says:

Code: Select all

REDUCTION-2b : 

We are still in "Reduce_Depth", going to the next formula detecting possible reductions. Reduction 2b is only done in the last "x" plies till the horizon (remaining depth). "x" varies in REBEL, although the definition of "x" is more sophisticated in REBEL it in general comes down to:   middle game     : maximum is 8
  early end game  : maximum is 6
  end game        : maximum is 4
  late end game   : maximum is 3       // rook endings, B/N endings
  pawn ending     : maximum is 2

"x" is defined again after each iteration, table driven, its formula for the middle-game:   x = table_for_mid_game [iteration_depth];

  static char table_for_mid_game [] = { 0,1,1,1,2,2,3,3,3,4,4,5,5,6,6,7,
                                        8,8,8,8,8,8,8,8,8,8,8.... };

You get the picture for the other tables, the idea is not only to limit "x" to 8, but also to excuse the early iterations from the reductions, a safety guard. So when we are in the last "x" plies of the search we try reduction-2b,   

if (remaining_depth<=x && remaining_depth>1) then
{ 
   if (ALPHA > SCORE + THREAT &&  
         ALPHA < SCORE + THREAT + MARGIN) -> reduce depth with one ply. 
}

  SCORE  : score of EVAL
  THREAT : Queen=900, Rook=500, Bishop=300, Knight=300, Pawn=100
  MARGIN : TABLE [remaining_depth];

  static int TABLE[]= { 00,00,10,15,20,25,25,25,25,25,25,25,25,25,
                        25,25,25,25,25,25,25 ........... };

The idea is, if SCORE+THREAT are not going to make it to ALPHA, but with an extra small MARGIN it will then reduce the depth. I can't remember the speed-up this reduction gave. 
However, I don't know which possible value of "THREAT" to the equation, because it seems like it can be the value of any piece, and there is no information on which piece value to choose.

So, AM I an idiot, or is there something missing? :?
Neither. In reduction 2a he writes:
"Reduce_Depth" does check for several cases, reduction-2a goes as follows, when the score (from EVAL!) is already below ALPHA the move (or position) is candidate to be not so good, but then it shows up that the position has a direct threat, for instance it attacks the opponents queen (value 900) which would bring the score above ALPHA, then maybe the move is not so bad after all.
I think the THREAT is the maximum of all possible captures, probably not
looking at re-captures and other problems. To find out if it is before or
after the move in the current last or next position, I leave as exercise for
the student.

Harald