We’re happy to support the Haskell Foundation in planning a pre-ZuriHac workshop for new GHC contributors on 7th-9th June 2023 in Zurich (and online). Find out more and express interest here.
This is the sixteenth edition of our GHC activities report, which describes the work on GHC and related projects that we are doing at Well-Typed. The current edition covers roughly the months of December 2022 and January 2023. You can find the previous editions collected under the ghc-activities-report tag.
We are delighted that Juspay are now sponsoring this work. Many thanks to them and to our other sponsors, including GitHub via the Haskell Foundation, and IOG. We are also working with Hasura and Mercury on specific GHC-related improvements, such as interface files with core definitions.
However, some of our sponsorship agreements are coming to an end and we need more sponsorship to sustain the team! If your company might be able to contribute funding to ensure that we can continue this valuable work, please read about how you can help or get in touch.
Of course, GHC is a large community effort, and Well-Typed’s contributions are just a small part of this. This report does not aim to give an exhaustive picture of all GHC work that is ongoing, and there are many fantastic features currently being worked on that are omitted here simply because none of us are currently involved in them in any way. Furthermore, the aspects we do mention are still the work of many people. In many cases, we have just been helping with the last few steps of integration. We are immensely grateful to everyone contributing to GHC!
We are very pleased to welcome Rodrigo Mesquita to the team for an internship over the next six months. Rodrigo will be working on enabling the safe reinstallation of the
template-haskell libraries (#20742). This is a crucial step which will unlock better cross-compilation, more robust tooling support, and potential improvements in library compatibility across GHC versions.
Matt and Ben released version 9.4.4 in December, fixing various bugs in the 9.4 series.
Zubin prepared version 9.2.6 for release in February.
Matt fixed a variety of bugs in multiple home unit support which were found when testing new Cabal support for starting multi-unit sessions (!9618).
Matt and Zubin investigated GHCi memory usage on partial reloads. They found and squashed quite a few leaks, resulting in substantial reductions in memory usage after a
Matt fixed a bug when using interface files with core definitions (!9869).
Andreas investigated many runtime performance issues relating to inlining, specialisation,
NOINLINEpragmas (#22321, #22609, #22689, #22781, !9723). He has work in progress allowing
INLINEABLEto be combined, enabling specialization of
Andreas opened a GHC proposal with some ideas for transitive specialization.
Andreas investigated performance regressions in
aeson(#22115) which were caused by three independent issues:
- A code generation regression which was then quickly fixed by Ben (!9718).
- A change to the implementation of
Bitsinstances which caused regressions due to partial register stalls. This is a known issue (#20405) where the fix had not been applied to all branches at the time.
- A regression due to changes to the constructed product result optimisation (#22983).
Andreas diagnosed an issue where an
OPAQUEpragma triggered a compiler panic (#22502).
Sam proposed a patch adding Template Haskell support for explicit
forallquantifiers in instances (!9840).
- Matt improved the error messages of the exhaustiveness checker when checking statements that have been moved around with
Ben began looking at improving the linkage story for RTS symbols, which is a long-standing headache for distribution packagers (#17157).
Ben fixed warning-cleanliness in the runtime system’s C sources and fixed Hadrian to ensure that they remain clean (!9579)
Andreas fixed an issue with GCing of sparks (#22528) that sometimes caused sparks to be evaluated sequentially instead of in parallel.
Andreas investigated and fixed a crash when GCing a CAF that is evaluated from TH (#22417). This fixes some long standing spurious segfaults involving TH on static build targets such as Windows.
Ben made significant improvements to the non-moving garbage collector:
- Fixed the handling of empty arrays in the non-moving write barrier (#22931).
- Greatly improved handling of
Weak#objects, which previously may not have been promptly finalized (#22327).
- Fixed a few potentially unsound interactions with
- Identified and fixed a missing write barrier in the GC’s selector optimisation implementation (#22930).
- Significantly improved pause times for some programs by bounding marking work in the sync pause (#22929).
- Continued work in implementing parallel marking support.
- Improved accuracy of residency reporting.
Sam improved how GHC keeps track of the types at which Cmm registers are used. In particular, this helps ensure that SIMD vector registers, which can be used to store different types of data, are used in a consistent manner (!9167).
Ben diagnosed and fixed an AArch64 backend issue resulting in compile-time crashes when the graph-colouring register allocator (
-fregs-graph) is in use (#22798).
Andreas fixed a runtime crash caused by a bug in the tag inference analysis due to a difference between Cmm and Bytecode backends (#22840).
-fsplit-sectionson Windows (#22834).
Ben fixed a linking-related compilation failure on MacOS (#21972).
Andreas updated the
nofibbenchmark suite to ensure it is usable with the upcoming 9.6 release, along with some other minor tweaks.
Ben improved the reporting output of the
Matt added tests for issues milestoned for 9.4.4 but already fixed.
Ben found that the testsuite was failing with
-threadedand sanity-checking enabled, and started fixing these issues.
Matt fixed an issue with manpages not being installed.
Matt made various fixes to the build system and packaging including enabling split-sections for release builds.
Matt added a flag to omit self-recompilation info from interface files, for situations where you are never going to attempt to recompile a package. This avoids a source of non-determinism in builds.
Matt added support for LLVM 15 and while doing so removed support for LLVM 10. GHC will henceforth support LLVM 11 through 15.
Zubin fixed an issue with the binary distribution configure script where it didn’t check for the
findcommand being available (!9777).
Matt added scripts for automatically generating metadata for
ghcup. When a new release is made, the metadata is sent to the
ghcupmaintainers who can easily use it to add support for new releases to
ghcup. The metadata is generated on nightly and release pipelines and is now used to test binary distributions on many different platforms.
Matt upgraded CI runners to use GHC 9.4.3 for CI.
Matt fixed a variety of issues on Darwin CI runners, so they could be re-enabled, increasing CI capacity.
Matt added Ubuntu 18.04 nightly and release jobs.
Ben added a Rocky Linux CI job, filling the hole left by the retirement of Centos 7.
Ben prototyped infrastructure for collecting hardware performance counter metrics in CI to catch code generation regressions more reliably (!7414).
Matt did a lot of work on
head.hackage, making more use of it to find bugs early.
Ben simplified the configuration needed by end-users to use
head.hackageand revised his draft blog post documenting the
head.hackageusage and contribution workflow.
- Matt added support for tracing of static reference tables (SRTs) to
Matt looked into a reported issue with a runtime loop, and diagnosed it as expected behaviour involving an interaction with overlapping instances specific to the project.
Ben reproduced and characterised a linking issue affecting a user (#22803).
Sam reviewed and assisted with an MR by Georgi Lyubenov that allows record wildcards to be used with nullary constructors (!9004).
Sam reviewed several MRs by Andrew Lelechenko which eliminate uses of
tailwithin GHC’s codebase.
Ben wrote and shepherded a Core Libraries Committee proposal adding the new
Foreign.C.ConstPtr.ConstPtrtype, facilitating resolution of #22043.
Ben began assessing the stability of the many interfaces provided by
GHC.*module namespace as a first step towards making a clearer separation between the public and GHC-internal APIs of
Ben introduced CI support for tracking the interfaces exposed by
baseto help ensure that core libraries changes receive the review that they deserve (!9816).
Sam made a CLC proposal concerning the reporting of exceptions arising during weak pointer finalization. Until agreement on this issue is reached, GHC’s error reporting has been reverted to the status quo, with users free to change it as they see fit.