[d]8/8/1p6/7p/pr3k2/8/6K1/1r2R3 b - - 0 61
Black to move and has a win in 3 moves: 1. ... Rb4-b2+ 2. Kf1 Kf3 3. Rxb1 Rxb1# (or some other variation of this).
My engine outputs this from a search to depth 7:

As you can see it find the mate in 3 at depth 4 (it has to see if there are valid moves or not at depth 4 to know if there is a mate in 3). But then it somehow forgets this and finds a mate in 4 later on. Okay, so a bug in my engine probably? Then I tried it with lichess editor: https://lichess.org/analysis/8/8/1p6/7p ... -%200%2061 and guess what, it only finds the mate in 4, at depth 23!
I then put it up in SF in Arena and it found the mate in 3 immediately. Maybe from tablebases or something because it did it at depth 1 according to Arena output...?
So 2 questions to the gurus here:
1. When my engine finds a (positive) mate at a depth, should I immediately stop at that depth and just return the move that gives mate? Since it will not find mate in less moves when going higher/deeper (if I make sense).
2. Is this due to null move and the nature of the zugzwang situation after 2. ... Kf3? And the null move logic?
