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 (158 w, 4 d)
Availability
Available

Recent Activity

Today

simonmar added inline comments to D3658: Fix Work Balance computation in RTS stats.
Thu, Jun 22, 3:07 AM

Yesterday

simonmar accepted D3619: Allow bytecode interpreter to make unsafe foreign calls.

Ah, I think this will only work with the non-threaded RTS, and we can't easily test that because we'd have to relink GHCi. Sorry about that! Just remove the test and we're good to go.

Wed, Jun 21, 2:48 AM

Mon, Jun 19

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

@AaronFriel the issue is that type error messages will display the transformed code, and not the original code that the user wrote. You'll see this if you construct an example that (a) is subject to the new transformation introduced by your patch, and (b) contains a type error that includes the transformed code. ApplicativeDo as currently implemented avoids this problem because when pretty-printed, ApplicativeStmt looks exactly like the original source code. If we turn a BodyStmt into a BindStmt, then we lose that property. Does that help?

Mon, Jun 19, 3:00 AM
simonmar requested changes to D3658: Fix Work Balance computation in RTS stats.

So I agree there's a bug here, but I'm afraid I don't understand the fix!

Mon, Jun 19, 2:54 AM

Fri, Jun 16

simonmar accepted D3616: Hoopl: remove dependency on Hoopl package.

We're good to go here. I talked to @simonpj and we agreed that this direction is fine for now, in the future we can think about redesigning hoopl and once again extracting it from GHC.

Fri, Jun 16, 8:26 AM

Thu, Jun 15

simonmar accepted D3519: [WIP] rts: Disable AdjustorAsm on soft-float PowerPC.

The title says WIP, but I'm not sure what's still IP here. Seems reasonable so I'll accept anyway.

Thu, Jun 15, 6:19 AM
simonmar added a comment to D3646: Make module membership on ModuleGraph faster.

Hmm. I'm not really keen on the design here, particularly the way that ModuleGraph contains both a [ModSummary] and also the ModuleEnvs. Can we make ModuleGraph not keep the [ModSummary]? Perhaps topSortModuleGraph could return [ModSummary], not ModuleGraph. Or perhaps it should really contain a graph, so that you can get the top-sorted order any time you like.

Thu, Jun 15, 5:47 AM
simonmar accepted D3648: Fix GCC 7 warning in the RTS.
Thu, Jun 15, 3:29 AM
simonmar added a comment to D3647: Introduce module hierarchy.
  1. Do we want to do this? I think we should, being careful to provide a smooth migration path for existing users. Let's discuss how exactly to do this before any changes take place.
Thu, Jun 15, 3:28 AM
simonmar added a comment to D3586: cmm/CmmLayoutStack: avoid generating unnecessary reloads.

Very mysterious. @bgamari any idea what might cause the strange behaviour that @michalt reports above?

Thu, Jun 15, 2:14 AM

Tue, Jun 13

simonmar accepted D3586: cmm/CmmLayoutStack: avoid generating unnecessary reloads.

I think you need to adjust the bounds on the perf tests again. Did T13379 regress?

Tue, Jun 13, 3:13 AM
simonmar added a comment to D3640: Fix a bug in -foptimal-applicative-do.

@bgamari please merge this to the 8.2 branch if you'd be so kind!

Tue, Jun 13, 2:23 AM

Mon, Jun 12

simonmar created D3640: Fix a bug in -foptimal-applicative-do.
Mon, Jun 12, 12:17 PM
simonmar accepted D3633: Fix #13807 - foreign import nondeterminism.

Looks good!

Mon, Jun 12, 8:24 AM

Sun, Jun 11

simonmar requested changes to D3633: Fix #13807 - foreign import nondeterminism.
Sun, Jun 11, 7:18 AM

Thu, Jun 8

simonmar accepted D3620: Refactor temp files cleanup.

The naming looks much better.

Thu, Jun 8, 3:09 AM
simonmar committed rGHC598472908ebb: Fix a lost-wakeup bug in BLACKHOLE handling (#13751) (authored by simonmar).
Fix a lost-wakeup bug in BLACKHOLE handling (#13751)
Thu, Jun 8, 2:39 AM
simonmar closed D3630: Fix a lost-wakeup bug in BLACKHOLE handling (#13751) by committing rGHC598472908ebb: Fix a lost-wakeup bug in BLACKHOLE handling (#13751).
Thu, Jun 8, 2:39 AM

Wed, Jun 7

simonmar added inline comments to D3630: Fix a lost-wakeup bug in BLACKHOLE handling (#13751).
Wed, Jun 7, 8:28 AM
simonmar updated the diff for D3630: Fix a lost-wakeup bug in BLACKHOLE handling (#13751).

rebase

Wed, Jun 7, 7:20 AM
simonmar updated the diff for D3630: Fix a lost-wakeup bug in BLACKHOLE handling (#13751).

spelling

Wed, Jun 7, 5:34 AM
simonmar updated the diff for D3630: Fix a lost-wakeup bug in BLACKHOLE handling (#13751).

indentation & lint

Wed, Jun 7, 5:31 AM
Herald added a reviewer for D3630: Fix a lost-wakeup bug in BLACKHOLE handling (#13751): austin.
Wed, Jun 7, 5:27 AM

Thu, Jun 1

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.

Cool, thanks for having a look! Yes, sinking pass would usually remove all those reloads. But the liveness analysis it's doing would be quite a bit slower due to the size of the Cmm.

One question about the approach do we have to do a combined analysis/rewrite, or can we just do a liveness analysis (with emptying the live set at a proc-point) followed by inserting the reloads? It's not clear why this new machinery is needed.

Yes, this shouldn't be necessary now (I experimented with the rewriting in my earlier approach). I'll change it to use just existing analysis pass.
Later we can consider using the rewriting approach to remove dead assignments *and* calculate liveness at the same time.

Actually, this is not quite accurate. There is a good reason to interleave rewriting and analysis:

  • When adding reloads in a proc-point we need to know what is live in the body of that block and any non-proc-point blocks that are reachable from it.
  • But for propagating the dataflow facts (ie, when analyzing the blocks preceding the current one), we want to say that nothing is live at the entry of a proc-point. So we actually need to track two things. If we want to avoid interleaving the rewriting and analysis, we would need to create another DataflowLattice that has not only liveness information, but also something additional that would allow us to figure out what regs to reload (eg, we could probably just store the set of registers to reload).
Thu, Jun 1, 3:57 AM
simonmar requested changes to D3619: Allow bytecode interpreter to make unsafe foreign calls.

Are the test failures relevant?

Thu, Jun 1, 3:31 AM
simonmar added a comment to D3620: Refactor temp files cleanup.

This looks OK in general, but somehow I feel like there's a more general solution trying to get out.

Thu, Jun 1, 3:17 AM
simonmar accepted D3622: Use lengthIs and friends in more places.

Sure, looks good to me. Does it make any difference to the perf tests?

Thu, Jun 1, 2:57 AM

Tue, May 30

simonmar added a comment to D3616: Hoopl: remove dependency on Hoopl package.

I won't object, other than to note that this is typically the opposite direction that we normally want to go in, that is to use third-party libraries via their normal APIs rather than to fork them. We're trying to go in the other direction with pretty, for example. Having said that, I know it's difficult to reconcile some of the divergence without losing performance, particularly the manual specialisation. But some of the other impedence mismatch could be worked around, by either unifying APIs or centralising a renaming layer.

Tue, May 30, 3:42 AM
simonmar added a comment to D3611: Efficient checks for stable modules.

nicecatch

Tue, May 30, 3:00 AM
simonmar accepted D3618: Use CAS in unsafeThawArray.

Looks right to me, just need to fix the copy/pasto pointed out by @alexbiehl

Tue, May 30, 2:40 AM

Wed, May 24

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

May 23 2017

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.

May 23 2017, 10:57 AM

May 22 2017

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.

May 22 2017, 2:41 AM

May 18 2017

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.

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

May 17 2017

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

How malleable is the Q monad?

May 17 2017, 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.

May 17 2017, 11:17 AM

May 16 2017

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

May 15 2017

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.

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

@simonmar, what do you think about this?

May 15 2017, 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.

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

If it works on Windows, go for it.

May 15 2017, 2:33 AM

May 11 2017

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.

May 11 2017, 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.

May 11 2017, 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.

May 11 2017, 2:56 AM

May 10 2017

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.

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

nicecatch

May 10 2017, 5:17 AM

May 9 2017

simonmar accepted D3560: rts: Don't build StgCRunAsm.S if unregisterised.
May 9 2017, 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

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

May 8 2017

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

@kavon should have a look at this too

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

May 5 2017

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.

May 5 2017, 6:31 AM

May 4 2017

simonmar accepted D3527: Abandon typedefing the {Section,ObjectCode}FormatInfo structs.
May 4 2017, 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?

May 4 2017, 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.

May 4 2017, 2:43 AM

May 3 2017

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?

May 3 2017, 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?

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

Apr 28 2017

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

Apr 27 2017

simonmar added inline comments to D3447: [linker] Add ocInit/ocDeinit for ELF.
Apr 27 2017, 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?

Apr 27 2017, 2:36 AM

Apr 26 2017

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.

Apr 26 2017, 5:05 AM

Apr 25 2017

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"

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