[GHC] #8990: Performance tests behave differently depending on presence of .hi file (even with -fforce-recomp)

#8990: Performance tests behave differently depending on presence of .hi file (even with -fforce-recomp) ------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.9 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- Example: {{{ [ezyang@hs01 compiler]$ cat T6048.comp.stats /home/hs01/ezyang/ghc-compalloc/inplace/lib/bin/ghc-stage2 -B/home/hs01/ezyang/ghc-compalloc/inplace/lib -fforce-recomp -dno-debug- output -no-user-package-db -rtsopts -fno-ghci-history -c T6048.hs -O -fasm +RTS -V0 -tT6048.comp.stats --machine-readable [("bytes allocated", "119871672") ,("num_GCs", "100") ,("average_bytes_used", "4388904") ,("max_bytes_used", "12539576") ,("num_byte_usage_samples", "7") ,("peak_megabytes_allocated", "27") ,("init_cpu_seconds", "0.00") ,("init_wall_seconds", "0.00") ,("mutator_cpu_seconds", "0.09") ,("mutator_wall_seconds", "0.10") ,("GC_cpu_seconds", "0.15") ,("GC_wall_seconds", "0.15") ] [ezyang@hs01 compiler]$ rm T6048.hi [ezyang@hs01 compiler]$ '/home/hs01/ezyang/ghc-compalloc/inplace/bin/ghc- stage2' -fforce-recomp -dno-debug-output -no-user-package-db -rtsopts -fno-ghci-history -c T6048.hs -O -fasm +RTS -V0 -tT6048.comp.stats --machine-readable -RTS [ezyang@hs01 compiler]$ cat T6048.comp.stats /home/hs01/ezyang/ghc-compalloc/inplace/lib/bin/ghc-stage2 -B/home/hs01/ezyang/ghc-compalloc/inplace/lib -fforce-recomp -dno-debug- output -no-user-package-db -rtsopts -fno-ghci-history -c T6048.hs -O -fasm +RTS -V0 -tT6048.comp.stats --machine-readable [("bytes allocated", "121022912") ,("num_GCs", "100") ,("average_bytes_used", "4022069") ,("max_bytes_used", "11224944") ,("num_byte_usage_samples", "7") ,("peak_megabytes_allocated", "25") ,("init_cpu_seconds", "0.00") ,("init_wall_seconds", "0.00") ,("mutator_cpu_seconds", "0.09") ,("mutator_wall_seconds", "0.11") ,("GC_cpu_seconds", "0.15") ,("GC_wall_seconds", "0.14") ] }}} It's a slight but present difference: I noticed because one of the perf tests was failing on an initial run of the test suite, but passing when I re-ran it. There are two possible bugs here. One is that our implementation of `-fforce-recomp` is buggy and we shouldn't be reading in the hi file at all if `-fforce-recomp` is on; the other is that we should always clean up interface files before running one of these perf tests. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8990 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8990: Performance tests behave differently depending on presence of .hi file (even with -fforce-recomp) -------------------------------------+------------------------------------ Reporter: ezyang | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.9 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by simonpj): Yes, I expect that we are reading the old interface file even if `-fforce- recomp` is on. It's a bit of a corner case, but I'd be happy to see it fixed if someone would like to construct a patch to stop that happening, and it's not too painful in code terms. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8990#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8990: Performance tests behave differently depending on presence of .hi file (even with -fforce-recomp) -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.9 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * keywords: => newcomer Comment: Look in the `compiler/main` directory. Grep for `ForceRecomp`. Try to figure out what's going on (will take you a while). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8990#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8990: Performance tests behave differently depending on presence of .hi file (even with -fforce-recomp) -------------------------------------+------------------------------------- Reporter: ezyang | Owner: przembot Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.9 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by przembot): * owner: => przembot -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8990#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8990: Performance tests behave differently depending on presence of .hi file (even with -fforce-recomp) -------------------------------------+------------------------------------- Reporter: ezyang | Owner: przembot Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.9 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by ezyang): I found another case recently where this matters: whether or not an interface file is loaded can affect the assignment of uniques, which in turn can cause rules to fire in a different order. (in my case, it was `T7837` with the patchset I've been developing for #10871). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8990#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8990: Performance tests behave differently depending on presence of .hi file (even with -fforce-recomp) -------------------------------------+------------------------------------- Reporter: ezyang | Owner: przembot Type: bug | Status: patch Priority: normal | Milestone: 8.0.1 Component: Test Suite | Version: 7.9 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1267 -------------------------------------+------------------------------------- Changes (by thomie): * status: new => patch * differential: => Phab:D1267 * milestone: => 8.0.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8990#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8990: Performance tests behave differently depending on presence of .hi file (even with -fforce-recomp) -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Test Suite | Version: 7.9 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by ezyang): * owner: przembot => * status: patch => new * differential: Phab:D1267 => Comment: On the Phabricator CR, Simon Marlow pointed out that pretending the interface file doesn't exist when forcing recompilation can result in gratuitous changes to the timestamp on the interface file. So we can't take this approach; let's just remove hi files before perf tests. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8990#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8990: Performance tests behave differently depending on presence of .hi file (even with -fforce-recomp) -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.9 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by akst): Hi, I was directed here from newcomers page. Just to clarify `ForceRecomp` is a constructor of `GeneralFlag`, and `Frorcerecomp` is actually `Opt_ ForceRecomp` now? Or should that be disregarded as the most recent suggestion on the issue is too "just remove hi files before perf tests"? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8990#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8990: Performance tests behave differently depending on presence of .hi file (even with -fforce-recomp) -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.9 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by thomie): You can ignore the hint about `Opt_ ForceRecomp`. One possible solution: * Add `-no-keep-hi-files` (see #4114) for performance tests to the function `get_compiler_flags` in the file `testsuite/driver/testlib.py`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8990#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8990: Performance tests behave differently depending on presence of .hi file (even with -fforce-recomp) -------------------------------------+------------------------------------- Reporter: ezyang | Owner: thomie Type: bug | Status: new Priority: normal | Milestone: Component: Test Suite | Version: 7.9 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1187 Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * keywords: newcomer => * owner: => thomie * differential: => Phab:D1187 Comment: I think Phab:D1187 will fix this one as well. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8990#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8990: Performance tests behave differently depending on presence of .hi file (even with -fforce-recomp) -------------------------------------+------------------------------------- Reporter: ezyang | Owner: thomie Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Test Suite | Version: 7.9 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1187 Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * status: new => closed * resolution: => fixed * milestone: => 8.2.1 Comment: Fixed by running each test in a fresh `/tmp` directory (#11980). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8990#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC