Suppose I make a run and encounter Ashigaru. Suppose it has at least three subroutines, and I use Grappling Hook to break all but one of them. I then trash Utopia Shard to force the corp to discard two cards from HQ, and cause Ashigaru to lose two subroutines. Then any remaining unbroken subroutines resolve. Does the run end? The gaining and losing of subroutines are tracked as a running total. So if Ashigaru has 4 subroutines, and you break 3, and then it loses 2, you have broken all subroutines on it and the run continues.
As before, the runner encounters Ashigaru with 4 subroutines, breaks 3 with Grappling Hook, then uses Utopia Shard to subtract 2 subroutines. If the corp then draws 1 card with Panic Button, so that Ashigaru has 3 subroutines, will the third subroutine be broken or unbroken? You broke 3 subroutines, so the third subroutine is still broken.