The devilish fail low

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: The devilish fail low

Post by hgm »

Indeed it seems never good to spend a much different time as your opponent. Even if the opponent thinks much faster or slower than what is objectively optimal, you should at least partly (perhaps as much as 80%) adapt to him, rather than stick to the ideal schedule.

As to reductions: these only manifest themselves when you reach the tip of the branch. It doesn't matter much where along the branch it was decided how large the reduction should be. And when one player is much ahead, the other should be much behind. This suggests that you could do it either way.
Pio
Posts: 334
Joined: Sat Feb 25, 2012 10:42 pm
Location: Stockholm

Re: The devilish fail low

Post by Pio »

hgm wrote: Mon Apr 06, 2020 11:33 pm Indeed it seems never good to spend a much different time as your opponent. Even if the opponent thinks much faster or slower than what is objectively optimal, you should at least partly (perhaps as much as 80%) adapt to him, rather than stick to the ideal schedule.

As to reductions: these only manifest themselves when you reach the tip of the branch. It doesn't matter much where along the branch it was decided how large the reduction should be. And when one player is much ahead, the other should be much behind. This suggests that you could do it either way.
Hi HGM
As to reductions: these only manifest themselves when you reach the tip of the branch. It doesn't matter much where along the branch it was decided how large the reduction should be. And when one player is much ahead, the other should be much behind. This suggests that you could do it either way.
Yes you are right it should not matter much (a little bit though) depending if even or odd. I just think it nice to do things symmetrical (except this asymmetrical stuff 😀). I think that my change might be better to do in an existing engine since other things might be a function of reductions and doing it symmetrically will make the other things change less. It is a little bit like approximating the derivative by taking (f(x+h)-f(x-h)/2h) should be better on average. Another thing is that you should probably not use the inner nodes static scores for the PV nodes to determine the reductions but instead use the exact score.

/Pio
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: The devilish fail low

Post by Michael Sherwin »

This is a whatif from the point of view of white. And this might require fail soft.

White is searching a move at the root. Black has a best move that leaves white with only one reply to keep the balance, then add depth to that root move in subsequent iterations. Or white has another move just as good or very very close where black's best move leaves white with more options then play that instead.
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: The devilish fail low

Post by bob »

Pio wrote: Tue Apr 07, 2020 12:38 am
hgm wrote: Mon Apr 06, 2020 11:33 pm Indeed it seems never good to spend a much different time as your opponent. Even if the opponent thinks much faster or slower than what is objectively optimal, you should at least partly (perhaps as much as 80%) adapt to him, rather than stick to the ideal schedule.

As to reductions: these only manifest themselves when you reach the tip of the branch. It doesn't matter much where along the branch it was decided how large the reduction should be. And when one player is much ahead, the other should be much behind. This suggests that you could do it either way.
Hi HGM
As to reductions: these only manifest themselves when you reach the tip of the branch. It doesn't matter much where along the branch it was decided how large the reduction should be. And when one player is much ahead, the other should be much behind. This suggests that you could do it either way.
Yes you are right it should not matter much (a little bit though) depending if even or odd. I just think it nice to do things symmetrical (except this asymmetrical stuff 😀). I think that my change might be better to do in an existing engine since other things might be a function of reductions and doing it symmetrically will make the other things change less. It is a little bit like approximating the derivative by taking (f(x+h)-f(x-h)/2h) should be better on average. Another thing is that you should probably not use the inner nodes static scores for the PV nodes to determine the reductions but instead use the exact score.

/Pio
You know, this reminds me of a guy "mercilous" on ICC many years ago. He started beating ALL the programs with a clever knight sac where he would lure his opponent into taking with the h-pawn. He waited until his opponent castled, then he would either not castle, or castle queenside. And after the critical sequence of moves (IE white plays Ng5, black plays h6 to drive the knight away, then white follows with h4. Now after hxg5 by black, and white's hxg5 recapture, the h-file is open. With white's rook at h1 already. Very dangerous. If he has his queen positioned well, the queen plus rook (plus another rook as well) becomes overwhelming on the h-file. And he was winning about 95% of all his games against ALL programs, commercial or not (including Crafty). I added evaluation code in Crafty to fix this. Was an ugly fix but it worked.

He then started on a new tack. Moving very quickly, moving pieces back and forth, to run the opponent out of time. And playing zero increment games, he would get the programs into significant time trouble. Once again, I had to fix this and the idea was to monitor time usage. Any my solution was similar to what you mentioned above. If the opponent moved quickly, and Crafty's target time was significantly higher than what the opponent used, I would shorten the target time. And with careful monitoring, it stopped running out of time. To the point that it won some pretty amusing games where the opponent kept moving something back and forth hoping for either a time loss or a repetition, but since Crafty was moving very quickly to match his time usage, he would fail to notice that his "repeated move" had turned into a blunder when Crafty played something unexpected. Net result was that by playing faster, Crafty influenced his time usage so that he would make mistakes trying to keep tempo with Crafty.

Those were fun times. :)
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: The devilish fail low

Post by xr_a_y »

hgm wrote: Sun Apr 05, 2020 5:37 pm Another panic mode could be to search wider instead of deeper; modern top engines reduce so aggressively that it is very hard to get more depth in the side branches, and you have to increase the nominal search depth enormously to even get one extra ply there. Often the reason for their heavy reduction is nothing else than that they happened to be later than other moves in the initial move ordering determined by the move generator. History is often a self-fulfilling prophecy; those moves that you hardly ever try will never be able to get a high history score even when they are good, and will thus hardly ever be tried. If you are dependent on a miracle, it might be cheapest to search it in those moves. Apparently your intuition for deciding what moves were worth following proved wrong, or it would not have led you to this failing PV. So better drop it, and treat all moves more equally.
I first try to do less LMP when in emergency mode inside Minic. This looks like a +10 in self play.
Then i'll try to reduce (LMR) a little less also.