Page 1 of 1

A question about futility prunning

Posted: Thu Jul 26, 2018 3:05 pm
by xr_a_y
In stockfish, there is a

Code: Select all

if (futilityValue < beta)
inside the move loop.

I have some difficulty to understand why futility is verified against beta and not alpha. Wiki says
in its pure form implemented at the frontier nodes (depth == 1) with one ply left to the horizon. It discards the moves that have no potential of raising alpha, which in turn requires some estimate of a potential value of a move.

Re: A question about futility prunning

Posted: Thu Jul 26, 2018 4:00 pm
by jorose
Could you give a link to the source you are referring to? I can't find it in the current source: https://github.com/official-stockfish/S ... search.cpp. I'm not an expert on this topic, but maybe previously SF restricted futility pruning to Null Window searches? In that case futilityValue <= alpha would be the same as futilityValue < beta. Otherwise it doesn't make sense for me either.

Re: A question about futility prunning

Posted: Thu Jul 26, 2018 4:11 pm
by xr_a_y
jorose wrote: Thu Jul 26, 2018 4:00 pm Could you give a link to the source you are referring to? I can't find it in the current source: https://github.com/official-stockfish/S ... search.cpp. I'm not an expert on this topic, but maybe previously SF restricted futility pruning to Null Window searches? In that case futilityValue <= alpha would be the same as futilityValue < beta. Otherwise it doesn't make sense for me either.
You are right, and is was in an old source.

https://github.com/kobolabs/stockfish/b ... h.cpp#L921

Re: A question about futility prunning

Posted: Thu Jul 26, 2018 4:16 pm
by Sven
xr_a_y wrote: Thu Jul 26, 2018 3:05 pm In stockfish, there is a

Code: Select all

if (futilityValue < beta)
inside the move loop.

I have some difficulty to understand why futility is verified against beta and not alpha. Wiki says
in its pure form implemented at the frontier nodes (depth == 1) with one ply left to the horizon. It discards the moves that have no potential of raising alpha, which in turn requires some estimate of a potential value of a move.
SF9, SF8, SF7 and most probably many older SF versions compare "if (futilityValue <= alpha)" in qsearch(), and have a more complex expression (but essentially with the same semantics) in full-width search. So I'm not sure where you found this. Only in non-PV nodes the condition alpha == beta-1 holds but FP is not necessarily restricted to non-PV nodes.

Re: A question about futility prunning

Posted: Thu Jul 26, 2018 4:23 pm
by Sven
xr_a_y wrote: Thu Jul 26, 2018 4:11 pm
jorose wrote: Thu Jul 26, 2018 4:00 pm Could you give a link to the source you are referring to? I can't find it in the current source: https://github.com/official-stockfish/S ... search.cpp. I'm not an expert on this topic, but maybe previously SF restricted futility pruning to Null Window searches? In that case futilityValue <= alpha would be the same as futilityValue < beta. Otherwise it doesn't make sense for me either.
You are right, and is was in an old source.

https://github.com/kobolabs/stockfish/b ... h.cpp#L921
Not just an "old source" but something from a non-official place, with just one "initial commit" from 2013 and nothing else, so I wonder how G**gle took you there :D

Re: A question about futility prunning

Posted: Thu Jul 26, 2018 4:25 pm
by xr_a_y
Sven wrote: Thu Jul 26, 2018 4:23 pm Not just an "old source" but something from a non-official place, with just one "initial commit" from 2013 and nothing else, so I wonder how G**gle took you there :D
Yeah me too, and how I didn't realize sooner I was reading a strange source ...