To win we need to let knight die because rook can move multiple steps to kill the king.
From a third person perspective R2 is a deceptive move that takes advantage algorithm to make the black king back off to kill its knight.
So black is not in check and has no legal moves, so stalemate.
Isn't this the definition of checkmate, not stalemate?
Would enjoy so much if there were more of these, feels like an obligation-free chess puzzle.