[Git][ghc/ghc][master] perf tests: Move comments into new `Note [Sensitivity to unique increment]` (#19414)
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Thu Nov 30 17:37:46 UTC 2023
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
cbc03fa0 by Sebastian Graf at 2023-11-30T12:37:21-05:00
perf tests: Move comments into new `Note [Sensitivity to unique increment]` (#19414)
And additionally to T12545, link from T8095, T13386 to this new Note.
- - - - -
4 changed files:
- testsuite/tests/perf/compiler/T12545.hs
- testsuite/tests/perf/compiler/T13386.hs
- testsuite/tests/perf/compiler/T8095.hs
- testsuite/tests/perf/compiler/all.T
Changes:
=====================================
testsuite/tests/perf/compiler/T12545.hs
=====================================
@@ -15,6 +15,29 @@ type instance ElemsOf A = [ T1, T2, T3, T4, T5, T6, T7, T8
, T25, T26, T27, T28, T29, T30, T31, T32
]
+{- Note [Sensitivity to unique increment]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+T12545 is sensitive to -dunique-increments changes, see #19414. I've seen
+variations of as much as 4.8% by playing with that parameter.
+
+The issue with this test is that it does too little so is very sensitive to
+any small variations during initialisation and in particular populating the
+initial environments with wired-in things. Therefore it has a very high change
+threshold so we catch if it regresses a lot but don't worry if it regresses a little.
+
+You can measure the variance by running T12545.measure.sh.
+
+Whenever we identify such a test (T8095 being another example), we leave a link
+to this Note in the source code of the test *and* in the corresponding all.T,
+detailing the spread as measured by adjusting T12545.measure.sh.
+For example,
+
+# See Note [Sensitivity to unique increment] in T12545.hs; spread was 4.8%
+
+and then double the spread to come up with a stable acceptance threshold (e.g.,
+10%).
+-}
+
data T1; instance ElemOf A T1 where
data T2; instance ElemOf A T2 where
data T3; instance ElemOf A T3 where
=====================================
testsuite/tests/perf/compiler/T13386.hs
=====================================
@@ -1,6 +1,6 @@
{-# LANGUAGE DataKinds, TypeApplications, TypeFamilies, TypeOperators, UndecidableInstances #-}
{-# OPTIONS_GHC -O0 -freduction-depth=500 #-}
-
+-- Subject to Note [Sensitivity to unique increment] with spread of 1.5%
module T13386 where
import GHC.TypeLits
=====================================
testsuite/tests/perf/compiler/T8095.hs
=====================================
@@ -1,5 +1,6 @@
{-# OPTIONS_GHC -freduction-depth=1000 #-}
{-# LANGUAGE TypeOperators,DataKinds,KindSignatures,TypeFamilies,PolyKinds,UndecidableInstances #-}
+-- Subject to Note [Sensitivity to unique increment] with spread of 1.7%
import GHC.TypeLits
data Nat1 = Zero | Succ Nat1
type family Replicate1 (n :: Nat1) (x::a) :: [a]
@@ -16,4 +17,3 @@ instance (xs ~ Replicate1 ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ
f X = Y
f Y = X
test1 = f (X :: Data ( Replicate1 ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Succ ( Zero ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) () ))
-
=====================================
testsuite/tests/perf/compiler/all.T
=====================================
@@ -167,14 +167,18 @@ test('T9872d',
],
compile,
[''])
+# Since major improvements to T8095 in in
+# 4bf9fa0f216bb294c1bd3644363b008a8643a653 it is subject to
+# Note [Sensitivity to unique increment] in T12545.hs; spread was 1.7%
test ('T8095',
[ only_ways(['normal']),
- collect_compiler_stats('bytes allocated',2) ],
+ collect_compiler_stats('bytes allocated',4) ],
compile,
['-v0 -O'])
+# See Note [Sensitivity to unique increment] in T12545.hs; spread was 1.5%
test ('T13386',
[ only_ways(['normal']),
- collect_compiler_stats('bytes allocated',1) ],
+ collect_compiler_stats('bytes allocated',3) ],
compile,
['-v0 -O0'])
@@ -261,15 +265,7 @@ test('T12234',
compile,
[''])
-# T12545 is sensitive to -dunique-increments changes, see #19414. I've seen
-# variations of as much as 4.8% by playing with that parameter,
-#
-# The issue with the test is that it does too little so is very sensitive to
-# any small variations during initialisation and in particular populating the
-# initial environments with wired-in things. Therefore it has a very high change
-# threshold so we catch if it regresses a lot but don't worry if it regresses a little.
-#
-# You can measure the variance by running T12545.measure.sh.
+# See Note [Sensitivity to unique increment] in T12545.hs; spread was 4.8%
test('T12545',
[ only_ways(['normal']),
collect_compiler_stats('bytes allocated', 10), #
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cbc03fa0a2cf167d5c688f0f5bd4a2c9651888b3
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cbc03fa0a2cf167d5c688f0f5bd4a2c9651888b3
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/20231130/59c1cd7d/attachment-0001.html>
More information about the ghc-commits
mailing list