[GHC] #15058: scc001 unexpected passes in prof way on CircleCI

#15058: scc001 unexpected passes in prof way on CircleCI -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: #10037 Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- This should supposedly fail due to #10037. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15058 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15058: scc001 unexpected passes in prof way on CircleCI -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #10037 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Moreover, it unexpectedly fails in the `profasm` way: {{{ Actual prof output differs from expected: --- ./profiling/should_run/scc001.run/scc001.prof.sample.normalised 2018-04-19 14:18:58.342922502 +0000 +++ ./profiling/should_run/scc001.run/scc001.prof.normalised 2018-04-19 14:18:58.342922502 +0000 @@ -1,5 +1,5 @@ MAIN MAIN <built-in> 0 (...) Main scc001.hs:16:1-16 1 -h Main scc001.hs:16:1-16 1 f Main scc001.hs:10:1-7 1 g Main scc001.hs:13:1-7 1 +h Main scc001.hs:16:1-16 1 *** unexpected failure for scc001(profasm) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15058#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15058: scc001 unexpected passes in prof way on CircleCI -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #10037 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): See, for instance, https://circleci.com/gh/ghc/ghc/3654. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15058#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15058: scc001 unexpected passes in prof way on CircleCI -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #10037 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): This also fails on i386; see https://circleci.com/gh/ghc/ghc/3655. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15058#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15058: scc001 unexpected passes in prof way on CircleCI -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #10037, #4012, | Differential Rev(s): #12935 | Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * related: #10037 => #10037, #4012, #12935 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15058#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15058: scc001 unexpected passes in prof way on CircleCI -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: ci-breakage Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #10037, #4012, | Differential Rev(s): #12935 | Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * keywords: => ci-breakage -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15058#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15058: scc001 unexpected passes in prof way on CircleCI -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: closed Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: fixed | Keywords: ci-breakage Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #10037 | Differential Rev(s): Phab:D4712 Wiki Page: | -------------------------------------+------------------------------------- Changes (by osa1): * status: new => closed * differential: => Phab:D4712 * resolution: => fixed * related: #10037, #4012, #12935 => #10037 Old description:
This should supposedly fail due to #10037.
New description: This was already fixed with c4219d9f7d1, but I realized this too late and actually debugged this. See below for my summary. This is also not related with #4012 (different optimization parameters of course result in different compiled code) and #12935 (Core outputs are different, not related with object code) so removing those from "related tickets". ---- The diff is not helpful because it doesn't show the original output and expected files so we miss some context. Basically with `-O0` (default, prof way) `h` is top level and gets a cost centre accordingly, but with `-O` (profasm way) it's inlined with its SCC. With -O0 (default, prof way): {{{ h_rsH = scctick<h> case ds_r1I1 of { (h1_a1qY) -> h1_a1qY } main :: IO () main = scctick<main> >> GHC.Base.$fMonadIO ($ (print GHC.Show.$fShowBool) (tick<f> GHC.Types.True)) (>> GHC.Base.$fMonadIO ($ (print GHC.Show.$fShowInt) (tick<g> GHC.Types.I# 3#)) ($ (print GHC.Show.$fShowChar) (h_rsH (GHC.Types.C# 'a'#)))) }}} With -O (profasm WAY): {{{ Main.main2 = scc<main> tick<h> case Main.main5 of { (h_a1se) -> case scc<h> h_a1se Main.main4 of { GHC.Types.C# ds1_a1Zn -> case ds1_a1Zn of ds2_a1Zp { __DEFAULT -> GHC.Types.: GHC.Show.$fShowChar3 (GHC.Show.$wshowLitChar ds2_a1Zp Main.main3); '\''# -> GHC.Show.$fShowChar1 } } } }}} And profiling outputs are correct in both cases. prof way: (h is a CAF) {{{ COST CENTRE MODULE SRC no. entries %time %alloc %time %alloc MAIN MAIN <built-in> 115 0 0.0 1.2 0.0 100.0 CAF Main <entire-module> 229 0 0.0 0.1 0.0 1.5 (...) Main scc001.hs:16:1-16 235 1 0.0 0.0 0.0 0.0 h Main scc001.hs:16:1-16 234 1 0.0 0.0 0.0 0.0 main Main scc001.hs:(5,1)-(7,23) 230 1 0.0 1.4 0.0 1.4 f Main scc001.hs:10:1-7 232 1 0.0 0.0 0.0 0.0 g Main scc001.hs:13:1-7 233 1 0.0 0.0 0.0 0.0 }}} profasm way: (h is inlined, no CAFs for it) {{{ COST CENTRE MODULE SRC no. entries %time %alloc %time %alloc MAIN MAIN <built-in> 115 0 0.0 1.2 0.0 100.0 CAF Main <entire-module> 229 0 0.0 0.1 0.0 0.3 (...) Main scc001.hs:16:1-16 235 1 0.0 0.0 0.0 0.0 main Main scc001.hs:(5,1)-(7,23) 230 1 0.0 0.3 0.0 0.3 g Main scc001.hs:13:1-7 233 1 0.0 0.0 0.0 0.0 h Main scc001.hs:16:1-16 234 1 0.0 0.0 0.0 0.0 }}} Some ways to fix: - If we really want to test this with multiple ways, use two different tests depending on whether the ways add -O or not. Use two different prof.sample files. - Only test with ways that add or don't add -O, use single prof.sample. I don't understand why scc001 is considered as "unexpected pass" in the summary in CircleCI link above. In the logs I see that it actually failed, and I don't see any unexpected passes. -- Comment: This was already fixed with c4219d9f7d1, but I realized this too late (why is this ticket submitted after that patch?) and actually debugged this. See below for my summary. This is also not related with #4012 (different optimization parameters will of course give different compiled code) and #12935 (Core outputs are different, not related with object code) so removing those from "related tickets". ---- The diff is not helpful because it doesn't show the original output and expected files so we miss some context. Basically with `-O0` (default, prof way) `h` is top level and gets a cost centre accordingly, but with `-O` (profasm way) it's inlined with its SCC. With -O0 (default, prof way): {{{ h_rsH = scctick<h> case ds_r1I1 of { (h1_a1qY) -> h1_a1qY } main :: IO () main = scctick<main> >> GHC.Base.$fMonadIO ($ (print GHC.Show.$fShowBool) (tick<f> GHC.Types.True)) (>> GHC.Base.$fMonadIO ($ (print GHC.Show.$fShowInt) (tick<g> GHC.Types.I# 3#)) ($ (print GHC.Show.$fShowChar) (h_rsH (GHC.Types.C# 'a'#)))) }}} With -O (profasm WAY): {{{ Main.main2 = scc<main> tick<h> case Main.main5 of { (h_a1se) -> case scc<h> h_a1se Main.main4 of { GHC.Types.C# ds1_a1Zn -> case ds1_a1Zn of ds2_a1Zp { __DEFAULT -> GHC.Types.: GHC.Show.$fShowChar3 (GHC.Show.$wshowLitChar ds2_a1Zp Main.main3); '\''# -> GHC.Show.$fShowChar1 } } } }}} And profiling outputs are correct in both cases. prof way: (h is a CAF) {{{ COST CENTRE MODULE SRC no. entries %time %alloc %time %alloc MAIN MAIN <built-in> 115 0 0.0 1.2 0.0 100.0 CAF Main <entire-module> 229 0 0.0 0.1 0.0 1.5 (...) Main scc001.hs:16:1-16 235 1 0.0 0.0 0.0 0.0 h Main scc001.hs:16:1-16 234 1 0.0 0.0 0.0 0.0 main Main scc001.hs:(5,1)-(7,23) 230 1 0.0 1.4 0.0 1.4 f Main scc001.hs:10:1-7 232 1 0.0 0.0 0.0 0.0 g Main scc001.hs:13:1-7 233 1 0.0 0.0 0.0 0.0 }}} profasm way: (h is inlined, no CAFs for it) {{{ COST CENTRE MODULE SRC no. entries %time %alloc %time %alloc MAIN MAIN <built-in> 115 0 0.0 1.2 0.0 100.0 CAF Main <entire-module> 229 0 0.0 0.1 0.0 0.3 (...) Main scc001.hs:16:1-16 235 1 0.0 0.0 0.0 0.0 main Main scc001.hs:(5,1)-(7,23) 230 1 0.0 0.3 0.0 0.3 g Main scc001.hs:13:1-7 233 1 0.0 0.0 0.0 0.0 h Main scc001.hs:16:1-16 234 1 0.0 0.0 0.0 0.0 }}} Some ways to fix: - If we really want to test this with multiple ways, use two different tests depending on whether the ways add -O or not. Use two different prof.sample files. - Only test with ways that add or don't add -O, use single prof.sample. I don't understand why scc001 is considered as "unexpected pass" in the summary in CircleCI link above. In the logs I see that it actually failed, and I don't see any unexpected passes. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15058#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15058: scc001 unexpected passes in prof way on CircleCI -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: closed Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: fixed | Keywords: ci-breakage Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #10037 | Differential Rev(s): Phab:D4712 Wiki Page: | -------------------------------------+------------------------------------- Description changed by osa1: Old description:
This was already fixed with c4219d9f7d1, but I realized this too late and actually debugged this. See below for my summary.
This is also not related with #4012 (different optimization parameters of course result in different compiled code) and #12935 (Core outputs are different, not related with object code) so removing those from "related tickets".
----
The diff is not helpful because it doesn't show the original output and expected files so we miss some context. Basically with `-O0` (default, prof way) `h` is top level and gets a cost centre accordingly, but with `-O` (profasm way) it's inlined with its SCC.
With -O0 (default, prof way):
{{{ h_rsH = scctick<h> case ds_r1I1 of { (h1_a1qY) -> h1_a1qY }
main :: IO () main = scctick<main> >> GHC.Base.$fMonadIO ($ (print GHC.Show.$fShowBool) (tick<f> GHC.Types.True)) (>> GHC.Base.$fMonadIO ($ (print GHC.Show.$fShowInt) (tick<g> GHC.Types.I# 3#)) ($ (print GHC.Show.$fShowChar) (h_rsH (GHC.Types.C# 'a'#)))) }}}
With -O (profasm WAY):
{{{ Main.main2 = scc<main> tick<h> case Main.main5 of { (h_a1se) -> case scc<h> h_a1se Main.main4 of { GHC.Types.C# ds1_a1Zn -> case ds1_a1Zn of ds2_a1Zp { __DEFAULT -> GHC.Types.: GHC.Show.$fShowChar3 (GHC.Show.$wshowLitChar ds2_a1Zp Main.main3); '\''# -> GHC.Show.$fShowChar1 } } } }}}
And profiling outputs are correct in both cases. prof way: (h is a CAF)
{{{ COST CENTRE MODULE SRC no. entries %time %alloc %time %alloc
MAIN MAIN <built-in> 115 0 0.0 1.2 0.0 100.0 CAF Main <entire-module> 229 0 0.0 0.1 0.0 1.5 (...) Main scc001.hs:16:1-16 235 1 0.0 0.0 0.0 0.0 h Main scc001.hs:16:1-16 234 1 0.0 0.0 0.0 0.0 main Main scc001.hs:(5,1)-(7,23) 230 1 0.0 1.4 0.0 1.4 f Main scc001.hs:10:1-7 232 1 0.0 0.0 0.0 0.0 g Main scc001.hs:13:1-7 233 1 0.0 0.0 0.0 0.0 }}}
profasm way: (h is inlined, no CAFs for it)
{{{ COST CENTRE MODULE SRC no. entries %time %alloc %time %alloc
MAIN MAIN <built-in> 115 0 0.0 1.2 0.0 100.0 CAF Main <entire-module> 229 0 0.0 0.1 0.0 0.3 (...) Main scc001.hs:16:1-16 235 1 0.0 0.0 0.0 0.0 main Main scc001.hs:(5,1)-(7,23) 230 1 0.0 0.3 0.0 0.3 g Main scc001.hs:13:1-7 233 1 0.0 0.0 0.0 0.0 h Main scc001.hs:16:1-16 234 1 0.0 0.0 0.0 0.0 }}}
Some ways to fix:
- If we really want to test this with multiple ways, use two different tests depending on whether the ways add -O or not. Use two different prof.sample files. - Only test with ways that add or don't add -O, use single prof.sample.
I don't understand why scc001 is considered as "unexpected pass" in the summary in CircleCI link above. In the logs I see that it actually failed, and I don't see any unexpected passes.
New description: This should supposedly fail due to #10037. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15058#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15058: scc001 unexpected passes in prof way on CircleCI -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: closed Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: fixed | Keywords: ci-breakage Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #10037 | Differential Rev(s): Phab:D4712 Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): (I was modifying the ticket while also adding a new comment, and accidentally updated the wrong form and updated ticket description. I now reverted it, sorry for the noise) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15058#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC