Re: [GHC] #13615: Nondeterminism in ‘pure’ function w/ parallel evaluation & memo combinators
GHC
ghc-devs at haskell.org
Wed Apr 26 15:21:21 UTC 2017
#13615: Nondeterminism in ‘pure’ function w/ parallel evaluation & memo combinators
-------------------------------------+-------------------------------------
Reporter: pacak | Owner: (none)
Type: bug | Status: new
Priority: highest | Milestone: 8.2.1
Component: Compiler | Version: 8.2.1-rc2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Incorrect result | Unknown/Multiple
at runtime | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by bgamari):
While playing around with the repro, I noticed that the issue is
reproducible if the `unsafeUpdateM` is performed, even if the resulting
`HashMap` doesn't refer to the old array. e.g.,
{{{#!hs
go h k x s t@(BitmapIndexed b ary)
| b .&. m == 0 = do
let ary' = A.insert ary i $! leaf h k x
return $! bitmapIndexedOrFull (b .|. m) ary'
| otherwise = do
st <- A.indexM ary i
st' <- rnf x `seq` go h k x (s+bitsPerSubkey) st
let !ary' = A.update ary i $! st'
A.unsafeUpdateM ary i st'
return $ BitmapIndexed b ary'
where m = mask h s
i = sparseIndex b m
}}}
I'm not yet sure whether this is a meaninfgul observation, but it is an
observation nonetheless.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13615#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list