[Git][ghc/ghc][master] perf tests: Increase default stack size for MultiLayerModules

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Mon Jul 3 07:32:11 UTC 2023



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
32741743 by Alexis King at 2023-07-03T03:31:36-04:00
perf tests: Increase default stack size for MultiLayerModules

An unhelpfully small stack size appears to have been the real culprit
behind the metric fluctuations in #19293. Debugging metric decreases
triggered by !10729 helped to finally identify the problem.

Metric Decrease:
    MultiLayerModules
    MultiLayerModulesTH_Make
    T13701
    T14697

- - - - -


1 changed file:

- testsuite/tests/perf/compiler/all.T


Changes:

=====================================
testsuite/tests/perf/compiler/all.T
=====================================
@@ -315,11 +315,18 @@ test('T13379',
      compile,
      [''])
 
-# MultiLayerModules flip flops by 2.5%, depending on the
-# number of modules within GHC (#19293). Just widen the
-# acceptance window until we figured out how to fix it.
+# Note [Increased initial stack size for MultiLayerModules]
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# The MultiLayerModules test, and a few other tests like it, had a
+# tendency to fluctuate wildly with the default initial stack size of
+# 1k (see #19293), presumably because it creates threads that happen
+# to need very close to 1k of peak stack space. Increasing the initial
+# stack size to 2k via the -ki RTS option seems to avoid this problem
+# (though the size of the fluctuations does perhaps suggest that it
+# would be valuable to solve the pathology in a more general way).
+
 test('MultiLayerModules',
-     [ collect_compiler_stats('bytes allocated',3),
+     [ collect_compiler_stats('bytes allocated',2),
        pre_cmd('./genMultiLayerModules'),
        extra_files(['genMultiLayerModules']),
        compile_timeout_multiplier(5)
@@ -329,14 +336,12 @@ test('MultiLayerModules',
        # to complete successfully reliably everywhere.
      ],
      multimod_compile,
-     ['MultiLayerModules', '-v0'])
+     # see Note [Increased initial stack size for MultiLayerModules]
+     ['MultiLayerModules', '-v0 +RTS -ki2k -kb2k -RTS'])
 
 
-# MultiLayerModules flip flops by 2.5%, depending on the
-# number of modules within GHC (#19293). Just widen the
-# acceptance window until we figured out how to fix it.
 test('MultiLayerModulesRecomp',
-     [ collect_compiler_stats('bytes allocated',3),
+     [ collect_compiler_stats('bytes allocated',2),
        pre_cmd('$MAKE -s --no-print-directory MultiModulesRecomp'),
        extra_files(['genMultiLayerModules']),
        compile_timeout_multiplier(5)
@@ -346,30 +351,33 @@ test('MultiLayerModulesRecomp',
        # to complete successfully reliably everywhere.
      ],
      multimod_compile,
-     ['MultiLayerModules', '-v0'])
+     # see Note [Increased initial stack size for MultiLayerModules]
+     ['MultiLayerModules', '-v0 +RTS -ki2k -kb2k -RTS'])
 
 
 # A performance test for calculating link dependencies in --make mode.
 test('MultiLayerModulesTH_Make',
-     [ collect_compiler_stats('bytes allocated',3),
+     [ collect_compiler_stats('bytes allocated',2),
        pre_cmd('$MAKE -s --no-print-directory MultiLayerModulesTH_Make_Prep'),
        extra_files(['genMultiLayerModulesTH']),
        unless(have_dynamic(),skip),
        compile_timeout_multiplier(5)
      ],
      multimod_compile_fail,
-     ['MultiLayerModules', '-v0'])
+     # see Note [Increased initial stack size for MultiLayerModules]
+     ['MultiLayerModules', '-v0 +RTS -ki2k -kb2k -RTS'])
 
 # A performance test for calculating link dependencies in -c mode.
 test('MultiLayerModulesTH_OneShot',
-     [ collect_compiler_stats('bytes allocated',3),
+     [ collect_compiler_stats('bytes allocated',2),
        pre_cmd('$MAKE -s --no-print-directory MultiLayerModulesTH_OneShot_Prep'),
        extra_files(['genMultiLayerModulesTH']),
        unless(have_dynamic(),skip),
        compile_timeout_multiplier(5)
      ],
      compile_fail,
-     ['-v0'])
+     # see Note [Increased initial stack size for MultiLayerModules]
+     ['-v0 +RTS -ki2k -kb2k -RTS'])
 
 test('MultiLayerModulesDefsGhci',
      [ collect_compiler_residency(15),
@@ -466,7 +474,8 @@ test('T13701',
        # to complete successfully reliably everywhere.
      ],
      multimod_compile,
-     ['T13701', '-v0'])
+     # see Note [Increased initial stack size for MultiLayerModules]
+     ['T13701', '-v0 +RTS -ki2k -kb2k -RTS'])
 
 test('T13719',
      [ collect_compiler_stats('bytes allocated',2),
@@ -492,7 +501,8 @@ test('T14697',
        extra_hc_opts('$(cat T14697-flags)'), # 10k -optP arguments
      ],
      multimod_compile,
-     ['T14697', '-v0'])
+     # see Note [Increased initial stack size for MultiLayerModules]
+     ['T14697', '-v0 +RTS -ki2k -kb2k -RTS'])
 
 test('T14683',
      [ collect_compiler_stats('bytes allocated',2),
@@ -680,4 +690,3 @@ test('T22744',
      ],
      multimod_compile,
      ['T22744', '-v0'])
-



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3274174357871a83870ede78c3fac04cc4d3c04a

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3274174357871a83870ede78c3fac04cc4d3c04a
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230703/d7b60961/attachment-0001.html>


More information about the ghc-commits mailing list