simonmar (Simon Marlow)
User

Projects

Today

  • Clear sailing ahead.

Tomorrow

  • Clear sailing ahead.

Saturday

  • Clear sailing ahead.

User Details

User Since
Jun 8 2014, 1:59 AM (154 w, 4 d)
Availability
Available

Recent Activity

Yesterday

simonmar added a comment to D3603: Faster checkFamInstConsistency.

Nice, I'll leave it for @simonpj to accept, just nits and style suggestions from me.

Wed, May 24, 10:38 AM

Tue, May 23

simonmar added a comment to D3589: Add support for producing position-indepedent executables.

-pie seems reasonable to me. But couldn't -shared be used for this? There's an arguable consistency to it: -shared makes a dynamically-loadable library, it would be nice if it did the same thing for an executable.

Tue, May 23, 10:57 AM

Mon, May 22

simonmar requested changes to D3448: [linker] fix armv7 & add aarch64.

@simonmar, what do you think about this?

I took a quick skim and didn't see any egregious stylistic differences, what things did you have in mind? Is it declaration inside a for statement? I'd be happy to use that style more widely in the RTS.

The naming convention is quite different; the RTS generally uses CamelCase whereas this work uses snake_case.

Mon, May 22, 2:41 AM

Thu, May 18

simonmar requested changes to D3586: cmm/CmmLayoutStack: avoid generating unnecessary reloads.

Ok, passing back to you for refactoring. I'll take another look when you update the diff.

Thu, May 18, 7:32 AM
simonmar requested changes to D3595: CNF: Silence pointer fix-up message unless gc debugging is enabled.
Thu, May 18, 2:04 AM

Wed, May 17

simonmar added a comment to D3502: Support `embedFile` in iserv slave.

How malleable is the Q monad?

Wed, May 17, 11:26 AM
simonmar added a comment to D3552: compiler: fix trac issue 13648.

Ok, you're using a different test case now. It looks fine, but you didn't show the output of a type error message, which I think will demonstrate the problem.

Wed, May 17, 11:17 AM

Tue, May 16

simonmar added inline comments to D3588: Cache conversion to a map for dep_mods.
Tue, May 16, 5:30 AM

Mon, May 15

simonmar added a comment to D3502: Support `embedFile` in iserv slave.

We don't have a good way to virtualize the file system (or IO in general). My concern is that whatever mechanisms we put in place here won't be enough.

Mon, May 15, 3:06 AM
simonmar added a comment to D3448: [linker] fix armv7 & add aarch64.

@simonmar, what do you think about this?

Mon, May 15, 2:54 AM
simonmar added a comment to D3586: cmm/CmmLayoutStack: avoid generating unnecessary reloads.

Nice observation about the unnecessary reloads, and the results look good. I presume with -O the unnecessary reloads will be eliminated by CmmSink, but eliminating them earlier saves compile time and helps with -O0.

Mon, May 15, 2:50 AM
simonmar accepted D3575: Stress test for nested module hierarchies.

If it works on Windows, go for it.

Mon, May 15, 2:33 AM

Thu, May 11

simonmar added a comment to D3552: compiler: fix trac issue 13648.

I think in your test case ApplicativeDo is not transforming the statement. You need to test it with an example that gets transformed after your diff.

Thu, May 11, 5:49 AM
simonmar added a comment to D3526: Implement unsafeInterleaveIO using MVars.
unsafeInterleaveIO m = do
  ref <- newIORef False
  m <- newEmptyMVar
  unsafeDupableInterleaveIO $ do
    r <- atomicModifyIORef' ref (\b -> return (True,b))
    if r then takeMVar m else do res <- m; putMVar m res; return res

Are we assured that multiple threads evaluating an unsafeInterleaveIO like defined above will see the same ref and m? Doesn't the allocation of these objects need to be protected by noDuplicate? I'm happy to be completely wrong, but I would like to know why.

Thu, May 11, 3:09 AM
simonmar requested changes to D3502: Support `embedFile` in iserv slave.

I really don't like this, let's try to find alternative solutions.

Thu, May 11, 2:56 AM

Wed, May 10

simonmar added a comment to D3552: compiler: fix trac issue 13648.

To be clear I don't object to a stop-gap approach that allows BodyStmt to work with ApplicativeDo without going all the way to Trac #10892, but the first point in my previous comment still applies: I think this will break error messages. I'm not sure what the best way to fix this is so I'll let you experiment, but we have to retain the information somehow that the original statement was a BodyStmt so that it can be printed as such in an error message.

Wed, May 10, 7:43 AM
simonmar accepted D3556: Fix iossimulator.
Wed, May 10, 7:08 AM
simonmar accepted D3562: Efficient membership for home modules.

nicecatch

Wed, May 10, 5:17 AM

Tue, May 9

simonmar accepted D3560: rts: Don't build StgCRunAsm.S if unregisterised.
Tue, May 9, 1:42 PM
simonmar added a comment to D3552: compiler: fix trac issue 13648.

Ok, so there are a couple of problems with this approach

Tue, May 9, 10:08 AM
simonmar added a reviewer for D3552: compiler: fix trac issue 13648: simonmar.
Tue, May 9, 10:00 AM
simonmar accepted D3555: #if -> #if defined.
Tue, May 9, 9:27 AM
simonmar created D3554: Fix a performance bug in GhcMake.downsweep.
Tue, May 9, 6:06 AM

Mon, May 8

simonmar accepted D3544: Optimize casMutVar# for single-threaded RTS.
Mon, May 8, 2:47 AM
simonmar updated subscribers of D3352: Clean up opt and llc.

@kavon should have a look at this too

Mon, May 8, 2:46 AM
simonmar accepted D3469: [iserv] fix loadDLL.
Mon, May 8, 2:44 AM

Fri, May 5

simonmar added a comment to D3526: Implement unsafeInterleaveIO using MVars.

Well ok, if you can demonstrate a perf improvement then I won't object. GHC does use unsafeInterleaveIO, but as far as I know we've never identified it as a significant factor for performance (that could be because our profiling tools aren't good enough, of course). So my concerns are really around whether this is the most productive area to focus effort, rather than whether it's a good idea in isolation.

Fri, May 5, 6:31 AM

Thu, May 4

simonmar accepted D3527: Abandon typedefing the {Section,ObjectCode}FormatInfo structs.
Thu, May 4, 2:54 AM
simonmar added a comment to D3530: Dataflow: use IntSet for mkDepBlocks.

I think I benchmarked this when I was working on the backend and found that it was worse. What effect did it have on the perf tests?

Thu, May 4, 2:47 AM
simonmar added a comment to D3526: Implement unsafeInterleaveIO using MVars.

@dfeuer what's this aiming at? Is there a problem with the old implementation, or are you trying to optimise it? If so, what's the benchmark?

I'm very wary of modifying this code, the bugs are really hard to find.

I'm trying to optimize it. You chose to use an MVar rather than noDuplicate# for fixIO to try to optimize it. unsafeInterleaveIO
gets a lot more use, so we should worry at least as much about its performance. I can't guarantee that I can improve performance,
but I think it's worth a shot. As for the benchmark, I imagined that we must have some benchmarks that use lazy
IO in multi-threaded code. If that's wrong, I'll have to try to come up with something.

Thu, May 4, 2:43 AM

Wed, May 3

simonmar added a comment to D3526: Implement unsafeInterleaveIO using MVars.

@dfeuer what's this aiming at? Is there a problem with the old implementation, or are you trying to optimise it? If so, what's the benchmark?

Wed, May 3, 10:29 AM
simonmar accepted D3494: Improve fixIO.

Looks like it should be ok, although this is an unforced change so I feel slightly uneasy about it. Do we have good enough tests to be confident in this do you think?

Wed, May 3, 7:50 AM
simonmar accepted D3463: ghci: Change instruction array to UArray Int Word16.
Wed, May 3, 7:46 AM

Fri, Apr 28

simonmar accepted D3447: [linker] Add ocInit/ocDeinit for ELF.
Fri, Apr 28, 10:26 AM

Thu, Apr 27

simonmar added inline comments to D3447: [linker] Add ocInit/ocDeinit for ELF.
Thu, Apr 27, 3:40 AM
simonmar added a comment to D3503: Cmake file for rts..

I'm dubious too: there's no good way to test it, and we'll inevitably break it very quickly. Is there another way you could keep track of this file, perhaps in a separate github repo?

Thu, Apr 27, 2:36 AM

Wed, Apr 26

simonmar added a comment to D3494: Improve fixIO.

Oh wow, that's a good point. You should be able to change it to an unsafeDupableInterleaveIO if you also change the takeMVar to be readMVar.

Wed, Apr 26, 5:05 AM

Tue, Apr 25

simonmar accepted D3498: Document mkWeak#.

Looks good to me. You could also clarify the docs a little by saying "i.e. it must be a pointer, but it doesn't matter if it's lifted or not"

Tue, Apr 25, 1:59 PM
simonmar committed rGHC914842e518bc: Don't setProgramDynFlags on every :load (authored by simonmar).
Don't setProgramDynFlags on every :load
Tue, Apr 25, 9:35 AM
simonmar closed D3398: Don't setProgramDynFlags on every :load by committing rGHC914842e518bc: Don't setProgramDynFlags on every :load.
Tue, Apr 25, 9:35 AM
simonmar added inline comments to D3443: [iserv] Fixing the word size for RemotePtr and toWordArray.
Tue, Apr 25, 7:28 AM

Apr 25 2017

simonmar requested changes to D3494: Improve fixIO.

This is probably a lot more expensive than the MVar version. Recall that noDuplicate# walks the stack; it's an O(n) operation.

Apr 25 2017, 2:49 AM

Apr 24 2017

simonmar accepted D3485: Prefer #if defined to #ifdef.

Yep, fine by me.

Apr 24 2017, 10:45 AM
simonmar updated the diff for D3398: Don't setProgramDynFlags on every :load.

fix test for Windows

Apr 24 2017, 2:46 AM
simonmar added a comment to D3481: compiler/cmm/PprC.hs: constify labels in .rodata.

Looks great, thanks for doing this!

Apr 24 2017, 2:40 AM

Apr 22 2017

simonmar accepted D3477: win32/Ticker: Stop ticker on exit.

nicecatch

Apr 22 2017, 4:38 AM
simonmar accepted D3482: cpp: Use #pragma once instead of #ifndef guards.

Wow, you folks are really dragging this code out of the 90s :)

Apr 22 2017, 4:35 AM

Apr 20 2017

simonmar added inline comments to D3443: [iserv] Fixing the word size for RemotePtr and toWordArray.
Apr 20 2017, 3:06 AM
simonmar accepted D3473: base: Fix hWaitForInput with timeout on POSIX.

Yep, looks right to me. It won't be interruptible which is a shame, but at least that's not a regression. Thanks for doing this!

Apr 20 2017, 2:44 AM
simonmar updated the diff for D3398: Don't setProgramDynFlags on every :load.

rebase

Apr 20 2017, 2:37 AM

Apr 17 2017

simonmar added a comment to D3448: [linker] fix armv7 & add aarch64.

I haven't done a complete review here, there's a lot I don't understand. Just a few questions below. My main concern is that we keep the elft/x86_64 parts of the linker working and don't introduce any perf regressions.

Apr 17 2017, 6:19 AM
simonmar added inline comments to D3447: [linker] Add ocInit/ocDeinit for ELF.
Apr 17 2017, 6:01 AM
simonmar accepted D3446: [linker] Adds elf_compat.h, util.h, elf_util.h.

Just a few nits...

Apr 17 2017, 5:54 AM
simonmar accepted D3445: [linker] Adds ElfTypes.

Ok when you've got clean builds on OS X and Windows.

Apr 17 2017, 5:41 AM
simonmar accepted D3460: hs_add_root() RTS API removal.

Thanks!

Apr 17 2017, 5:36 AM
simonmar requested changes to D3460: hs_add_root() RTS API removal.

Yes, it's time we removed this.

Apr 17 2017, 5:01 AM

Apr 15 2017

simonmar requested changes to D3456: Efficient serialisation for GHCi Instruction arrays.

Thanks for doing this!

Apr 15 2017, 9:17 AM

Apr 13 2017

simonmar added inline comments to D3445: [linker] Adds ElfTypes.
Apr 13 2017, 2:36 AM

Apr 12 2017

simonmar added inline comments to D3443: [iserv] Fixing the word size for RemotePtr and toWordArray.
Apr 12 2017, 1:09 PM
simonmar added a comment to D3443: [iserv] Fixing the word size for RemotePtr and toWordArray.

Seems like there are two independent changes here, shouldn't they be separate diffs?

Apr 12 2017, 3:44 AM

Mar 31 2017

simonmar added a comment to D3392: Optimise common cases of GHC.setProgramDynFlags.

Let's call that a separate problem, I don't think I've made it worse here. Arguably I've made it better because :set won't put you in an inconsistent state after you change your environment file.

Mar 31 2017, 11:07 AM
simonmar updated the diff for D3392: Optimise common cases of GHC.setProgramDynFlags.

fix warning

Mar 31 2017, 8:25 AM
simonmar added a comment to D3392: Optimise common cases of GHC.setProgramDynFlags.

Wow. I didn't do anything about point (1), I don't think this is the right place to take into account environment files, and I'm not sure what you mean by "obvious that we failed to pick up a package environment file because of the caching mechanism".

Mar 31 2017, 4:12 AM
simonmar updated the diff for D3392: Optimise common cases of GHC.setProgramDynFlags.

Make a data type for package DB flags

Mar 31 2017, 4:08 AM
simonmar added a comment to D3398: Don't setProgramDynFlags on every :load.

We should already have touch on Windows as part of the msys toolchain.

Mar 31 2017, 4:03 AM
simonmar added a comment to D3398: Don't setProgramDynFlags on every :load.

The test is maybe OS-specific, but I was optimistically hoping it might work on Windows. I don't have a Windows box to test on though. (can anyone help?)

Mar 31 2017, 2:39 AM

Mar 30 2017

simonmar updated the diff for D3392: Optimise common cases of GHC.setProgramDynFlags.
  • packageFlagsChanged: check package DB flags too
  • setLogAction: set log_finaliser too
Mar 30 2017, 6:59 AM
simonmar updated the Trac tickets for D3398: Don't setProgramDynFlags on every :load.
Mar 30 2017, 4:38 AM
simonmar created D3398: Don't setProgramDynFlags on every :load.
Mar 30 2017, 4:35 AM

Mar 29 2017

simonmar committed rGHC5ebf83e0bdde: Fix scc001 (authored by simonmar).
Fix scc001
Mar 29 2017, 9:37 AM
simonmar committed rGHC01e12987189a: cg057: accept output (authored by simonmar).
cg057: accept output
Mar 29 2017, 9:37 AM
simonmar updated the diff for D3394: Report heap overflow in the same way as stack overflow.

Accept test output

Mar 29 2017, 9:36 AM
simonmar created D3395: :cd affects the iserv process too.
Mar 29 2017, 8:41 AM
simonmar created D3394: Report heap overflow in the same way as stack overflow.
Mar 29 2017, 8:40 AM
simonmar created D3393: askCc should be using the linker, not the compiler.
Mar 29 2017, 8:38 AM
simonmar created D3392: Optimise common cases of GHC.setProgramDynFlags.
Mar 29 2017, 8:37 AM
simonmar added a comment to D3358: base: Implement bit casts between word and float types.

I think so.

Mar 29 2017, 5:21 AM

Mar 28 2017

simonmar committed rGHCc77551abd42a: Make the test fail if compiled without -threaded (authored by simonmar).
Make the test fail if compiled without -threaded
Mar 28 2017, 5:33 AM
simonmar closed D3387: Make the test fail if compiled without -threaded by committing rGHCc77551abd42a: Make the test fail if compiled without -threaded.
Mar 28 2017, 5:32 AM
simonmar committed rGHC074d13eb3b64: Fix #13433 (authored by simonmar).
Fix #13433
Mar 28 2017, 5:31 AM
simonmar closed D3386: Fix #13433 by committing rGHC074d13eb3b64: Fix #13433.
Mar 28 2017, 5:31 AM

Mar 27 2017

simonmar created D3387: Make the test fail if compiled without -threaded.
Mar 27 2017, 10:10 AM
simonmar updated the diff for D3386: Fix #13433.

wibble

Mar 27 2017, 7:18 AM
simonmar created D3386: Fix #13433.
Mar 27 2017, 7:16 AM

Mar 20 2017

simonmar accepted D3362: Fix Windows x86 build.
Mar 20 2017, 4:13 AM
simonmar requested changes to D3358: base: Implement bit casts between word and float types.

The right way to do this is to add new MachOps and implement them for all the native backends and LLVM. However, that's a lot of work and the Cmm versions are a reasonable second-best. (let's avoid the ByteArray# versions if we can)

Mar 20 2017, 4:02 AM

Mar 17 2017

simonmar added a comment to D3269: Deserialize IfaceId more lazily.

IdInfo is already lazy, BTW. Maybe this should just cover the ty and details.

Mar 17 2017, 9:45 AM

Mar 16 2017

simonmar accepted D3350: Drop dead code in rts/{Prelude.h,package.conf.in}.

Yep, ok.

Mar 16 2017, 3:52 AM

Mar 14 2017

simonmar added a comment to D3336: Mark far fewer primops has_side_effects.

We have the State# token yes, which enforces ordering of operations with respect to each other. So a read following a write will always occur in that order, as enforced by the state token passing.

Mar 14 2017, 8:45 AM
simonmar added a comment to D3336: Mark far fewer primops has_side_effects.

We should probably have the test case from Trac #3207 in the test suite (I'm not sure why I didn't add it before)

Mar 14 2017, 5:01 AM
simonmar added a comment to D3336: Mark far fewer primops has_side_effects.

Ugh. No, there's no centralized place that describes these things as far as I know.

Mar 14 2017, 5:00 AM

Mar 13 2017

simonmar added a comment to D3336: Mark far fewer primops has_side_effects.

Currently, there's a mismatch between the note on has_side_effects, which says it should be False for read-only primops, and primops.txt.pp, which makes it True for these.

Mar 13 2017, 1:10 PM
simonmar added a comment to D3336: Mark far fewer primops has_side_effects.

What's the rationale here? The commit log is a bit brief :)

Mar 13 2017, 12:01 PM
simonmar added a comment to D3319: Fix Windows GCC driver.

I don't think I wrote this code, but my guess is that it has to do with proper handling of Ctrl-C. Can we still correctly interrupt compilation during the gcc phase without this?

Mar 13 2017, 3:47 AM

Mar 9 2017

simonmar added a comment to D3298: RFC: Always build GHCi libs.

If I understand correctly this is saying that loading the .a is faster than loading the .so?

Mar 9 2017, 6:50 AM

Mar 8 2017

simonmar added a comment to D3298: RFC: Always build GHCi libs.

It seems to be 80MB on disk, which comparing to an unpacked binary dist I have lying around (8.0.1) looks to be about 7%.

Mar 8 2017, 9:13 AM
simonmar updated the diff for D3298: RFC: Always build GHCi libs.
  • Simplify; the way I was doing this was wrong
  • Don't build a GHCi lib for the GHC package
Mar 8 2017, 9:08 AM
simonmar planned changes to D3298: RFC: Always build GHCi libs.

Good point about the GHC package. The logic is here: https://phabricator.haskell.org/diffusion/GHC/browse/master/compiler/ghc.mk;8e053700f9357c1b9030c406130062795ae5015c$603-611

Mar 8 2017, 8:56 AM
simonmar created D3298: RFC: Always build GHCi libs.
Mar 8 2017, 7:35 AM

Mar 6 2017

simonmar accepted D3233: Enter iserv-proxy.

Ok, thanks for taking the time to explain the rationale for the design. I understand that things are evolving, my main concern is that we should be careful to capture the rationale in such a way that someone reading the code in the future can understand the constraints on the design - so preferably include Notes that explain why things are the way they are (in particular why we need to parse messages in the proxy), or use wiki pages with links from the code.

Mar 6 2017, 3:59 AM