<html><head></head><body>I think it would be worth trying to add tuples up to width 64. The only real cost here is the interface file size of GHC.Tuple and if adding a 63-wide tuple really does induce a crash then that is a bug in its own right that deserves investigation. <br><br>- Ben <br><br><div class="gmail_quote">On September 26, 2020 8:26:32 AM EDT, Ryan Scott <ryan.gl.scott@gmail.com> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr"><div>I had a feeling that this might be the case. Unfortunately, this technology preview is actively blocking progress on
!4097, which leaves me at a loss for what to do. I can see two ways forward:</div><div><br></div><div>1. Remove
<span>unpackInt8X64#</span>
and friends.</div><div>2. Reconsider whether the tuple size limit should apply to unboxed tuples. Perhaps this size limit only makes sense for boxed tuples? This comment [1] suggests that defining a boxed tuple of size greater than 62 induces a segfault, but it's unclear to me if the same thing happens for unboxed tuples.<br></div><div><br></div><div>Ryan S.</div><div>-----</div><div>[1] <a href="https://gitlab.haskell.org/ghc/ghc/-/blob/a1f34d37b47826e86343e368a5c00f1a4b1f2bce/libraries/ghc-prim/GHC/Tuple.hs#L170">https://gitlab.haskell.org/ghc/ghc/-/blob/a1f34d37b47826e86343e368a5c00f1a4b1f2bce/libraries/ghc-prim/GHC/Tuple.hs#L170</a>
</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 26, 2020 at 7:54 AM Ben Gamari <<a href="mailto:ben@smart-cactus.org" target="_blank">ben@smart-cactus.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On September 25, 2020 6:21:23 PM EDT, Ryan Scott <<a href="mailto:ryan.gl.scott@gmail.com" target="_blank">ryan.gl.scott@gmail.com</a>> wrote:<br>
...<br>
>However, I discovered recently that there are places where GHC *does*<br>
>use<br>
>unboxed tuples with arity greater than 62. For example, the<br>
>GHC.Prim.unpackInt8X64# [2] function returns an unboxed tuple of size<br>
>64. I<br>
>was confused for a while about how this was even possible, but I<br>
>realized<br>
>later than GHC only enforces the tuple size limit in expressions and<br>
>patterns [3]. Simply having a type signature with a large unboxed tuple<br>
>is<br>
>fine in and of itself, and since unpackInt8X64# is implemented as a<br>
>primop,<br>
>no large unboxed tuples are ever used in the "body" of the function.<br>
>(Indeed, primops don't have function bodies in the conventional sense.)<br>
>Other functions in GHC.Prim that use unboxed tuples of arity 64 include<br>
>unpackWord8X64# [4], packInt8X64# [5], and packWord8X64# [6].<br>
><br>
>But this makes me wonder: how on earth is it even possible to *use*<br>
>unpackInt8X64#? <br>
<br>
<br>
I strongly suspect that the answer here is "you can't yet no one has noticed until now." The SIMD operations were essentially introduced as a technology preview and therefore never had proper tests added. Only a subset of these operations have any tests at all and I doubt anyone has attempted to use the 64-wide operations, which are rather specialized.<br>
<br>
Cheers,<br>
<br>
- Ben <br>
</blockquote></div>
</blockquote></div><br>-- <br>Sent from my Android device with K-9 Mail. Please excuse my brevity.</body></html>