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 (163 w, 3 d)
Availability
Available

Recent Activity

Mon, Jul 24

simonmar added a comment to D3741: Stg.h: Reintroduce removed EI_/II_ for bootstrapping.

We should probably revisit that...

Mon, Jul 24, 10:40 AM
simonmar added a comment to D3770: Avoid linear lookup in unload_wkr in the Linker.

Nice catch!

Mon, Jul 24, 4:37 AM

Fri, Jul 21

simonmar requested changes to D3769: ghc-prim: Don't allocate a thunk for each unpacked UTF-8 character.
Fri, Jul 21, 11:37 AM

Thu, Jul 20

simonmar accepted D3760: rts: Claim AP_STACK before adjusting Sp.

nicecatch

Thu, Jul 20, 2:39 AM

Tue, Jul 18

simonmar accepted D3746: ByteCodeGen: use byte indexing for BCenv.

Didn't read it all in detail, but in principle this looks fine. Please fix the long lines before committing.

Tue, Jul 18, 7:15 AM
simonmar committed rGHC12ae1fa51b2f: Fix a missing getNewNursery(), and related cleanup (authored by simonmar).
Fix a missing getNewNursery(), and related cleanup
Tue, Jul 18, 6:46 AM
simonmar closed D3749: Fix a missing getNewNursery(), and related cleanup by committing rGHC12ae1fa51b2f: Fix a missing getNewNursery(), and related cleanup.
Tue, Jul 18, 6:46 AM

Mon, Jul 17

Herald added a reviewer for D3749: Fix a missing getNewNursery(), and related cleanup: austin.
Mon, Jul 17, 11:36 AM
simonmar added inline comments to D3741: Stg.h: Reintroduce removed EI_/II_ for bootstrapping.
Mon, Jul 17, 3:13 AM
simonmar accepted D3740: Add rtsopts ignore and ignoreAll..

I think this is OK, none and ignore are different use cases, although perhaps ignore is generally more useful.

Mon, Jul 17, 2:50 AM

Wed, Jul 12

simonmar accepted D3724: testsuite: Ensure that hs_try_putmvar003 terminates.

Yep, that oughta do it.

Wed, Jul 12, 6:04 AM

Mon, Jul 10

simonmar accepted D3703: Make module membership on ModuleGraph faster.

Ok, this looks better without mgHead and mgReverse.

Mon, Jul 10, 6:44 AM
simonmar accepted D3658: Fix Work Balance computation in RTS stats.

LGTM

Mon, Jul 10, 3:23 AM
simonmar accepted D3710: users-guide/rel-notes: Describe #13875 fix.
Mon, Jul 10, 2:48 AM
simonmar accepted D3708: ByteCodeGen: use depth instead of offsets in BCEnv.
Mon, Jul 10, 2:46 AM

Wed, Jul 5

simonmar added inline comments to D3682: users-guide: Document FFI safety guarantees.
Wed, Jul 5, 8:50 AM
simonmar requested changes to D3618: Use CAS in unsafeThawArray.

Agree, let's not do this.

Wed, Jul 5, 8:47 AM

Tue, Jul 4

simonmar added inline comments to D3695: Eagerly blackhole AP_STACKs.
Tue, Jul 4, 7:17 AM

Mon, Jul 3

simonmar added inline comments to D3695: Eagerly blackhole AP_STACKs.
Mon, Jul 3, 3:49 AM

Fri, Jun 30

simonmar added inline comments to D3691: ApplicativeDo: document behaviour with strict patterns (#13875).
Fri, Jun 30, 2:52 PM
simonmar added inline comments to D3691: ApplicativeDo: document behaviour with strict patterns (#13875).
Fri, Jun 30, 2:29 PM
simonmar created D3691: ApplicativeDo: document behaviour with strict patterns (#13875).
Fri, Jun 30, 8:14 AM
simonmar requested changes to D3685: rts: Fix isByteArrayPinned#'s treatment of large arrays.
Fri, Jun 30, 5:46 AM
simonmar added a comment to D3689: Document ApplicativeDo change.

Ah, I was already working on changes to the user manual that we could just link to from the release notes. Better to have this in one place I think, and we need it in the manual proper.

Fri, Jun 30, 3:12 AM

Thu, Jun 29

simonmar added inline comments to D3682: users-guide: Document FFI safety guarantees.
Thu, Jun 29, 3:19 AM

Wed, Jun 28

simonmar added a comment to D3681: Prevent ApplicativeDo from applying to strict pattern matches (#13875).

I don't think it matters, the fix for Trac #13242 was the right thing anyway, but now we don't need to call out existentials in the docs because the problem doesn't arise. I'm just revising the docs so I'll do this.

Wed, Jun 28, 11:23 AM
simonmar updated the diff for D3681: Prevent ApplicativeDo from applying to strict pattern matches (#13875).

fix test

Wed, Jun 28, 10:55 AM
simonmar updated the diff for D3681: Prevent ApplicativeDo from applying to strict pattern matches (#13875).

fix comment

Wed, Jun 28, 10:48 AM
simonmar created D3681: Prevent ApplicativeDo from applying to strict pattern matches (#13875).
Wed, Jun 28, 10:46 AM
simonmar added inline comments to D3449: configure: Coerce gcc to use $LD instead of system default.
Wed, Jun 28, 7:12 AM
simonmar updated the diff for D3680: Tag the FUN before making a PAP (#13767).

add xref to wiki

Wed, Jun 28, 6:24 AM
simonmar added a comment to D3680: Tag the FUN before making a PAP (#13767).

FYI, the invariants are actually pretty well documented here: https://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts/HaskellExecution/PointerTagging (I wish I'd checked that earlier)

Wed, Jun 28, 6:22 AM
Herald added a reviewer for D3680: Tag the FUN before making a PAP (#13767): austin.
Wed, Jun 28, 6:13 AM
simonmar added a comment to D3674: rts: Clarify whitehole logic in threadPaused.

I'd forgotten why we might have a WHITEHOLE here, and I think the only reason is that lockCAF uses it temporarily while entering a CAF. Normal non-CAF BLACKHOLEs can never be WHITEHOLE, I believe.

Wed, Jun 28, 6:01 AM

Jun 26 2017

simonmar accepted D3669: rts: Always collect stats.

Thanks @bgamari, I hadn't noticed that we enabled this by default.

Jun 26 2017, 2:56 AM
simonmar added a comment to D3589: Add support for producing position-independent executables.

The suggestion was probably misguided, just ignore it.

Jun 26 2017, 2:50 AM

Jun 22 2017

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

Jun 21 2017

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.

Jun 21 2017, 2:48 AM

Jun 19 2017

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?

Jun 19 2017, 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!

Jun 19 2017, 2:54 AM

Jun 16 2017

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.

Jun 16 2017, 8:26 AM

Jun 15 2017

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.

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

Jun 15 2017, 5:47 AM
simonmar accepted D3648: Fix GCC 7 warning in the RTS.
Jun 15 2017, 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.
Jun 15 2017, 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?

Jun 15 2017, 2:14 AM

Jun 13 2017

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?

Jun 13 2017, 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!

Jun 13 2017, 2:23 AM

Jun 12 2017

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

Looks good!

Jun 12 2017, 8:24 AM

Jun 11 2017

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

Jun 8 2017

simonmar accepted D3620: Refactor temp files cleanup.

The naming looks much better.

Jun 8 2017, 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)
Jun 8 2017, 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).
Jun 8 2017, 2:39 AM

Jun 7 2017

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

rebase

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

spelling

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

indentation & lint

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

Jun 1 2017

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).
Jun 1 2017, 3:57 AM
simonmar requested changes to D3619: Allow bytecode interpreter to make unsafe foreign calls.

Are the test failures relevant?

Jun 1 2017, 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.

Jun 1 2017, 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?

Jun 1 2017, 2:57 AM

May 30 2017

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.

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

nicecatch

May 30 2017, 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

May 30 2017, 2:40 AM

May 24 2017

simonmar added a comment to D3603: Faster checkFamInstConsistency.

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

May 24 2017, 10:38 AM

May 23 2017

simonmar added a comment to D3589: Add support for producing position-independent 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