One problem. This assumes your king safety scores are "dead on". 99% of the scores in current programs are anywhere but "dead on". I've noticed and reported many times over the years, that it is often far more important to score some feature, as opposed to what the actual numeric score for that feature really should be, within some reasonable range. All that matters is that the scores are somehow "in the proper scale relationship" with others.hgm wrote:Evaluation discontinuities are hard on the search, but if they are a reality of life, the search will have to deal with them (through a smarter extension policy).
If your opponents King is so exposed that your best estimate is that (considering the Pawn structure) he will lose two Pawns becasue of double attacks (check+Pawn) by the Queen, then the two Pawn advantage that evaporates on trading Queens before cashing in on the opponent's bad King safety is a real effect. Your Queen is worth 1100cP, and the opponent's Queen only 900cP in this situation.
This means that in the above case, you might be OK if your scores are dead on. And if your extensions work perfectly. But I don't personally try to extend all the non-tactical issues I find. I can give up a 1/2 pawn advantage here, or a 1/3 pawn advantage over there, most programs choose 1/3. Even though the 1/2 pawn advantage is going to disappear before long, as the 1/3 giveaway is just a horizon effect. And trying to stave off that kind of horizon effect is extremely difficult, we barely control the material/tactical type horizon effects..
This is not different from having a Rook against the opponent's Bishop. There it also would be unwise to 'trade' the Rook for the Bishop. If your search cannot handle the 200cP loss that will materialize at the instant of the trade, there is no way you could fix it by fiddling with the King safety. If the opponent can force you to lose the exchange, your search will have to be able to handle it, or you will see classical horizon effect. Scrificing Pawns for no end, or wrecking King safety, might be manifestations of that.
Note that it really is impossible to eliminate discontinuities, because the game of chess itself is not a continuous system. Pawns and Pieces have discrete values. And any term that is based upon those values will have some discontinuity associated with it. But the larger the discontinuity, the more mischief the search can work...
I'd bet most of these discontinuity issues are results of misevaluations. Unfortunately, at least for me, eliminating them has proven to be very difficult...
The castling example (from which, unfortunately, Joker suffers a lot, I must confess) seems more an example of mis-evaluation: the discontinuity is not real there in the first place. But that doesn't prove that discontinuities are bad: a continuous mis-evaluation can be just as bad. In this case the possession of castling rights is apparently under-estimated, so that the engine think it has an unrealistically large advantage when the opponent has not castled yet, but is still allowed to do so. It should be solved by more realistic evaluation of the rights.