Skip to content
Snippets Groups Projects
  1. Nov 25, 2024
  2. Nov 23, 2024
  3. Nov 21, 2024
    • Cheng Shao's avatar
      driver: fix hpc undefined symbol issue in TH with -fprefer-byte-code · bcbcdaaf
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      This commit fixes an undefined symbol error in RTS linker when
      attempting to compile home modules with -fhpc and
      -fbyte-code-and-object-code/-fprefer-byte-code, see #25510 for
      detailed description and analysis of the bug.
      
      Also adds T25510/T25510c regression tests to test make mode/oneshot
      mode of the bug.
      bcbcdaaf
    • Rodrigo Mesquita's avatar
      Improve reachability queries on ModuleGraph · 7575709b
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      Introduces `ReachabilityIndex`, an index constructed from a
      `GHC.Data.Graph.Directed` `Graph` that supports fast reachability
      queries (in $O(1)$). This abstract data structure is exposed from
      `GHC.Data.Graph.Directed.Reachability`.
      
      This index is constructed from the module graph nodes and cached in
      `ModuleGraph`, enabling efficient reachability queries on the module
      graph. Previously, we'd construct a Map of Set of ModuleGraph nodes
      which used a lot of memory (`O(n^2)` in the number of nodes) and cache
      that in the `ModuleGraph`. By using the reachability index we get rid of
      this space leak in the module graph -- even though the index is still
      quadratic in the number of modules, it is much, much more space
      efficient due to its representation using an IntMap of IntSet as opposed
      to the transitive closure we previously cached.
      
      In a memory profile of MultiLayerModules with 100x100 modules, memory
      usage improved from 6GB residency to 2.8GB, out of which roughly 1.8GB
      are caused by a second space leak related to ModuleGraph. On the same
      program, it brings compile time from 7.5s to 5.5s.
      
      Note how we simplify `checkHomeUnitsClosed` in terms of
      `isReachableMany` and by avoiding constructing a second graph with the
      full transitive closure -- it suffices to answer the reachability query
      on the full graph without collapsing the transitive closure completely
      into nodes.
      
      Unfortunately, solving this leak means we have to do a little bit more
      work since we can no longer cache the result of turning vertex indices
      into nodes. This results in a slight regression in MultiLayerModulesTH_Make,
      but results in large performance and memory wins when compiling large
      amounts of modules.
      
      -------------------------
      Metric Decrease:
          mhu-perf
      Metric Increase:
          MultiLayerModulesTH_Make
      -------------------------
      7575709b
    • Brandon Chinn's avatar
      Fix CRLF in multiline strings (#25375) · 7bd407a6
      Brandon Chinn authored and Marge Bot's avatar Marge Bot committed
      7bd407a6
  4. Nov 20, 2024
  5. Nov 19, 2024
  6. Nov 18, 2024
    • Ben Gamari's avatar
      rts/adjustor: Fix stack overrun error in Nativei386 adjustor · 39bb6e58
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      We were reserving the wrong kind of adjustor context (the generic
      `AdjustorContext` used by other adjustor implementations, rather than
      the i386-specific `CCallContext`) to return the adjustor context while
      freeing, resulting in #25485.
      
      Fixes #25485.
      39bb6e58
    • Ben Gamari's avatar
      rts/adjustor: Clean up code style of Nativei386 adjustor · 325fcb5d
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      325fcb5d
    • Rodrigo Mesquita's avatar
      Bump array and stm submodules for testsuite · d9326a48
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      The testsuites of array and stm had to be updated according to !13301.
      
      Updates submodule array and stm.
      d9326a48
    • Rodrigo Mesquita's avatar
      base: Add to changelog.md CLC #285 · 3e89eb65
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      3e89eb65
    • Rodrigo Mesquita's avatar
      Fix exception backtraces from GHCi · 802b5c3e
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      When running the program with `runhaskell`/`runghc` the backtrace should
      match the backtrace one would get by compiling and running the program.
      But currently, an exception thrown in a program interpreted with
      `runhaskell` will:
      
          * Not include the original exception backtrace at all
          * Include the backtrace from the internal GHCi/ghc rethrowing of the
            original exception
      
      This commit fixes this divergence by not annotating the ghc(i) backtrace
      (with NoBacktrace) and making sure that the backtrace of the original
      exception is serialized across the boundary and rethrown with the
      appropriate context.
      
      Fixes #25116
      
      The !13301 MR (not this commit in particular) improves performance of
      MultiLayerModules. Unfortunately, T3294 regresses on aarch64-linux-deb12
      by 1% allocations. Since this patch must be merged for 9.12 ASAP, we
      will not be able to investigate the slight regression on this platform
      in time.
      
      -------------------------
      Metric Decrease:
          MultiLayerModulesRecomp
          MultiLayerModulesTH_OneShot
      Metric Increase:
          T3294
      -------------------------
      802b5c3e
    • Rodrigo Mesquita's avatar
      Re-export NoBacktrace from Control.Exception · c0d783f8
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      This was originally proposed and accepted in section
          "2.7   Capturing Backtraces on Exceptions"
      of the CLC proposal for exception backtraces.
      
      However, the implementation missed this re-export, which this commit now
      fixes.
      c0d783f8
    • Rodrigo Mesquita's avatar
      De-duplicate displayContext and displayExceptionContext · 3abf31a4
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      The former was unused except for one module where it was essentially
      re-defining displayExceptionContext.
      
      Moreover, this commit extends the fix from
      bfe600f5 to displayExceptionContext too,
      which was missing.
      3abf31a4
    • Rodrigo Mesquita's avatar
      Freeze call stack in error throwing functions · 7a74330b
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      CLC proposal#285
      7a74330b
    • Rodrigo Mesquita's avatar
      Remove redundant CallStack from exceptions · 36cddd2c
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      Before the exception backtraces proposal was implemented, ErrorCall
      accumulated its own callstack via HasCallStack constraints, but
      ExceptionContext is now accumulated automatically.
      
      The original ErrorCall mechanism is now redundant and we get a duplicate
      CallStack
      
      Updates Cabal submodule to fix their usage of ErrorCallWithLocation to ErrorCall
      
      CLC proposal#285
      
      Fixes #25283
      36cddd2c
    • Rodrigo Mesquita's avatar
      Display type and callstack of exception on handler · 284ffab3
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      This commit changes the Exception instance of SomeException to *simply*
      display the underlying exception in `displayException`. The augmented
      exception message that included the type and backtrace of the exception
      are now only printed on a call to `displayExceptionWithInfo`.
      
      At a surface level, existing programs should behave the same since the
      `uncaughtExceptionHandler`, which is responsible for printing out uncaught
      exceptions to the user, will use `displayExceptionWithInfo` by default.
      
      However, unlike the instance's `displayException` method, the
      `uncaughtExceptionHandler` can be overriden with
      `setUncaughtExceptionHandler`. This makes the extra information opt-in
      without fixing it the instance, which can be valuable if your program
      wants to display uncaught exceptions to users in a user-facing way
      (ie without backtraces).
      
      This is what was originally agreed for CLC#231 or CLC#261 with regard to
      the type of the exception information.
      
      The call stack also becoming part of the default handler rather than the
      Exception instance is an ammendment to CLC#164.
      
      Discussion of the ammendment is part of CLC#285.
      284ffab3
    • Rodrigo Mesquita's avatar
      exceptions: Improve the message layout as per #285 · a4e0d235
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      This commit fixes the layout of the additional information included when
      displaying an exception, namely the type of the exception.
      
      It also fixes the default handler's heading message to work well
      together with the improved display message of SomeException.
      
      CLC proposal#285
      a4e0d235
Loading