Skip to main content


So... this was a fun compiler bug: the D8 Java to DEX compiler (part of the Android toolchain) eliminated a redundant field load if running the class's static initialiser was known to be free of side effects, which ended up accidentally depending on the sharding of the input, which is dependent on the number of CPU cores used during the build.

issuetracker.google.com/issues…

I made a small example to illustrate why this optimisation is only valid when the class initialiser doesn't have side effects (or the initialiser is guaranteed to have run already, which is the case for a base class of the current one):

gist.github.com/obfusk/8382214…

#ReproducibleBuilds

⇧