[GHC] #11330: Test `dynamic-paper` fails with core lint error (hpc) and "Simplifier ticks exhausted" (optasm)
#11330: Test `dynamic-paper` fails with core lint error (hpc) and "Simplifier ticks exhausted" (optasm) -------------------------------------+------------------------------------- Reporter: thomie | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- {{{ $ ghc-head --info | grep Project [("Project name","The Glorious Glasgow Haskell Compilation System") ,("Project version","8.1.20151231") ,("Project Git commit id","8afeaad919dc67643b4eff14efafb48b59039b2b") }}} {{{ $ make slowtest TEST=dynamic-paper VERBOSE=2 TEST_HC=ghc-head ... =====> dynamic-paper(normal) 1 of 1 [0, 0, 0] =====> dynamic-paper(hpc) 1 of 1 [0, 0, 0] ... Compile failed (status 256) errors were: *** Core Lint errors : in result of Float out(FOS {Lam = Just 0, Consts = True, OverSatApps = True}) *** <no location info>: warning: In a case alternative: (TypeRepX k_s7Ec :: *, a_s7Ed :: k_a5px, tr2_s7Ee :: TypeRep a_s7Ed) @ k_a5px is out of scope *** Offending Program *** ... <no location info>: error: Compilation had errors *** unexpected failure for dynamic-paper(hpc) =====> dynamic-paper(optasm) 1 of 1 [0, 1, 0] Compile failed (status 256) errors were: ghc: panic! (the 'impossible' happened) (GHC version 8.1.20151231 for x86_64-unknown-linux): Simplifier ticks exhausted When trying UnfoldingDone delta1 To increase the limit, use -fsimpl-tick-factor=N (default 100) If you need to do this, let GHC HQ know, and what factor you needed To see detailed counts use -ddump-simpl-stats Total ticks: 203160 Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug *** unexpected failure for dynamic-paper(optasm) Unexpected results from: TEST="dynamic-paper" }}} This test was added in commit 52da6bdc17bb491d6d2f462b3680eb44b9be92e5: {{{ Author: Richard Eisenberg <eir@cis.upenn.edu> Date: Sat Dec 26 09:11:33 2015 -0500 Have mkCastTy look more closely for reflexivity. This may have performance implications. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11330> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11330: Test `dynamic-paper` fails with core lint error (hpc) and "Simplifier ticks exhausted" (optasm) -------------------------------------+------------------------------------- Reporter: thomie | Owner: Type: bug | Status: new Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | dependent/should_compile/dynamic- | paper Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * priority: normal => high * testcase: => dependent/should_compile/dynamic-paper Comment: Core lint errors are bad, raising priority. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11330#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11330: Test `dynamic-paper` fails with core lint error (hpc) and "Simplifier ticks exhausted" (optasm) -------------------------------------+------------------------------------- Reporter: thomie | Owner: simonpj Type: bug | Status: new Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | dependent/should_compile/dynamic- | paper Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * owner: => simonpj Comment: Right. The "simplifier ticks exhausted" error is expected; see Section 7 of [http://research.microsoft.com/en-us/um/people/simonpj/papers/haskell- dynamic/ the paper]. But the Lint error is an outright bug. I'm on it. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11330#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11330: Test `dynamic-paper` fails with core lint error (hpc) and "Simplifier ticks exhausted" (optasm) -------------------------------------+------------------------------------- Reporter: thomie | Owner: simonpj Type: bug | Status: new Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | dependent/should_compile/dynamic- | paper Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"016a0bd1ba129134dfa612db0d96e01644fa7b9f/ghc" 016a0bd1/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="016a0bd1ba129134dfa612db0d96e01644fa7b9f" Fix two cloning-related bugs Crikey! Not just one but two bugs in type variable cloning, both dating from the days before PolyKinds. Both were shown up by Trac #11330. 1. In SetLevels, when floating a case expression we must clone its binders, *and* do so in a telescope-aware way, because the constructor may bind a kind variable that appears in the kind of a type variable. Instead of doing this (wrongly) by steam, call CoreSubst.cloneBndrs. I added Notes and did other refactoring at the same time. 2. It turned out that CoreSubst.cloneBndrs calls TyCoRep.cloneTyVarBndr, and that too was bogus! It didn't substitute in the kind of the TyVar being cloned. There was even a comment to say "variables can't appear in kinds". Thta hasn't been true for a long time now. Easily fixed. Interestingly, I then found that test dependent/should_compile/KindEqualities was emitting a new inexhaustive-pattern-match warning. Sure enough it was valid! So the lack of cloning in cloneTyVarBndr really was causing an observable bug; just one that we had not observed. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11330#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11330: Test `dynamic-paper` fails with core lint error (hpc) and "Simplifier ticks exhausted" (optasm) -------------------------------------+------------------------------------- Reporter: thomie | Owner: simonpj Type: bug | Status: new Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | dependent/should_compile/dynamic- | paper Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"1c6d70c2121fd1126fcc2458bdbcc856e19598c2/ghc" 1c6d70c2/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="1c6d70c2121fd1126fcc2458bdbcc856e19598c2" Kill off zipTopTCvSubst in favour of zipOpenTCvSubst As Bartosz has discovered, the invariants for substitutions were wrong, and in particular the "mkTop...Subst" and "zipTop..Subst" functions were building substitutions that didn't obey even the old invariants. This patch kills of the bogus zipTopTCvSubst in favour of the more robust zipOpenTCvSubst. I tripped over this because my upcoming patch (concerning SetLevels, Trac #11330) triggered an ASSERT failure in the substitution well-formedness assertion in TyCoRep. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11330#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11330: Test `dynamic-paper` fails with core lint error (hpc) and "Simplifier ticks exhausted" (optasm) -------------------------------------+------------------------------------- Reporter: thomie | Owner: simonpj Type: bug | Status: merge Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | dependent/should_compile/dynamic- | paper Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => merge Comment: Seems like this is something we probably want in 8.0. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11330#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11330: Test `dynamic-paper` fails with core lint error (hpc) and "Simplifier ticks exhausted" (optasm) -------------------------------------+------------------------------------- Reporter: thomie | Owner: simonpj Type: bug | Status: merge Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | dependent/should_compile/dynamic- | paper Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Yes, do merge. The only test case I know of is `dynamic-paper` in way `hpc`. I might be able to cook up a simpler test case, but I'm out of time and the fix really has fixed it. So I'll leave it without adding a better regression test. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11330#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11330: Test `dynamic-paper` fails with core lint error (hpc) and "Simplifier ticks exhausted" (optasm) -------------------------------------+------------------------------------- Reporter: thomie | Owner: simonpj Type: bug | Status: closed Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | dependent/should_compile/dynamic- | paper Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged as c4e94cd3f1742cc5e2b8391d151fef2fc9f8fdbe and f47feda9c1a5298fbcf40a5aba87750d19e14157. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11330#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11330: Test `dynamic-paper` fails with core lint error (hpc) and "Simplifier ticks exhausted" (optasm) -------------------------------------+------------------------------------- Reporter: thomie | Owner: simonpj Type: bug | Status: closed Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | dependent/should_compile/dynamic- | paper Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Thomas Miedema <thomasmiedema@…>): In [changeset:"61e4d6b10e06e820d976137b223b1f4f6dbed2a6/ghc" 61e4d6b/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="61e4d6b10e06e820d976137b223b1f4f6dbed2a6" Mark dynamic-paper as expect_fail_for optasm and optllvm (#11330) It passes with `-O -fhpc` though, strange... (I didn't read the paper) }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11330#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11330: Test `dynamic-paper` fails with core lint error (hpc) and "Simplifier ticks exhausted" (optasm) -------------------------------------+------------------------------------- Reporter: thomie | Owner: simonpj Type: bug | Status: closed Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | dependent/should_compile/dynamic- | paper Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Just to be clear, the `expect_fail` is because of the issue in comment:2. The code says {{{ delta1 :: Dynamic -> Dynamic -- NB: this function behaves like a negative-recursive data type -- and hence leads compiler into an infinite inlining loop, -- and we get "simplifier ticks exhausted". -- See Section 7 of the paper "A reflection on types" delta1 dn = case fromDynamic dn of Just f -> f dn Nothing -> dn loop1 = delta1 (toDynamic delta1) }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11330#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11330: Test `dynamic-paper` fails with core lint error (hpc) and "Simplifier ticks exhausted" (optasm) -------------------------------------+------------------------------------- Reporter: thomie | Owner: simonpj Type: bug | Status: closed Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | dependent/should_compile/dynamic- | paper Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by alpmestan): I tried a `./validate --slow` with the `master` branch from today and this `dynamic-paper` test shows up as an "unexpected pass" for optasm and optllvm. I suppose one of the commits referenced here or even some other ones somehow make GHC use less ticks on that example? Should we now expect this test to pass? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11330#comment:10> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC