[GHC] #4012: Compilation results are not deterministic

GHC ghc-devs at haskell.org
Mon May 11 10:57:30 UTC 2015


#4012: Compilation results are not deterministic
-------------------------------------+-------------------------------------
        Reporter:  kili              |                   Owner:  Fuuzetsu
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:  7.12.1
       Component:  Compiler          |                 Version:  6.12.2
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  Other             |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
Description changed by simonpj:

Old description:

> There are some issues with non-determinism in the output of GHC, which
> means that compilations are not repeatable.  This affects some users
> (e.g. Debian packagers) who need to be able to get repeatable hashes for
> the packages of a GHC build.
>
> The cases we know about that lead to non-deterministic results are:
>
>  * The `spec_ids` (specialised Ids) attached to an Id have a non-
> deterministic ordering
>  * CSE can give different results depending on the order in which the
> bindings are considered, and since the ordering is non-deterministic, the
> result of CSE is also non-deterministic.  e.g. in `x = z; y = z; z = 3`,
> where `y` and `x` are exported, we can end up with either `x = y; y = 3`
> or `y = x; x = 3`.
>  * There seems to be something unpredictable about the order of arguments
> to SpecConstr-generated specialisations, see
> [http://www.haskell.org/pipermail/glasgow-haskell-
> users/2011-April/020287.html]
>  * The wrappers generated by the `CApiFFI` extension have non-
> deterministic names. (see comment:15 below).
>
> '''Old ticket description follows'''
>
> Short story: if you use ghc-6.12.1.20100318 (or similar, probably
> ghc-6.12.1 release will produce the same results) to bootstrap
> ghc-6.12, and then use that ghc-6.12 to bootstrap another ghc-6.12,
> those two instances of ghc-6.12 will have different ABI hashes and
> interfaces in the ghc package. If you use ghc-6.10 for the
> bootstrapping, you'll even get differences in the ghc, base and
> Cabal packages.
>
> Long story: see logfiles and descriptions at http://darcs.volkswurst.de
> /boot-tests/ (note that the logfiles are quite large, I really don't want
> to attach 150 MB of logs to this ticket).

New description:

 There are some issues with non-determinism in the output of GHC, which
 means that compilations are not repeatable.  This affects some users (e.g.
 Debian packagers) who need to be able to get repeatable hashes for the
 packages of a GHC build.

 The cases we know about that lead to non-deterministic results are:

  * The `spec_ids` (specialised Ids) attached to an Id have a non-
 deterministic ordering
  * CSE can give different results depending on the order in which the
 bindings are considered, and since the ordering is non-deterministic, the
 result of CSE is also non-deterministic.  e.g. in `x = z; y = z; z = 3`,
 where `y` and `x` are exported, we can end up with either `x = y; y = 3`
 or `y = x; x = 3`.
  * There seems to be something unpredictable about the order of arguments
 to SpecConstr-generated specialisations, see
 [http://www.haskell.org/pipermail/glasgow-haskell-
 users/2011-April/020287.html]
  * The wrappers generated by the `CApiFFI` extension have non-
 deterministic names. (see comment:15 below).
  * See comment:76 for another, different, example

 '''Old ticket description follows'''

 Short story: if you use ghc-6.12.1.20100318 (or similar, probably
 ghc-6.12.1 release will produce the same results) to bootstrap
 ghc-6.12, and then use that ghc-6.12 to bootstrap another ghc-6.12,
 those two instances of ghc-6.12 will have different ABI hashes and
 interfaces in the ghc package. If you use ghc-6.10 for the
 bootstrapping, you'll even get differences in the ghc, base and
 Cabal packages.

 Long story: see logfiles and descriptions at http://darcs.volkswurst.de
 /boot-tests/ (note that the logfiles are quite large, I really don't want
 to attach 150 MB of logs to this ticket).

--

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/4012#comment:80>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list