Fail hard/soft

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Carbec
Posts: 133
Joined: Thu Jan 20, 2022 9:42 am
Location: France
Full name: Philippe Chevalier

Fail hard/soft

Post by Carbec »

Hello,

I implemented the alpha-beta search from Moreland. If I understand well, it is a fail-hard solution.
I saw mentioned a fail-soft solution. What is the difference ? And is there a better one, or perhaps
is there some situation where one solution is better than the other ?

Thanks for information.

Philippe
Mike Sherwin
Posts: 868
Joined: Fri Aug 21, 2020 1:25 am
Location: Planet Earth, Sol system
Full name: Michael J Sherwin

Re: Fail hard/soft

Post by Mike Sherwin »

Carbec wrote: Fri Jan 28, 2022 2:14 pm Hello,

I implemented the alpha-beta search from Moreland. If I understand well, it is a fail-hard solution.
I saw mentioned a fail-soft solution. What is the difference ? And is there a better one, or perhaps
is there some situation where one solution is better than the other ?

Thanks for information.

Philippe
This question has been asked many times over the years and I can't remember ever seeing a definitive answer.
User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

Re: Fail hard/soft

Post by Desperado »

Mike Sherwin wrote: Fri Jan 28, 2022 4:41 pm
Carbec wrote: Fri Jan 28, 2022 2:14 pm Hello,

I implemented the alpha-beta search from Moreland. If I understand well, it is a fail-hard solution.
I saw mentioned a fail-soft solution. What is the difference ? And is there a better one, or perhaps
is there some situation where one solution is better than the other ?

Thanks for information.

Philippe
This question has been asked many times over the years and I can't remember ever seeing a definitive answer.
There are two questions and the first one can be answered definitely. Yes, there is a difference.

Example: [alpha,beta] eg [50,200]

What happens is, that a node will be searched and there will be a search result, for example 220 points.
This score is above beta and tells you, that you will reach at least 220 points from the current situation.
At the same time you don't care about it, this lowerbound score will be below parents alpha.
This will be the same for every score >= 200 as for 220. Now the second questions occurs,

which score do you want to return and what is the effect?

In the failsoft scenario you return 220. In the failhard scenario you return the bound 200 instead of the search score.
That is the difference in what happens. The question if it is better or not, and what is the difference terms of pruning the tree.

That is hard to analyze. But in an advanced engine which uses a transposition table all these bound and values are stored,
and will effect the tree shape somehow. On average, i guess, the fail-soft framework might provide better results.
But this depends on many factors and the general search design too, i would say.

So, two questions. One is simple to answer the other one is much more complicated. I would bet on fail-soft ;-) :-)

Michael
Carbec
Posts: 133
Joined: Thu Jan 20, 2022 9:42 am
Location: France
Full name: Philippe Chevalier

Re: Fail hard/soft

Post by Carbec »

ok,

Thanks for this very clear explanation.

At now, Im doing the same thing (fail hard) in both alpha-beta and quiescence;
is it OK ?

Philippe
User avatar
j.t.
Posts: 239
Joined: Wed Jun 16, 2021 2:08 am
Location: Berlin
Full name: Jost Triller

Re: Fail hard/soft

Post by j.t. »

As I understand it, you just discard information when applying the fail-hard scheme. Even if today this makes no difference in your search, then maybe in future you will implement a method that would benefit from having the extra information. I don't know for sure, but it doesn't seem to me like less information would improve the situation in any case (if it doesn't slow down your engine significantly).
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Fail hard/soft

Post by mvanthoor »

Carbec wrote: Fri Jan 28, 2022 2:14 pm Hello,

I implemented the alpha-beta search from Moreland. If I understand well, it is a fail-hard solution.
I saw mentioned a fail-soft solution. What is the difference ? And is there a better one, or perhaps
is there some situation where one solution is better than the other ?

Thanks for information.

Philippe
Best explanation I found:
https://www.ics.uci.edu/~eppstein/180a/990202b.html
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL