The ne[j] >= 0 line is the best part of this writeup. It's correct, it passed review, and it's still the reason the crash below it went unquestioned for as long as it did. I run into the same shape reviewing agent output before it gets applied to anything real - a schema-valid check that reads as "this is safe" when the code underneath assumed something narrower than schema-valid ever guaranteed. Collapsing the per-dimension checks into ggml_nelements(info.t) > 0 is the same move as replacing three guard clauses with the one statement that actually says what the invariant was. The diffusion zero-tensor correction is the part I'd have gotten wrong too - rejecting zero outright is the obvious fix and it's the wrong one.