abs(beta)<VALUE_MATE_IN_PLY_MAX

Discussion of chess software programming and technical issues.

Moderator: Ras

Pierre Bokma
Posts: 31
Joined: Tue Dec 07, 2010 11:19 pm
Location: Holland

abs(beta)<VALUE_MATE_IN_PLY_MAX

Post by Pierre Bokma »

In stockfish the condition:

abs(beta)<VALUE_MATE_IN_PLY_MAX

is used as a criteria to do static null move pruning, null move search, razoring etc.

If this condition is not met these techniques are skipped.

I find it hard to understand what it means. If i see it correctly it means that these methodes should be skipped if the opponent has a mate in another branche of the tree.

can anybody please explain this condition?

Thanks in advance
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: abs(beta)<VALUE_MATE_IN_PLY_MAX

Post by mcostalba »

Pierre Bokma wrote: can anybody please explain this condition?
It means that the pruning is not done in position in which side to move can give mate (beta >= VALUE_MATE_IN_PLY_MAX) or can receive mate (beta <= -VALUE_MATE_IN_PLY_MAX).
zamar
Posts: 613
Joined: Sun Jan 18, 2009 7:03 am

Re: abs(beta)<VALUE_MATE_IN_PLY_MAX

Post by zamar »

1) Mate scores returned from null move are not reliable (zugzwang issues), so we ignore them. If all scores, which could cause a fail high, are mate scores, there is no point in doing null move search.

Other way around, doing null move is not a reliable way to escape mate (again zugzwang issues).

2) Razoring makes use of newvalue : = value +- delta. When value is a mate score, "+- delta" doesn't make sense and could cause newvalue go out of bounds.
Joona Kiiski
Pierre Bokma
Posts: 31
Joined: Tue Dec 07, 2010 11:19 pm
Location: Holland

Re: abs(beta)<VALUE_MATE_IN_PLY_MAX

Post by Pierre Bokma »

Thanks Joona for this answer can you please clearify what you explained? I am going through the stockfish code and i am learning all the time
zamar
Posts: 613
Joined: Sun Jan 18, 2009 7:03 am

Re: abs(beta)<VALUE_MATE_IN_PLY_MAX

Post by zamar »

Pierre Bokma wrote:Thanks Joona for this answer can you please clearify what you explained?
Sorry, maybe I explained badly, but I don't think that I would be able to give any better explanation.
I am going through the stockfish code and i am learning all the time
Keep it going. Sooner or later it will make sense. And as your knowledge goes, you'll be able to ask more detailed questions.
Joona Kiiski
User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

Re: abs(beta)<VALUE_MATE_IN_PLY_MAX

Post by Desperado »

Hello Pierre,

without any context to Stockfishs code i would interprete a condition like

abs(beta)<VALUE_MATE_IN_PLY_MAX

in the following way.


A: values
===============

values are defined in most cases like this:

eg: range of all values: [-30000 ,to 30000] or any other bounds like
so: range of all values: [-bound ,to bound]

B: mate values
===============

b1)
===

now think of your search which has a max ply to go (eg: 256 plies).
then the mate values are

[-bound+256](eg:[-29744]) get mated in max (the search cannot deliver a higher mate)
[ bound-256](eg:[ 29744]) mating in max (the search cannot deliver a higher mate)

now the condition again: i guess that is a condition from a nullwindow where alpha==beta-1


b2) in words
=========

if(beta > -29744) cannot be mated (this is normally a check against alpha,but alpha==beta-1 i guess)

if(beta < 29744) cannot mate

b3) in code
========

if(beta > -29744 && beta < 29744)

it becomes

if(absN(beta) < 29744)

Hope it helps a bit...

Michael