[GHC] #4012: Compilation results are not deterministic

GHC ghc-devs at haskell.org
Fri Apr 15 11:45:02 UTC 2016


#4012: Compilation results are not deterministic
-------------------------------------+-------------------------------------
        Reporter:  kili              |                Owner:  niteria
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  6.12.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Other             |            Test Case:
      Blocked By:  11362             |             Blocking:
 Related Tickets:  #10424            |  Differential Rev(s):  Phab:D910,
                                     |  Phab:D1073, Phab:D1133, Phab:D1192,
                                     |  Phab:D1268, Phab:D1360, Phab:D1373,
       Wiki Page:                    |  Phab:D1396, Phab:D1457, Phab:D1468,
  DeterministicBuilds                |  Phab:D1487, Phab:D1504, Phab:D1508
-------------------------------------+-------------------------------------

Comment (by Bartosz Nitka <niteria@…>):

 In [changeset:"928d74733975fe4677e2b558d031779f58a0883c/ghc" 928d747/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="928d74733975fe4677e2b558d031779f58a0883c"
 Kill some unnecessary varSetElems

 When you do `varSetElems (tyCoVarsOfType x)` it's equivalent to
 `tyCoVarsOfTypeList x`.

 Why? If you look at the implementation:
 ```
 tyCoVarsOfTypeList ty = runFVList $ tyCoVarsOfTypeAcc ty
 tyCoVarsOfType ty = runFVSet $ tyCoVarsOfTypeAcc ty
 ```
 they use the same helper function. The helper function returns a
 deterministically ordered list and a set. The only difference
 between the two is which part of the result they take. It is redundant
 to take the set and then immediately convert it to a list.

 This helps with determinism and we eventually want to replace the uses
 of `varSetElems` with functions that don't leak the values of uniques.
 This change gets rid of some instances that are easy to kill.

 I chose not to annotate every place where I got rid of `varSetElems`
 with a comment about non-determinism, because once we get rid of
 `varSetElems` it will not be possible to do the wrong thing.

 Test Plan: ./validate

 Reviewers: goldfire, austin, simonmar, bgamari, simonpj

 Reviewed By: simonpj

 Subscribers: thomie

 Differential Revision: https://phabricator.haskell.org/D2115

 GHC Trac Issues: #4012
 }}}

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


More information about the ghc-tickets mailing list