Hard masking with an all-true mask #
Spec.scaledDotProductAttention normalizes scores through one of two code paths: plain axis
softmax when ctx.mask = none, and Spec.hardMaskedSoftmaxSpec when a Boolean mask is supplied.
This file proves that a mask allowing every position selects exactly the unmasked weights, so the
two branches agree wherever both apply. The statement is over ℝ, where the max used by the
stable softmax shift is the order maximum compared by the hard-mask row scan.
Hard-masked softmax with every entry allowed is the stable softmax kernel.
Hard-masked softmax with the all-true mask is the unmasked axis-1 softmax.
Supplying the all-true mask to scaled dot-product attention is the same as supplying no mask.
The all-true mask leaves the attention backward pass unchanged.
The all-true mask leaves the attention forward-mode derivative unchanged.