When the target is above the the SNR, than several functions could return 0, so this issue should be investigated more.
I believe that when target goes out of P-40's detection, "Pat Hand" just must stop trackin it (when no range or angle track was established0, and when it appears again, should be reaquired with the joystick on p-40 and then send to "Pat hand'....
It is a quite an interesting issue how "Long track" is autotracking targets...
The 1S12 SOC (Long Track) tracks the target similarly as the modern digital radars (ST-68U [Tin Shield]) do, just they do it for several targets parallel.
It first measures the (X/Y/H)"0" coordinate of a target, than during the next sweep, finds the closest target to that coordinate.
This will be the (X/Y/H)"1" coordinate. With a quick math, delta(X/Y/H) is determined.
During the third sweep, it looks for the closest target at (X/Y/H)"1" + delta(X/Y/H).
That will be (X/Y/H)"2", and the difference from (X/Y/H)"1" is again delta(X/Y/H).
etc...