I recently tried validating the MT parameters included in the MT code in the CUDA SDK and wanted to share with you a few observations I made:
Although the DCMT code for the initial state was corrected in genmtrand.c, it wasn’t corrected in mt19937.c (should have i+1 instead of i), which is called in init_dc.
The parameters seem to have been set using multiple calls to get_mt_parameter_id rather than get_mt_parameters. The difference between the two being that the first has a fixed 16 bits for encoding the machine id, whereas the latter uses as few bits as necessary to embed the id, thus avoiding multiple zeroes in the lower word. Could someone please enlighten me on whether it is advisable to avoid such a situation or not?
In a later paper by Prof Matsumoto et. al. (something on the Fubuki stream / block cipher) they mention the importance of correctly setting up the initial state and describe this as a) 1812433253 x (mt[i-1] ^ (mt[i-1] >> 30) + i) rather than b) 1812433253 x (mt[i-1] ^ (mt[i-1] >> 30)) + i as is in all their c code.
I have no idea which is the correct one or whether a) is inherently better than b) or vice versa. Again, is there an expert out there who could perhaps enlighten me?
Thanks a lot,