Track the input shape, the intermediate values, and the moment the invariant or assumption changes.
This is the core habit behind reliable code reading and debugging. Connect the idea to a realistic coding decision so recall is easier when solving similar questions.
Additional Notes
What state reasoning matters with tracing allocations?