Any ideas on what to do with this error message

#47 343.7 app> <no location info>: error:
#47 343.7 app>     /compiler/GHC/Core/Opt/Simplify/Iteration.hs:3722:15-36: Non-exhaustive patterns in dmd : cont_dmds

EDITED:

Compiling on ghc 9.6.3, with stack 2.13.1 with resolver: nightly-2023-10-22, on OSX Sonoma 14.2 on M1 Ultra Works, but it’s failing on Github CI and also if I try to compile via Docker. An example failing run is in my comment below.

Seems like that may be a bug in GHC. What are you compiling?

2 Likes
mkDupableContWithDmds
   :: SimplEnv  -> [Demand]  -- Demands on arguments; always infinite
   -> SimplCont -> SimplM ( SimplFloats, SimplCont)
mkDupableContWithDmds env dmds (ApplyToVal{..}) = do
    let (dmd:cont_dmds) = dmds   -- Never fails
    -- ...etc

Welp, found the code :laughing:
Proving the comments wrong, it seems.

5 Likes

I’m compiling my project here: GitHub - halogenandtoast/ArkhamHorror: A rules-compliant browser based version of Arkham Horror: The Card Game.

The failure shows up here: Stuff · halogenandtoast/ArkhamHorror@c3f3e6d · GitHub
And locally when compiling with Docker locally, but actually doesn’t show up when I compile it directly (so my original comment is misleading).

I think it would be best to open an issue on GHC’s issue tracker: Issues · Glasgow Haskell Compiler / GHC · GitLab

The problematic Haskell code seems to be somewhere in Arkham.Game. It would be ideal if you could make a smaller reproducer, but that may not be very easy.

1 Like

Yeah I’d like to create a way to reproduce, but it is entirely unclear as to why this is happening. The commit that introduced this first seems innocuous with regards to the changes in Game.hs

Are there any suggestions for verbosity flags I should use to maybe get more info about how the simplifier is failing here?

-dshow-passes doesn’t really add a lot more information:

arkham-core> *** Simplifier [Arkham.Game]:
arkham-core> Result size of Simplifier iteration=1
arkham-core>   = {terms: 279,674,
arkham-core>      types: 399,126,
arkham-core>      coercions: 101,721,
arkham-core>      joins: 799/8,029}
arkham-core>
arkham-core> <no location info>: error:
arkham-core>     /Users/halogenandtoast/Code/ArkhamHorror/
hs:3722:15-36: Non-exhaustive patterns in dmd : cont_dmds

I don’t know a good way to create a minimal case. For the time being, I was able to solve my issue by splitting up the module into 3 modules instead.