Re: "Merge-buddy" request

2023-10-27 Thread Alexandre Rodrigues Baldé
Zubin has already kindly volunteered; if a second review is needed, I also 
don't mind taking a look - though I might need some context.

I'm @rockbmb

From: ghc-devs  on behalf of Alan & Kim Zimmerman 

Sent: 27 October 2023 16:03
To: Zubin Duggal 
Cc: ghc-devs 
Subject: Re: "Merge-buddy" request

Thanks Zubin.

And to re-iterate on what Simon said, I will cheerfully have a discussion with 
anyone who needs context for these.

Alan

On Fri, 27 Oct 2023, 12:24 Zubin Duggal, 
mailto:zu...@well-typed.com>> wrote:
Feel free to assign me for reviews.

On 23/10/26 17:10, Alan & Kim Zimmerman wrote:
>Hi all
>
>I have been landing a series of MRs to simplify the exact print annotations.
>They are split into pieces so each change is not too big.
>I still have quite a number of them to land, but am finding the process
>slow, as I
>
>- make the MR
>- wait for CI to go green
>- wait for a review, or ping people on chat to do the review
>- once approved, land it.
>
>I don't want to loudly shout for reviewers each time, and become a general
>irritant.
>
>Is there anyone (ideally with an interest in the exact print annotations)
>that would like to be my "merge buddy" that I can easily ask to do the
>reviews?
>
>I am happy for each one to take a couple of days, so it is not a high
>pressure thing, I just want to get into a cadence on them.
>
>My current one is https://gitlab.haskell.org/ghc/ghc/-/merge_requests/11496.
>Admittedly only one reviewer requested, and he is always busy, and I do not
>want to make him even more so.
>
>Alan

>___
>ghc-devs mailing list
>ghc-devs@haskell.org
>http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: PMC: addConCt and newtypes bottom info

2023-10-27 Thread Sebastian Graf

Hi Rodrigo,

Happy to see that you resumed your work on the pattern-match checker.
I think you are right; we could reasonably just go with your code, not 
least because it is less confusing to retain as much info about `x` as 
possible.
I don't think it makes a difference, because whenever we add a 
constraint `x ≁ ⊥` afterwards, we call `addNotBotCt` which will 
interpret this constraint as `y ≁ ⊥` via `lookupVarInfoNT`, and we have 
accurate BotInfo for `y`.
Basically whenever we have seen `x ~ T y`, `T` Newtype, we will never 
look at `BotInfo` of `x` again. I thought it might become relevant in 
`generateInhabitingPatterns` for warning messages, but there we eagerly 
instantiate through NTs anyway.


So by all means, open an MR for your change. Good work!

Sebastian

-- Originalnachricht --
Von: "Rodrigo Mesquita" 
An: "Sebastian Graf" 
Cc: "GHC developers" 
Gesendet: 27.10.2023 17:34:29
Betreff: PMC: addConCt and newtypes bottom info


Dear Sebastian and GHC devs,

Regarding this bit from the function addConCt in the 
GHC.HsToCore.Pmc.Solver module,


Nothing -> do
  let pos' = PACA alt tvs args : pos
  let nabla_with bot' =
nabla{ nabla_tm_st = ts{ts_facts = addToUSDFM env x 
(vi{vi_pos = pos', vi_bot = bot'})} }

  -- Do (2) in Note [Coverage checking Newtype matches]
  case (alt, args) of
(PmAltConLike (RealDataCon dc), [y]) | isNewDataCon dc ->
  case bot of
MaybeBot -> pure (nabla_with MaybeBot)
IsBot-> addBotCt (nabla_with MaybeBot) y
IsNotBot -> addNotBotCt (nabla_with MaybeBot) y
_ -> assert (isPmAltConMatchStrict alt )
 pure (nabla_with IsNotBot) -- strict match ==> not ⊥

My understanding is that given some x which we know e.g. cannot be 
bottom, if we learn that x ~ N y, where N is a newtype (NT), we move 
our knowledge of x not being bottom to the underlying NT Id y, since 
forcing the newtype in a pattern is equivalent to forcing the 
underlying NT Id.


Additionally, we set x’s BottomInfo to MaybeBot —
However, I don’t understand why we must reset x’s BotInfo to MaybeBot — 
couldn’t we keep it as it is while setting y’s BotInfo to the same 
info?
An example where resetting this info on the newtype-match is 
important/necessary would be excellent.


FWIW, I built and tested the PMC of ghc devel2 with

MaybeBot -> pure (nabla_with MaybeBot)
IsBot-> addBotCt (nabla_with IsBot) y
IsNotBot -> addNotBotCt (nabla_with IsNotBot) y

And it worked without warnings or errors…

Thanks in advance!
Rodrigo___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


PMC: addConCt and newtypes bottom info

2023-10-27 Thread Rodrigo Mesquita
Dear Sebastian and GHC devs,

Regarding this bit from the function addConCt in the GHC.HsToCore.Pmc.Solver 
module,

Nothing -> do
  let pos' = PACA alt tvs args : pos
  let nabla_with bot' =
nabla{ nabla_tm_st = ts{ts_facts = addToUSDFM env x (vi{vi_pos = 
pos', vi_bot = bot'})} }
  -- Do (2) in Note [Coverage checking Newtype matches]
  case (alt, args) of
(PmAltConLike (RealDataCon dc), [y]) | isNewDataCon dc ->
  case bot of
MaybeBot -> pure (nabla_with MaybeBot)
IsBot-> addBotCt (nabla_with MaybeBot) y
IsNotBot -> addNotBotCt (nabla_with MaybeBot) y
_ -> assert (isPmAltConMatchStrict alt )
 pure (nabla_with IsNotBot) -- strict match ==> not ⊥

My understanding is that given some x which we know e.g. cannot be bottom, if 
we learn that x ~ N y, where N is a newtype (NT), we move our knowledge of x 
not being bottom to the underlying NT Id y, since forcing the newtype in a 
pattern is equivalent to forcing the underlying NT Id.

Additionally, we set x’s BottomInfo to MaybeBot —
However, I don’t understand why we must reset x’s BotInfo to MaybeBot — 
couldn’t we keep it as it is while setting y’s BotInfo to the same info?
An example where resetting this info on the newtype-match is 
important/necessary would be excellent.

FWIW, I built and tested the PMC of ghc devel2 with

MaybeBot -> pure (nabla_with MaybeBot)
IsBot-> addBotCt (nabla_with IsBot) y
IsNotBot -> addNotBotCt (nabla_with IsNotBot) y

And it worked without warnings or errors…

Thanks in advance!
Rodrigo___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: "Merge-buddy" request

2023-10-27 Thread Alan & Kim Zimmerman
Thanks Zubin.

And to re-iterate on what Simon said, I will cheerfully have a discussion
with anyone who needs context for these.

Alan

On Fri, 27 Oct 2023, 12:24 Zubin Duggal,  wrote:

> Feel free to assign me for reviews.
>
> On 23/10/26 17:10, Alan & Kim Zimmerman wrote:
> >Hi all
> >
> >I have been landing a series of MRs to simplify the exact print
> annotations.
> >They are split into pieces so each change is not too big.
> >I still have quite a number of them to land, but am finding the process
> >slow, as I
> >
> >- make the MR
> >- wait for CI to go green
> >- wait for a review, or ping people on chat to do the review
> >- once approved, land it.
> >
> >I don't want to loudly shout for reviewers each time, and become a general
> >irritant.
> >
> >Is there anyone (ideally with an interest in the exact print annotations)
> >that would like to be my "merge buddy" that I can easily ask to do the
> >reviews?
> >
> >I am happy for each one to take a couple of days, so it is not a high
> >pressure thing, I just want to get into a cadence on them.
> >
> >My current one is
> https://gitlab.haskell.org/ghc/ghc/-/merge_requests/11496.
> >Admittedly only one reviewer requested, and he is always busy, and I do
> not
> >want to make him even more so.
> >
> >Alan
>
> >___
> >ghc-devs mailing list
> >ghc-devs@haskell.org
> >http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: "Merge-buddy" request

2023-10-27 Thread Zubin Duggal

Feel free to assign me for reviews.

On 23/10/26 17:10, Alan & Kim Zimmerman wrote:

Hi all

I have been landing a series of MRs to simplify the exact print annotations.
They are split into pieces so each change is not too big.
I still have quite a number of them to land, but am finding the process
slow, as I

- make the MR
- wait for CI to go green
- wait for a review, or ping people on chat to do the review
- once approved, land it.

I don't want to loudly shout for reviewers each time, and become a general
irritant.

Is there anyone (ideally with an interest in the exact print annotations)
that would like to be my "merge buddy" that I can easily ask to do the
reviews?

I am happy for each one to take a couple of days, so it is not a high
pressure thing, I just want to get into a cadence on them.

My current one is https://gitlab.haskell.org/ghc/ghc/-/merge_requests/11496.
Admittedly only one reviewer requested, and he is always busy, and I do not
want to make him even more so.

Alan



___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: "Merge-buddy" request

2023-10-27 Thread Simon Peyton Jones
I hope someone responds to Alan's call.   Simplifying exact-print
annotations is a noble goal, and Alan has been working hard on it.

I hope someone feels able to support him.  I don't think you need to be an
exact-print expert. I'm sure Alan would be happy to teach you.  And that
learning journey might be very useful in itself, because it'll tell you
want extra documentation (especially overview notes) is needed.

Big thanks to Alan

Simon

On Thu, 26 Oct 2023 at 18:11, Alan & Kim Zimmerman 
wrote:

> Hi all
>
> I have been landing a series of MRs to simplify the exact print
> annotations.
> They are split into pieces so each change is not too big.
> I still have quite a number of them to land, but am finding the process
> slow, as I
>
> - make the MR
> - wait for CI to go green
> - wait for a review, or ping people on chat to do the review
> - once approved, land it.
>
> I don't want to loudly shout for reviewers each time, and become a general
> irritant.
>
> Is there anyone (ideally with an interest in the exact print annotations)
> that would like to be my "merge buddy" that I can easily ask to do the
> reviews?
>
> I am happy for each one to take a couple of days, so it is not a high
> pressure thing, I just want to get into a cadence on them.
>
> My current one is
> https://gitlab.haskell.org/ghc/ghc/-/merge_requests/11496.  Admittedly
> only one reviewer requested, and he is always busy, and I do not want to
> make him even more so.
>
> Alan
>
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs