how does Fail-Soft work ?
Moderator: Ras
-
MahmoudUthman
- Posts: 237
- Joined: Sat Jan 17, 2015 11:54 pm
how does Fail-Soft work ?
Right now I have a basic understanding of alpha beta pruning , but I can't understand why does a fail soft perform better than a fail hard one and how does it do that ?
-
kbhearn
- Posts: 411
- Joined: Thu Dec 30, 2010 4:48 am
Re: how does Fail-Soft work ?
it doesn't necessarily perform better in a modern framework but here's the gist:
in a conventional alpha beta search when you fail high/low at a node you can take the actual score found instead of beta (or best score found instead of alpha) and return that, and that bound can be propagated through the tree and stored in the TT along the way. Then if you at some point revisit the node with a lower alpha or higher beta your previous result may still be usable.
Why it may not perform better:
1) the likelihood of needing the more specific bounds info is pretty low, especially once you move to PVS where the vast majority of searching will happen with an identical null window. However in a vanilla alpha beta search, fail soft is free anyways and the extra information is safe so there's not really a reason not to in that case but...
2) in a modern search, some pruning and reduction decisions are made based on the bounds, if they've moved much your retrieved more specific bound may not actually have held if it were researched with a closer bound because a different tree would be searched. Thus there's some degree of risk in recording a fail soft result and testing would be needed to know whether it's in general helping or hurting your engine.
Where it would be important:
if you're running MTD(f), fail soft is crucial to allow you to zero in on the true evaluation faster while avoiding researching lines you should already know are fine with the new bounds.
in a conventional alpha beta search when you fail high/low at a node you can take the actual score found instead of beta (or best score found instead of alpha) and return that, and that bound can be propagated through the tree and stored in the TT along the way. Then if you at some point revisit the node with a lower alpha or higher beta your previous result may still be usable.
Why it may not perform better:
1) the likelihood of needing the more specific bounds info is pretty low, especially once you move to PVS where the vast majority of searching will happen with an identical null window. However in a vanilla alpha beta search, fail soft is free anyways and the extra information is safe so there's not really a reason not to in that case but...
2) in a modern search, some pruning and reduction decisions are made based on the bounds, if they've moved much your retrieved more specific bound may not actually have held if it were researched with a closer bound because a different tree would be searched. Thus there's some degree of risk in recording a fail soft result and testing would be needed to know whether it's in general helping or hurting your engine.
Where it would be important:
if you're running MTD(f), fail soft is crucial to allow you to zero in on the true evaluation faster while avoiding researching lines you should already know are fine with the new bounds.
-
hgm
- Posts: 28458
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: how does Fail-Soft work ?
I don't understand the second point. It sounds like this should only happen with incorrect implementation of the pruning / reduction.
-
kbhearn
- Posts: 411
- Joined: Thu Dec 30, 2010 4:48 am
Re: how does Fail-Soft work ?
Well let's start with a simple case that could be adjusted for, static null move.
In this case fail soft of depth < N & static eval > beta + margin should be returned as static eval - margin and it'd be fine.
But now what if it was a reduction based on the bounds. Say an R value for NMP that's dependant on the value of (static eval - beta). Since it's a child tree that's being modified should you really conclude anything more than failing hard? You'd have to test.
In this case fail soft of depth < N & static eval > beta + margin should be returned as static eval - margin and it'd be fine.
But now what if it was a reduction based on the bounds. Say an R value for NMP that's dependant on the value of (static eval - beta). Since it's a child tree that's being modified should you really conclude anything more than failing hard? You'd have to test.
-
hgm
- Posts: 28458
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: how does Fail-Soft work ?
I don't see any problem if in the latter case you also return min(static_eval - margin, null_move_score). Where 'margin' is the threshold for static_eval - beta needed to justify the R that was used.
This is not really different from the claasical case, where R is fixed and null move is only tried when static_eval >= beta (i.e. margin = 0).
This is not really different from the claasical case, where R is fixed and null move is only tried when static_eval >= beta (i.e. margin = 0).