1. 08 Dec, 2016 10 commits
  2. 07 Dec, 2016 11 commits
    • Alan Zimmerman's avatar
      Remove stray commented out line in all.T · 9bcc4e33
      Alan Zimmerman authored
      9bcc4e33
    • Alan Zimmerman's avatar
      Fix pretty printer test to nog generate stdout · 58d78dc0
      Alan Zimmerman authored
      It was doing a dump to stdout, which is not repeatable across platforms.
      58d78dc0
    • Alan Zimmerman's avatar
      Add HsSyn prettyprinter tests · 499e4382
      Alan Zimmerman authored
      Summary:
      Add prettyprinter tests, which take a file, parse it, pretty print it,
      re-parse the pretty printed version and then compare the original and
      new ASTs (ignoring locations)
      
      Updates haddock submodule to match the AST changes.
      
      There are three issues outstanding
      
      1. Extra parens around a context are not reproduced. This will require an
         AST change and will be done in a separate patch.
      
      2. Currently if an `HsTickPragma` is found, this is not pretty-printed,
         to prevent noise in the output.
      
         I am not sure what the desired behaviour in this case is, so have left
         it as before. Test Ppr047 is marked as expected fail for this.
      
      3. Apart from in a context, the ParsedSource AST keeps all the parens from
         the original source.  Something is happening in the renamer to remove the
         parens around visible type application, causing T12530 to fail, as the
         dumped splice decl is after the renamer.
      
         This needs to be fixed by keeping the parens, but I do not know where they
         are being removed.  I have amended the test to pass, by removing the parens
         in the expected output.
      
      Test Plan: ./validate
      
      Reviewers: goldfire, mpickering, simonpj, bgamari, austin
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: simonpj, goldfire, thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D2752
      
      GHC Trac Issues: #3384
      499e4382
    • Ben Gamari's avatar
      Don't barf() on failures in loadArchive() · 83d69dca
      Ben Gamari authored
      This patch replaces calls to barf() in loadArchive() with proper
      error handling.
      
      Test Plan: GHC CI
      
      Reviewers: rwbarton, erikd, hvr, austin, simonmar, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Tags: #ghc
      
      Differential Revision: https://phabricator.haskell.org/D2652
      
      GHC Trac Issues: #12388
      83d69dca
    • Ben Gamari's avatar
      rts: Use pthread itimer implementation on Darwin · d70d452a
      Ben Gamari authored
      We want to avoid using SIGALRM whenever possible since we will interrupt
      long-running system calls. See #10840.
      
      Test Plan: Validate on Darwin
      
      Reviewers: austin, erikd, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2796
      
      GHC Trac Issues: #10840
      d70d452a
    • Simon Marlow's avatar
      Fix crashes in hash table scanning with THREADED_RTS · 9043a400
      Simon Marlow authored
      See comments.
      9043a400
    • Simon Marlow's avatar
      Fix the test with -O · 5aa9c750
      Simon Marlow authored
      Static string optimisation means we get a ForeignPtr with an IORef
      inside it, leading to a different error.
      5aa9c750
    • Simon Marlow's avatar
      c02aeb5c
    • Simon Marlow's avatar
      Overhaul of Compact Regions (#12455) · 7036fde9
      Simon Marlow authored
      Summary:
      This commit makes various improvements and addresses some issues with
      Compact Regions (aka Compact Normal Forms).
      
      This was the most important thing I wanted to fix.  Compaction
      previously prevented GC from running until it was complete, which
      would be a problem in a multicore setting.  Now, we compact using a
      hand-written Cmm routine that can be interrupted at any point.  When a
      GC is triggered during a sharing-enabled compaction, the GC has to
      traverse and update the hash table, so this hash table is now stored
      in the StgCompactNFData object.
      
      Previously, compaction consisted of a deepseq using the NFData class,
      followed by a traversal in C code to copy the data.  This is now done
      in a single pass with hand-written Cmm (see rts/Compact.cmm). We no
      longer use the NFData instances, instead the Cmm routine evaluates
      components directly as it compacts.
      
      The new compaction is about 50% faster than the old one with no
      sharing, and a little faster on average with sharing (the cost of the
      hash table dominates when we're doing sharing).
      
      Static objects that don't (transitively) refer to any CAFs don't need
      to be copied into the compact region.  In particular this means we
      often avoid copying Char values and small Int values, because these
      are static closures in the runtime.
      
      Each Compact# object can support a single compactAdd# operation at any
      given time, so the Data.Compact library now enforces mutual exclusion
      using an MVar stored in the Compact object.
      
      We now get exceptions rather than killing everything with a barf()
      when we encounter an object that cannot be compacted (a function, or a
      mutable object).  We now also detect pinned objects, which can't be
      compacted either.
      
      The Data.Compact API has been refactored and cleaned up.  A new
      compactSize operation returns the size (in bytes) of the compact
      object.
      
      Most of the documentation is in the Haddock docs for the compact
      library, which I've expanded and improved here.
      
      Various comments in the code have been improved, especially the main
      Note [Compact Normal Forms] in rts/sm/CNF.c.
      
      I've added a few tests, and expanded a few of the tests that were
      there.  We now also run the tests with GHCi, and in a new test way
      that enables sanity checking (+RTS -DS).
      
      There's a benchmark in libraries/compact/tests/compact_bench.hs for
      measuring compaction speed and comparing sharing vs. no sharing.
      
      The field totalDataW in StgCompactNFData was unnecessary.
      
      Test Plan:
      * new unit tests
      * validate
      * tested manually that we can compact Data.Aeson data
      
      Reviewers: gcampax, bgamari, ezyang, austin, niteria, hvr, erikd
      
      Subscribers: thomie, simonpj
      
      Differential Revision: https://phabricator.haskell.org/D2751
      
      GHC Trac Issues: #12455
      7036fde9
    • Ben Gamari's avatar
      Really mark T9577 as broken · 4dd6b37f
      Ben Gamari authored
      I failed at the last attempt.
      4dd6b37f
    • Ben Gamari's avatar
      Mark T9577 as broken on Darwin due to #12937 · 39143a47
      Ben Gamari authored
      39143a47
  3. 06 Dec, 2016 8 commits
    • Vladislav Zavialov's avatar
      Test Trac #12919 · 41ec722d
      Vladislav Zavialov authored
      Test Plan: make test TEST=T12919
      
      Reviewers: bgamari, austin
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2788
      
      GHC Trac Issues: #12919
      41ec722d
    • Thijs Alkemade's avatar
      Reduce the size of string literals in binaries. · b7e88ee0
      Thijs Alkemade authored
      Removed the alignment for strings and mark then as cstring sections in
      the generated asm so the linker can merge duplicate sections.
      
      Reviewers: rwbarton, trofi, austin, trommler, simonmar, hvr, bgamari
      
      Reviewed By: hvr, bgamari
      
      Subscribers: simonpj, hvr, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1290
      
      GHC Trac Issues: #9577
      b7e88ee0
    • Matthew Pickering's avatar
      eafa06dc
    • Matthew Pickering's avatar
      Fix unsafe usage of `is_iloc` selector in Ord instance for ImportSpec · 6e4188ab
      Matthew Pickering authored
      Summary:
      This fixes tests rn017, T7672 and closed #12930.
      
      Both these tests were self referential module imports through hs-boot
      files. As a result, I am quite suspicious of what the ImpAll constructor is
      used for. I had a brief hunt around but couldn't immediately see whether
      it was necessary.
      
      Reviewers: austin, bgamari
      
      Subscribers: simonpj, thomie, nomeata
      
      Differential Revision: https://phabricator.haskell.org/D2793
      
      GHC Trac Issues: #12930
      6e4188ab
    • Simon Marlow's avatar
    • Simon Marlow's avatar
      Overhaul GC stats · 24e6594c
      Simon Marlow authored
      Summary:
      Visible API changes:
      
      * The C struct `GCDetails` gives the stats about a single GC.  This is
        passed to the `gcDone()` callback if one is set via the
        RtsConfig. (previously we just passed a collection of values, so this
        is more extensible, at the expense of breaking the existing API)
      
      * `RTSStats` gives cumulative stats since the start of the program,
        and includes the `GCDetails` for the most recent GC.  This struct
        can be obtained via `getRTSStats()` (the old `getGCStats()` has been
        removed, and `getGCStatsEnabled()` has been renamed to
        `getRTSStatsEnabled()`)
      
      Improvements:
      
      * The per-GC stats and cumulative stats are now cleanly separated.
      
      * Inside the RTS we have a top-level `RTSStats` struct to keep all our
        stats in, previously this was just a collection of strangely-named
        variables.  This struct is mostly just copied in `getRTSStats()`, so
        the implementation of that function is a lot shorter.
      
      * Types are more consistent.  We use a uint64_t byte count for all
        memory values, and Time for all time values.
      
      * Names are more consistent.  We use a suffix `_bytes` for all byte
        counts and `_ns` for all time values.
      
      * We now collect information about the amount of memory in large
        objects and compact objects in `GCDetails`. (the latter was the reason
        I started doing this patch but it seems to have ballooned a bit!)
      
      * I fixed a bug in the calculation of the elapsed MUT time, and added
        an ASSERT to stop the calculations going wrong in the future.
      
      For now I kept the Haskell API in `GHC.Stats` the same, by
      impedence-matching with the new API.  We could either break that API
      and make it match the C API more closely, or we could add a new API
      and deprecate the old one.  Opinions welcome.
      
      This stuff is very easy to get wrong, and it's hard to test.  Reviews
      welcome!
      
      Test Plan:
      manual testing
      validate
      
      Reviewers: bgamari, niteria, austin, ezyang, hvr, erikd, rwbarton, Phyx
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2756
      24e6594c
    • Ryan Scott's avatar
      Give concrete example for #12784 in 8.0.2 release notes · eec02ab7
      Ryan Scott authored
      Summary:
      We mentioned that there were "some programs" that failed to typecheck
      due to #12784, but given how surprisingly common this issue has been, it'd
      be prudent to at least give one example of the bug in the release notes.
      
      Reviewers: simonpj, bgamari, austin, rwbarton
      
      Reviewed By: rwbarton
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2786
      
      GHC Trac Issues: #12784
      eec02ab7
    • Tamar Christina's avatar
      Fix x86 Windows build and testsuite · b82f71b9
      Tamar Christina authored
      Summary:
      Fix issues preventing x86 GHC to build on Windows and
      fix segfault in the testsuite.
      
      Test Plan: ./validate
      
      Reviewers: austin, erikd, simonmar, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: #ghc_windows_task_force, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2789
      b82f71b9
  4. 05 Dec, 2016 5 commits
    • Tamar Christina's avatar
      Color output is wreaking havoc on test results · 847d2293
      Tamar Christina authored
      Summary:
      D2716 introduced colors into the output of GHC.
      These color ourputs are done using escape characters output
      to the terminal.
      
      These however are wreaking havoc on the testsuite output as now
      no stderr with a warning or error will match anymore.
      
      Instead of accepting the new codes as expected values instead I
      turn them off. So the testsuite is consistent on platforms/terminals we
      don't support colors on.
      
      Test Plan:
      any test that outputs colors. e.g.
      
      make test TEST=T9576
      
      Reviewers: austin, Rufflewind, bgamari
      
      Subscribers: thomie, #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D2787
      
      GHC Trac Issues: #8809
      847d2293
    • Simon Peyton Jones's avatar
      Test Trac #12925 · 3e3f7c21
      Simon Peyton Jones authored
      3e3f7c21
    • Simon Peyton Jones's avatar
      Use isFamFreeTyCon now we have it · e9123102
      Simon Peyton Jones authored
      Refactoring only
      e9123102
    • Simon Peyton Jones's avatar
      Fix used-variable calculation (Trac #12548) · 6305674f
      Simon Peyton Jones authored
      The used-variable calculation for pattern synonyms is a little
      tricky, for reasons described in RnBinds
      Note [Pattern synonym builders don't yield dependencies]
      
      It was right semantically, but the "unused-variable warning" was
      wrong, which led to Trac #12548.
      6305674f
    • Simon Peyton Jones's avatar
      Fix an asymptotic bug in the occurrence analyser · 517d03e4
      Simon Peyton Jones authored
      Trac #12425 and #12234 showed up a major and long-standing
      bug in the occurrence analyser, whereby it could generate
      explonentially large program!
      
      There's a lot of commentary on #12425; and it's all described
      in Note [Loop breakers, node scoring, and stability]
      
      I did quite a lot of refactoring to make the code comprehensibe
      again (its structure had bit-rotted rather), so the patch
      looks bigger than it really is.
      
      Hurrah!
      
      I did a nofib run to check that I hadn't inadertently ruined
      anything:
      
      --------------------------------------------------------------------------------
              Program           Size    Allocs   Runtime   Elapsed  TotalMem
      --------------------------------------------------------------------------------
                fluid          -0.3%     -1.5%      0.01      0.01     +0.0%
               parser          -0.9%     +0.6%      0.04      0.04     +0.0%
               prolog          -0.1%     +1.2%      0.00      0.00     +0.0%
      
      --------------------------------------------------------------------------------
                  Min          -0.9%     -1.5%     -8.6%     -8.7%     +0.0%
                  Max          +0.1%     +1.2%     +7.7%     +7.8%     +2.4%
       Geometric Mean          -0.2%     -0.0%     -0.2%     -0.3%     +0.0%
      
      I checked what happened in 'prolog'.  It seems that we have a
      recursive data structure something like this
      
         f :: [blah]
         f x = build (\cn.  ...g...  )
      
         g :: [blah2]
         g y = ....(foldr k z (f y))....
      
      If we inline 'f' into 'g' we get better fusion than the other
      way round, but we don't have any way to spot that at the moment.
      (I wonder if we could do worker/wrapper for functions returning
      a 'build'?)  It was happening before by a fluke.
      
      Anyway I decided to accept this; it's relatively rare I think.
      517d03e4
  5. 02 Dec, 2016 6 commits