Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 5.6k
    • Issues 5.6k
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 667
    • Merge requests 667
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Model experiments
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #23469

Specialiser creates specialisation assuming local equality

Carrying on from #23109

I have extracted a reproducer for that issue which doesn't depend on anything in horde-ad so it's much simpler. It still needs to depend on the plugins though but I suspect that the plugin dependencies can also be removed.

https://github.com/mpickering/crispy-computing-machine

If you compile with ghc-9.6.1 you get

32
repro: Bad runtime result
CallStack (from HasCallStack):
  error, called at Main.hs:11:57 in main:Main

The problem is along the lines of:

  • In the call to spec we specialise tbuild' for @33 and @0.
  • In the body of $stbuild' (in the recursive call to the specialiser), in the binding of buildSh, there is a call to typeRep (Proxy @ix), the specialiser creates a bogus specialisation here.
"SPEC/TestHighRankSimplified typeNatTypeRep @_"
    forall (@(ipv_i1oF :: GHC.TypeNats.Nat))
           ($dKnownNat_s1HG :: GHC.TypeNats.KnownNat ipv_i1oF).
      base:Data.Typeable.Internal.typeNatTypeRep @ipv_i1oF
                                                 $dKnownNat_s1HG
      = $stypeNatTypeRep_s1HJ @ipv_i1oF
  • Then spec3 rewrites using this specialisation giving a bogus result.

Perhaps someone can help either removing the dependency on the plugins or further minimising it.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking