Note that the MTGP32 state includes a pointer to the kernel parameters (see curand_mtgp32.h). This is set to the right thing™ in the set procedure (in THCTensorRandom.cu) and the corresponding inputs are effectively ignored, but they aren’t zeroed in the get part (which would be needed for loops to be reliably idempotent).
It should not be a surprise that feeding manipulated values into the internal state wrecks havoc.
I must admit that I’m not terribly keen on digging into this further, given that it’s a solved problem with standardizing on the Philox generator.
Best regards
Thomas