Tight Polynomial Bounds for Loop Programs in Polynomial Space (Logical Methods in Computer Science, 2021)