Simple search idea, did anyone already try it?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Dann Corbit
Posts: 12541
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Simple search idea, did anyone already try it?

Post by Dann Corbit »

DESPERATION_MODE_SEARCH:

Suppose that your root position is down a large amount 'amt_down' from some previous iteration, and that the color for the root iteration is 'c'.
Searching moves that continue to lose ground is more and more fruitless as amt_down gets bigger and bigger.

My idea is that we go into desperation mode with the following changes:
1. When side to move is c, we reduce more and more (as a function of amt_down') the normal pruning until we hit zero at some threshold.
2. When side to move is c, we give larger and larger check extensions and single reply extensions as a function of 'amt_down'.
3. When side to move is c, we add more and more threads to a collection that is doing a zero window search at root_score + 50 (or some other useful centipawn value, which is essentially the old Houdini 'winfinder' algorithm but I think he used 25 centipawns).

Edit: The Rybka winfinder algorithm, not Houdini.

If the side to move is not 'c', we search normally.
My notion is that this is more how a human player would search under these conditions (with good reason). If we are down a rook, we won't spend a lot of time searching down some line that loses another pawn. We might look for checks or single replies that can give a draw by perpetual or create a new and useful configuration by moving the opponent king to a place where he is no longer comfortable. We also might look for a big tactical shot because we are in a position where we need to regain lost ground. We do all those sorts of things for a reason. I realize that it is not at all "alpha-beta" like and therefore it seems that it is probably unsound.

So, what I am wondering is if anyone has already tried it?
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
Dann Corbit
Posts: 12541
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Simple search idea, did anyone already try it?

Post by Dann Corbit »

Some other things that might get a "desperation bonus" could include:

Generating passed pawns
Opposite castle pawn races
Change eval function to tactical version (e.g. tuned to tactical weights)
...
Probably others are good candidates too.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
chrisw
Posts: 4319
Joined: Tue Apr 03, 2012 4:28 pm

Re: Simple search idea, did anyone already try it?

Post by chrisw »

Dann Corbit wrote: Sat Nov 03, 2018 2:24 am DESPERATION_MODE_SEARCH:

Suppose that your root position is down a large amount 'amt_down' from some previous iteration, and that the color for the root iteration is 'c'.
Searching moves that continue to lose ground is more and more fruitless as amt_down gets bigger and bigger.

My idea is that we go into desperation mode with the following changes:
1. When side to move is c, we reduce more and more (as a function of amt_down') the normal pruning until we hit zero at some threshold.
2. When side to move is c, we give larger and larger check extensions and single reply extensions as a function of 'amt_down'.
3. When side to move is c, we add more and more threads to a collection that is doing a zero window search at root_score + 50 (or some other useful centipawn value, which is essentially the old Houdini 'winfinder' algorithm but I think he used 25 centipawns).

Edit: The Rybka winfinder algorithm, not Houdini.

If the side to move is not 'c', we search normally.
My notion is that this is more how a human player would search under these conditions (with good reason). If we are down a rook, we won't spend a lot of time searching down some line that loses another pawn. We might look for checks or single replies that can give a draw by perpetual or create a new and useful configuration by moving the opponent king to a place where he is no longer comfortable. We also might look for a big tactical shot because we are in a position where we need to regain lost ground. We do all those sorts of things for a reason. I realize that it is not at all "alpha-beta" like and therefore it seems that it is probably unsound.

So, what I am wondering is if anyone has already tried it?
It does make sense if losing in bad material situation to do something active rather than just sit and wait to lose. Sensible algorithm for chess (but, not for war, such a policy is more likely to lead to many more deaths and still lose).
However, the weak point in this desperation algorithm, as you describe it, is then question of when. Not necessarily now. Again, in war, the losing side might try to build up a strike force and then attack. Thus, your algorithm needs a “when” component.