ive had a position like this on lichess and should this also be considered a dead position?
Absolutely not. Both sides can lose their rook or get checkmated. Either side would lose with the rook if time runs out, even if the other side has only a knight! Note that even knight vs pawn endgames can be win with the knight even if it's not an edge pawn:
So if blacks time expires in the initial position, he should lose the game.
About detecting dead positions, I agree that it would be inefficient to check for all possibilities, but detecting basic patterns could be possible. I have an idea for a way to detect a locked pawn structure, but I'm no programmer and I don't know if this is possible, or practical if it is possible. Might be a fun thought bubble though:
To detect an impenetrable pawn structure for white, the program will first see if white can move their pawns. If not, it can detect all the squares that black's pawns control, and then detect all the squares that white's pawns occupy, saving them into some temporary storage and marked with their respective positions (a4, b3, etc.). Then it will see if those squares ever form a line, as in there are eight saved squares a-b that all have the same matching line number (a4, b4, c4, etc.). If there is a line, and the row number for white's king is less than the row number for the line, then it is an impenetrable pawn structure. The same test can then be done for black.
Obviously there are a few locked pawn structures that don't form a straight line, such as the one below. Again, I don't know if this is even possible or practical if it was, but if the square data was available something like this could be done
I feel weird now for posting about something I have no knowledge in
how did you mark the spots with red? and also how do you make arrows on the chessboard you make on forums?