Opened 9 years ago

Closed 7 years ago

#5070 closed bug (fixed)

dph and new code generator don't play nicely with each other

Reported by: ezyang Owned by: benl
Priority: low Milestone: 7.8.1
Component: Data Parallel Haskell Version: 7.0.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect result at runtime Test Case:
Blocked By: #5065 Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


I'm looking at the current failure of DPH with the new code generator, which is a bit different from what I've dealt with before. The bug appears to be in the compiled libraries code, and I can tickle it with the following minimized example:

    {-# LANGUAGE ParallelArrays #-}
    {-# OPTIONS -fvectorise #-}
    module PrimesVect where

    import Data.Array.Parallel.Prelude
    import qualified Prelude          
    f :: PArray Bool        
    f = toPArrayP f'

    f' :: [:Bool:]
    f' = [: True | _ <- singletonP True, g emptyP:]

    g :: [:Bool:] -> Bool
    g ps = andP [: True | _ <- ps:]

and a runner:

    import qualified Data.Array.Parallel.PArray as P
    import PrimesVect

    main = print (P.toList f)

I expect to get [True], but instead I get:

    dph-primespj-fast: libraries/vector/Data/Vector/Generic.hs:369 (slice): invalid slice (0,1,0)
    dph-primespj-fast: thread blocked indefinitely in an MVar operation

Now, in the situation that the library code is broken, I'd usually try to inline all of the library code and then pare that down into something manageable. Unfortunately, DPH is pretty closely tied to the compiler, so I don't see an easy way to do that. So I'm not really sure how to go about debugging this.

Note that we can't work on this bug until #5065 is resolved, since these tests are currently failing for unrelated reasons.

Change History (10)

comment:1 Changed 9 years ago by igloo

Milestone: 7.2.1

comment:2 Changed 9 years ago by

May or may not be the same cause, dph-words-opt(normal) failed with

Wrong exit code (expected 0 , actual 1 )

dph-words-opt: libraries/vector/Data/Vector/Generic.hs:369 (slice): invalid slice (1,2,2)

*** unexpected failure for dph-words-opt(normal)

on today's HEAD (7.1.20110509).

comment:3 Changed 9 years ago by simonpj

Owner: set to benl

comment:4 Changed 9 years ago by chak

dph-primespj-fast works again. What remains of #5065 shouldn't block this issue anymore.

comment:5 Changed 8 years ago by igloo


comment:6 Changed 8 years ago by igloo

Priority: normallow

comment:7 Changed 7 years ago by igloo


comment:8 Changed 7 years ago by benl

Blocked By: 7330 added

comment:9 Changed 7 years ago by simonmar

Blocked By: 7330 removed
difficulty: Unknown

comment:10 Changed 7 years ago by simonmar

Resolution: fixed
Status: newclosed

As far as I know, DPH and the new code generator now get along just fine. At least, the tests all pass, so I'm closing this ticket. Also the ticket is on the wrong milestone, because the new codegen was not working in 7.6. Please re-open if you find a problem in HEAD.

Note: See TracTickets for help on using tickets.