Variation codes not turning out the way we intended

Let the developers know what you think of the software and what can be done to either improve the CFDG language or the Context Free program.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
User avatar
MtnViewJohn
Site Admin
Posts: 875
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Variation codes not turning out the way we intended

Post by MtnViewJohn »

The way we intended variation codes to work is that a given variation of a cfdg file will look the same everywhere. But recently Mark compiled Context Free using Intel's new compiler for Mac OS X and variations looked different.

It turned out that Intel's compiler was generating code that causes slight differences in the least significant bits of double precision numbers. These minor differences in the FP numbers shouldn't have any effect. But it turns out that the random number generator in Context Free is affected by these incredibly small changes. The random number generator in Context Free generates a tree of random numbers instead of a sequence. Each node of this tree is associated with a shape and we exclusive-OR the affine transform of the shape into the random number seed to improve randomness. GCC and Microsoft VC++ generate affine transforms that are bitwise identical. But Intel's compiler generates slightly different numbers that throw off the random number generator.

In hindsight it is obvious that XORing FP numbers into the random number seed would never produce a globally uniform random number generator. The only way we can make the random number generator globally uniform is to XOR in a value derived directly from the ASCII characters of the cfdg file, using only integer math.

What this means for CF users is that the random number generator is getting tweaked and this will change what all the variations look like. We hope that the random number generator will not need to change after this and that variations will now be stable.

Post Reply