Blunder related to aspiration window?

Discussion of chess software programming and technical issues.

Moderator: Ras

sandermvdb
Posts: 160
Joined: Sat Jan 28, 2017 1:29 pm
Location: The Netherlands

Blunder related to aspiration window?

Post by sandermvdb »

Sometimes my engine makes a huge blunder and I was wondering if this is related to the aspiration window. Suppose I have no time left and MUST perform a move, what should I do in the following situations? Perform the best move of the previous iteration or perform the 'best move' of the current iteration?
1) root score <= alpha
2) root score >= beta
syzygy
Posts: 5949
Joined: Tue Feb 28, 2012 11:56 pm

Re: Blunder related to aspiration window?

Post by syzygy »

If the search has definitely proved that, at the current iteration, the current best move is better than the best move of the previous iteration, then play the current best move.

In your case the search may only have detected a null-window search that failed high. It may be better to first verify the initial fail high with a PV search before promoting the move to new best move.
mar
Posts: 2682
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Blunder related to aspiration window?

Post by mar »

sandermvdb wrote:Sometimes my engine makes a huge blunder and I was wondering if this is related to the aspiration window. Suppose I have no time left and MUST perform a move, what should I do in the following situations? Perform the best move of the previous iteration or perform the 'best move' of the current iteration?
1) root score <= alpha
2) root score >= beta
What I do, if aspiration fails low, give the engine more time (certain fraction of remaining time) to resolve the iteration (this is typically a nice elo gain as well). (if time's up even after this then I play the previous best move)
A subtle detail is that when failing low I resolve the failing move first rather than looking for a better one with current bounds.
When failing high, I happily play the move betting that it will be good (in most cases it is). Some resolve the fail high as well.
sandermvdb
Posts: 160
Joined: Sat Jan 28, 2017 1:29 pm
Location: The Netherlands

Re: Blunder related to aspiration window?

Post by sandermvdb »

mar wrote:
What I do, if aspiration fails low, give the engine more time (certain fraction of remaining time) to resolve the iteration (this is typically a nice elo gain as well). (if time's up even after this then I play the previous best move)
A subtle detail is that when failing low I resolve the failing move first rather than looking for a better one with current bounds.
When failing high, I happily play the move betting that it will be good (in most cases it is). Some resolve the fail high as well.
What do you mean by 'resolve the failing move'?

And suppose I do play the failing move, as I do now, could this sometimes result in huge blunders? Giving away the queen for instance.
Joost Buijs
Posts: 1694
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Blunder related to aspiration window?

Post by Joost Buijs »

mar wrote:
sandermvdb wrote:Sometimes my engine makes a huge blunder and I was wondering if this is related to the aspiration window. Suppose I have no time left and MUST perform a move, what should I do in the following situations? Perform the best move of the previous iteration or perform the 'best move' of the current iteration?
1) root score <= alpha
2) root score >= beta
What I do, if aspiration fails low, give the engine more time (certain fraction of remaining time) to resolve the iteration (this is typically a nice elo gain as well). (if time's up even after this then I play the previous best move)
A subtle detail is that when failing low I resolve the failing move first rather than looking for a better one with current bounds.
When failing high, I happily play the move betting that it will be good (in most cases it is). Some resolve the fail high as well.
Basically I do the same, when the PV move fails low I give the engine additional time and resolve the move with adjusted bounds before continuing with the non PV moves. When a non PV move fails high, I usually resolve it, only with very little time left on the clock I play the FH move immediately.
Joost Buijs
Posts: 1694
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Blunder related to aspiration window?

Post by Joost Buijs »

sandermvdb wrote:
mar wrote:
What I do, if aspiration fails low, give the engine more time (certain fraction of remaining time) to resolve the iteration (this is typically a nice elo gain as well). (if time's up even after this then I play the previous best move)
A subtle detail is that when failing low I resolve the failing move first rather than looking for a better one with current bounds.
When failing high, I happily play the move betting that it will be good (in most cases it is). Some resolve the fail high as well.
What do you mean by 'resolve the failing move'?

And suppose I do play the failing move, as I do now, could this sometimes result in huge blunders? Giving away the queen for instance.
I don't think that when the PV move (the best move from previous iteration) fails low it should play such gross blunders, it must be some other kind of bug. Maybe there is something wrong with your move sorting.
sandermvdb
Posts: 160
Joined: Sat Jan 28, 2017 1:29 pm
Location: The Netherlands

Re: Blunder related to aspiration window?

Post by sandermvdb »

Joost Buijs wrote: I don't think that when the PV move (the best move from previous iteration) fails low it should play such gross blunders, it must be some other kind of bug. Maybe there is something wrong with your move sorting.
I am using 2 transposition tables and using the score/move with the highest depth. Maybe that is the cause.
mar
Posts: 2682
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Blunder related to aspiration window?

Post by mar »

sandermvdb wrote:What do you mean by 'resolve the failing move'?
I mean resolving the iteration if time permits by using more time.
If you can find a better move than the failing move that resolves within aspiration bounds then you play it,
that's why I resolve the failing move first by adjusting bounds to see how bad it is.
EDIT: by failing I mean failing low
Joost Buijs
Posts: 1694
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Blunder related to aspiration window?

Post by Joost Buijs »

sandermvdb wrote: I am using 2 transposition tables and using the score/move with the highest depth. Maybe that is the cause.
So I assume you get the best-move and ponder-move from the transposition table. In the past I also did this and occasionally it returned the wrong move, since that time I treat them separately.
JVMerlino
Posts: 1407
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: Blunder related to aspiration window?

Post by JVMerlino »

sandermvdb wrote:Sometimes my engine makes a huge blunder and I was wondering if this is related to the aspiration window. Suppose I have no time left and MUST perform a move, what should I do in the following situations? Perform the best move of the previous iteration or perform the 'best move' of the current iteration?
1) root score <= alpha
2) root score >= beta
There is no one right answer, because this is actually a time management question. Yes, you must eventually either perform the best move of the previous iteration or the best move of the current iteration. But you don't have a best move of the current iteration until the first move you've searched in that iteration comes back with a true score (as opposed to failing high/low and needing to be re-searched).

So, the question becomes how to best use your time. The wrong solution would be to always use the same amount of time per move (typically 1/N of the clock remaining at the start of the search - usually N is somewhere between 30 and 40 in rudimentary implementations).

Myrddin is very aggressive with its clock use. If the first move of the current iteration fails low, I will use up to half of the remaining clock in the hopes that it can be resolved. But this calculation is also potentially affected/adjusted by the current score, and by the relation of the current score and the score of the previous iteration. For example, if Myrddin clearly thinks it's winning, it certainly won't spend a bunch of extra time trying to get an exact score.

I'm pretty pleased with the results. Myrddin almost always uses more of its clock than its opponents. Sometimes it will get itself into time trouble, but isn't it better to resolve those fail lows when in crucial positions?

But, as to your initial concern about playing blunders, aspiration windows shouldn't cause that. I can only guess that, if you run out of time and haven't yet found an exact score for any move in the current iteration, then perhaps your intention is to play the first move searched, but are playing some other move instead due to a bug?

jm
[/b]