hgm wrote:The point is not if there are mate positions possible. The search will see and avoid those. The point is if there exist ways to force such mates in a long series of moves, so that the actual mate will be beyond the search horizon, while your fate is already inescapably sealed. The evaluation is for handling such long-term strategic problems.
I am not sure about the way you equate mating chances to the amount of material one should be willing to sacrifice. If the mating chance is large enough, it does not matter what you sacrifice. You just go for that chance, and if it doesn't work out, you are lost.
1)I think that you cannot trust search because there are leafs nodes that you evaluate.
I practically do not evaluate king safety in pawn endgames because cases when there is mate are rare there but evaluating that the king has no square to go in leaf position may help you to detect mate danger.
Here is another example that I composed
black cannot prevent mate in 2 in the first diagram.
Of course black does not play Rxh4 in the second diagram but it is possible that black get the second diagram instead of getting some winning position because of not evaluating king safety in the endgame
and evaluating that after Rxh4 Kxh4 black has unstoppable passed pawn.
[D]8/p4p1p/5P1k/7P/7K/8/6P1/8 b - - 0 1
[D]8/p4p1p/5P1k/7P/7R/6K1/6P1/7r b - - 0 1
2)Things are not so simple.
It is possible that the opponent is forced to sacrifice material to prevent mate.
If you sacrifice a rook for mate attack and the opponent can prevent the mate and lead the king to safe square by sacrificing a knight then sacrificing a rook was too much.
You are not in binary situation that you have mate or not mate when you save the material advantage.
Uri