stockfish's illusions

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

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

Re: stockfish's illusions

Post by hgm »

Eelco de Groot wrote:Well, you have to draw the line somewhere if you don't want to search full width. Do you do Queen evasions in q-search?
The difference is that in QS you assume the pruned moves score the static eval. Pruning them in the full-width search assumes they are worse than any other move you did not prune. In this case, static eval minus a Queen...

In case of a piece as powerful as a Queen it seems reasonable that the default assumption should be that you can save it, if it has moves. While for less valuable pieces it is likely that you can protect it. Only for King, which is both weak and valuable, both these assumptions are likely to fail, so you have to worry about the evasions explicitly.
User avatar
Eelco de Groot
Posts: 4698
Joined: Sun Mar 12, 2006 2:40 am
Full name:   Eelco de Groot

Re: stockfish's illusions

Post by Eelco de Groot »

hgm wrote:
Eelco de Groot wrote:Well, you have to draw the line somewhere if you don't want to search full width. Do you do Queen evasions in q-search?
The difference is that in QS you assume the pruned moves score the static eval.
Yes, if this is always the case, it would help here once static evaluation is enough to overcome alpha (alpha is falling) and you stand pat. But in the case of Stockfish at least, if there is a search result found in TT, that takes precendece over static eval. In other words a search result that is exact, or is a Fail High higher than alpha or Fail Low lower than alpha this is alway assumed to be more accurate than static eval. So in qsearch Stockfish still has this same problem when the static eval was not enough or a search result is grafted it will probably have this Q takes B or it will try this as one of the possible qsearch captures. And the value of the node sinks without trying anything else but captures. The problem will persist going higher up because Q takes B is the hash move, alpha has fallen and static eval would now stand pat in the futility pruning at the top, not with static eval > alpha but eventually because static eval > alpha + futility margin. But the search result does not and is in fact so low that you probably fall into razoring, where you only do a q search which will give you the same lousy move Q takes B :) You do not even reach the regular search until depth is high enough not to fall into razoring anymore. Then you have to be lucky enough that in spite of the bad eval, still from Q x B, you are not so far below alpha that evasions are pruned because of too high move count. Then finally you see the evasion. In regular search you will still have saved so much time because of all the pruning, that the ridiculous Q x B does not matter. The other side can´t usually force this kind of a position at the end of a PV so it does not matter there either :)
Pruning them in the full-width search assumes they are worse than any other move you did not prune. In this case, static eval minus a Queen...

In case of a piece as powerful as a Queen it seems reasonable that the default assumption should be that you can save it, if it has moves. While for less valuable pieces it is likely that you can protect it. Only for King, which is both weak and valuable, both these assumptions are likely to fail, so you have to worry about the evasions explicitly. :)
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
User avatar
hgm
Posts: 28468
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: stockfish's illusions

Post by hgm »

Eelco de Groot wrote:But in the case of Stockfish at least, if there is a search result found in TT, that takes precendece over static eval. In other words a search result that is exact, or is a Fail High higher than alpha or Fail Low lower than alpha this is alway assumed to be more accurate than static eval.
If a search result is available for the current node in the TT it would of course always be good enough to satisfy a search request for that position. You would not even get to calculating the eval, as you would have a hash cutoff. That should happen in any engine that uses TT.
So in qsearch Stockfish still has this same problem when the static eval was not enough or a search result is grafted it will probably have this Q takes B or it will try this as one of the possible qsearch captures.
If you already fail low on the static eval of the current position, it doesn't matter whether you can safe the Queen or not. As the evasion is a non-capture, it would be futile. But the point is that you would return the eval, not the result of a bad move because you pruned all good moves. The point is that in this case even the loss of a Queen was apparently 'good enough' to propagate to the root. So the static eval or any value more accurate than it, should certainly have been good enough, as there are moves that safe the Queen.
And the value of the node sinks without trying anything else but captures. The problem will persist going higher up because Q takes B is the hash move, alpha has fallen
If QxB ever gets to be hash move, something seriously broken must have been going on before. There should be no way a node could ever think QxB is best in this position.

TT just reflects what an earlier, possibly more thorough search turned up. It is not arbitrary nonsense, but just re-using of earlier search results. And no correct search could ever find that this position forcibly loses a Queen.
... and static eval would now stand pat in the futility pruning at the top, not with static eval > alpha but eventually because static eval > alpha + futility margin. But the search result does not and is in fact so low that you probably fall into razoring, where you only do a q search which will give you the same lousy move Q takes B :) You do not even reach the regular search until depth is high enough not to fall into razoring anymore. Then you have to be lucky enough that in spite of the bad eval, still from Q x B, you are not so far below alpha that evasions are pruned because of too high move count. Then finally you see the evasion. In regular search you will still have saved so much time because of all the pruning, that the ridiculous Q x B does not matter. The other side can´t usually force this kind of a position at the end of a PV so it does not matter there either :)
User avatar
Ponti
Posts: 506
Joined: Wed Mar 15, 2006 6:13 am
Location: Curitiba - PR - BRAZIL
Full name: Aloisio Ponti Lopes

Re: stockfish's illusions

Post by Ponti »

Do you really believe in engine´s analysis at small depths , always ?

:lol:
A. Ponti
AMD Ryzen 1800x, Windows 10.
FIDE current ratings: standard 1913, rapid 1931
Karlo Bala
Posts: 373
Joined: Wed Mar 22, 2006 10:17 am
Location: Novi Sad, Serbia
Full name: Karlo Balla

Re: stockfish's illusions

Post by Karlo Bala »

hgm wrote:It can't be good pruning evasions in nodes where all moves so far failed low because they lose a valuable piece that is under attack.
From a statistical point of view it probably is (good).
Best Regards,
Karlo Balla Jr.