@@ -25,7 +25,7 @@ to let us know. If possible, try to:
2525
2626## Your first Pull Request
2727
28- We are thrilled to get PRs! Please follow these guidelines, as doing so will increase the chances of
28+ We are thrilled to get PRs! Please follow these guidelines, as doing so will increase the chances of
2929having your PR accepted:
3030
3131* The main LH repo [ lives here] ( https://github.com/ucsd-progsys/liquidhaskell )
@@ -98,7 +98,7 @@ It's also possible (but not recommended) to add `LIQUID_DEV_MODE` to .bashrc or
9898permanently disable building the ` liquid-* ` packages, and this might silently mask breaking changes to the
9999` liquidhaskell ` library that would manifest only when compiling these other packages.
100100
101- If you wish to force building all the libraries again, it's sufficient to issue the same builds commands
101+ If you wish to force building all the libraries again, it's sufficient to issue the same builds commands
102102without the ` LIQUID_DEV_MODE ` .
103103
104104## How To Run Regression Tests
@@ -115,7 +115,7 @@ You can run a bunch of particular test-groups instead by
115115
116116 $ LIQUID_DEV_MODE=true ./scripts/test/test_plugin.sh <test-group-name1> <test-group-name2> ...
117117
118- and you can list all the possible test options with
118+ and you can list all the possible test options with
119119
120120 $ LIQUID_DEV_MODE=true ./scripts/test/test_plugin.sh --help
121121
@@ -147,8 +147,8 @@ When `liquidhaskell` tests run, we can collect timing information with
147147
148148 $ ./scripts/test/test_plugin.sh --measure-timings
149149
150- Measures will be collected in ` .dump-timings ` files. These can be converted to json
151- data with
150+ Measures will be collected in ` .dump-timings ` files under ` dist-newstyle ` directory . These can be
151+ converted to json data with
152152
153153``` bash
154154cabal v2-build ghc-timings
@@ -163,16 +163,26 @@ cabal v2-run benchmark-timings -- tmp/*.json --phase LiquidHaskell -o summary.cs
163163```
164164On each line, the report will contain the time taken by each test.
165165
166- There is a script ` scripts/plot-performance/chart_perf.sh ` that can be
167- used to generate comparison charts in ` svg ` and ` png ` formats. It
168- requires [ gnuplot] ( http://www.gnuplot.info/ ) to run. The following
169- command will produce two files ` perf.svg ` and ` perf.png ` in the
170- current directory.
166+ Comparison charts in ` svg ` format can be generated by invoking
167+
168+ ```
169+ cabal v2-run plot-performance -- -b path_to_before_summary.csv -a path_to_after_summary.csv -s 50 -f "benchmark" -o outdir
170+ ```
171+
172+ This will generate three files ` filtered.svg ` (a subset of tests with a ` benchmark ` prefix, enabled by the ` -f ` option),
173+ ` top.svg ` and ` bot.svg ` (top 50 speedups and slowdowns over the entire test set, both enabled by the ` -s ` option) under
174+ the ` outdir ` directory. The ` -f ` and ` -s ` options can be used/omitted independently. If both are omitted, a single
175+ ` perf.svg ` will be produced covering the full input test set. Additionally, their effects can be combined by providing
176+ a third ` -c ` option (this will produce 2 files ` filtered-top.svg ` and ` filtered-bot.svg ` instead of 3).
177+
178+ There is also a legacy script ` scripts/plot-performance/chart_perf.sh ` that can be used to generate comparison charts
179+ in both ` svg ` and ` png ` formats. It requires [ gnuplot] ( http://www.gnuplot.info/ ) to run and assumes both files contain
180+ the same test set. The following command will produce two files ` perf.svg ` and ` perf.png ` in the current directory.
171181
172182 $ scripts/plot-performance/chart_perf.sh path_to_before_summary.csv path_to_after_summary.csv
173183
174- The current formatting is optimized for comparing the outputs of running
175- the benchmarks alone.
184+ The current formatting is optimized for comparing some subsets of the full test run, typically just the benchmarks alone.
185+ If one wishes to save time or is not interested in top speedups/slowdowns, the benchmark subset can be obtained by running
176186
177187 $ scripts/test/test_plugin.sh \
178188 benchmark-stitch-lh \
@@ -185,7 +195,7 @@ the benchmarks alone.
185195
186196## Miscelaneous tasks
187197
188- * ** Profiling** See the instructions in [ scripts/ProfilingDriver.hs] [ ] .
198+ * ** Profiling** See the instructions in [ scripts/ProfilingDriver.hs] ( scripts/ProfilingDriver.hs ) .
189199* ** Getting stack traces on exceptions** See ` -xc ` flag in the [ GHC user's guide] [ ghc-users-guide ] .
190200* ** Working with submodules** See ` man gitsubmodules ` or the [ git documentation site] [ git-documentation ] .
191201
@@ -338,7 +348,7 @@ any `LiftedSpec` from the interface file's annotations.
338348Typically the first thing you might want to do is to run a "clean" ` cabal v2-build ` or ` stack build ` using
339349the latest compiler and "check the damage". If you are lucky, everything works out of the box, otherwise
340350compilation might fail with an error, typically because some ` ghc ` API function has been removed/moved/renamed.
341- The way to fix it is to modify the [ GHC.API] [ ] shim module and perform any required change, likely by
351+ The way to fix it is to modify the [ GHC.API] [ ] shim module and perform any required change, likely by
342352conditionally compiling some code in a ` CPP ` block. For minor changes, it's usually enough to perform small
343353changes, but for more tricky migrations it might be necessary to backport some GHC code, or create some
344354patter synonym to deal with changes in type constructors.
@@ -348,8 +358,6 @@ patter synonym to deal with changes in type constructors.
348358Currently, no. Only one version of GHC is supported and that is the one
349359that can be tested with ` ./scripts/test/test_plugin.sh ` .
350360
351- [ GHC.API ] : src-ghc/Liquid/GHC/API.hs
352-
353361# GHC Plugin Development FAQs
354362
355363## Why is the GHC.Interface using slightly different types than the GHC.Plugin module?
@@ -361,24 +369,24 @@ to map back and forth (sometimes in a partial way) between old and new data stru
361369** consider the GHC.Plugin as the single source of truth, and prefer whichever data structure the latter is
362370using** .
363371
364-
365- [ Plugin ] : src/Language/Haskell/Liquid/GHC/Plugin.hs
366- [ GHC.Plugin ] : src/Language/Haskell/Liquid/GHC/Plugin.hs
367- [ GHC.Interface ] : src-ghc/Liquid/GHC/Interface.hs
368- [ SpecFinder ] : src/Language/Haskell/Liquid/GHC/Plugin/SpecFinder.hs
369- [ BareSpec ] : src/Language/Haskell/Liquid/Types/Specs.hs#L361
370- [ LiftedSpec ] : src/Language/Haskell/Liquid/Types/Specs.hs#L554
371- [ TargetSrc ] : src/Language/Haskell/Liquid/Types/Specs.hs#L157
372- [ Ghc monad ] : https://hackage.haskell.org/package/ghc-8.10.1 /docs/GHC.html#t:Ghc
373- [ HscEnv ] : https://hackage.haskell.org/package/ghc-8.10.1 /docs/GHC.html#t:HscEnv
374- [ DynFlags ] : https://hackage.haskell.org/package/ghc-8.10.1 /docs/GHC.html#t:DynFlags
375- [ GhcMonad ] : https://hackage.haskell.org/package/ghc-8.10.1 /docs/GHC.html#t:GhcMonad
376- [ GhcMonadLike ] : src-ghc/Liquid/GHC/GhcMonadLike.hs
377- [ typechecking phase ] : src/Language/Haskell/Liquid/GHC/Plugin.hs#L206-L222
372+ [ GHC.API ] : liquidhaskell-boot/src-ghc/Liquid/GHC/API.hs
373+ [ Plugin ] : liquidhaskell-boot/ src/Language/Haskell/Liquid/GHC/Plugin.hs
374+ [ GHC.Plugin ] : liquidhaskell-boot/ src/Language/Haskell/Liquid/GHC/Plugin.hs
375+ [ GHC.Interface ] : liquidhaskell-boot/ src-ghc/Liquid/GHC/Interface.hs
376+ [ SpecFinder ] : liquidhaskell-boot/ src/Language/Haskell/Liquid/GHC/Plugin/SpecFinder.hs
377+ [ BareSpec ] : liquidhaskell-boot/ src/Language/Haskell/Liquid/Types/Specs.hs#L362
378+ [ LiftedSpec ] : liquidhaskell-boot/ src/Language/Haskell/Liquid/Types/Specs.hs#L559
379+ [ TargetSrc ] : liquidhaskell-boot/ src/Language/Haskell/Liquid/Types/Specs.hs#L158
380+ [ Ghc monad ] : https://hackage.haskell.org/package/ghc-9.2.5 /docs/GHC.html#t:Ghc
381+ [ HscEnv ] : https://hackage.haskell.org/package/ghc-9.2.5 /docs/GHC.html#t:HscEnv
382+ [ DynFlags ] : https://hackage.haskell.org/package/ghc-9.2.5 /docs/GHC.html#t:DynFlags
383+ [ GhcMonad ] : https://hackage.haskell.org/package/ghc-9.2.5 /docs/GHC.html#t:GhcMonad
384+ [ GhcMonadLike ] : liquidhaskell-boot/ src-ghc/Liquid/GHC/GhcMonadLike.hs
385+ [ typechecking phase ] : liquidhaskell-boot/ src/Language/Haskell/Liquid/GHC/Plugin.hs#L211-L226
378386[ ghcide ] : https://github.com/haskell/ghcide
379- [ findRelevantSpecs ] : src/Language/Haskell/Liquid/GHC/Plugin/SpecFinder.hs#L61
380- [ core binds ] : https://hackage.haskell.org/package/ghc-8.10.1 /docs/CoreSyn.html#t:CoreBind
381- [ configureGhcTargets ] : src-ghc/Liquid/GHC/Interface.hs#L252
382- [ processTargetModule ] : src-ghc/Liquid/GHC/Interface.hs#L481
383- [ processModule ] : src/Language/Haskell/Liquid/GHC/Plugin.hs#L393
387+ [ findRelevantSpecs ] : liquidhaskell-boot/ src/Language/Haskell/Liquid/GHC/Plugin/SpecFinder.hs#L65
388+ [ core binds ] : https://hackage.haskell.org/package/ghc-9.2.5 /docs/CoreSyn.html#t:CoreBind
389+ [ configureGhcTargets ] : liquidhaskell-boot/ src-ghc/Liquid/GHC/Interface.hs#L254
390+ [ processTargetModule ] : liquidhaskell-boot/ src-ghc/Liquid/GHC/Interface.hs#L483
391+ [ processModule ] : liquidhaskell-boot/ src/Language/Haskell/Liquid/GHC/Plugin.hs#L509
384392
0 commit comments