Re: Using Vine in 3-way interactions (was Re: Question on redirectors/whenMoreResolved in the 3-way case, in the middle vat)

Rob Withers <[email protected]> Wed, 11 Mar 2015 17:50:44 -0600
Newsgroups gmane.comp.lang.e.general
Message-ID <[email protected]>
--===============2437347301083258371==
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

<html>
  <head>
    <meta content=3D"text/html; charset=3Dwindows-1252"
      http-equiv=3D"Content-Type">
  </head>
  <body bgcolor=3D"#FFFFFF" text=3D"#000000">
    <br>
    <br>
    <div class=3D"moz-cite-prefix">On 3/11/2015 3:00 PM, Mark S. Miller
      wrote:<br>
    </div>
    <blockquote
cite=3D"mid:CABHxS9i+D=3D06UC91ob87o6nrNXhrnUgDZsGdqsm7uuyUdD8a6Q-Rq2MYuBUFGs@public.gmane.org=
ail.com"
      type=3D"cite">
      <div dir=3D"ltr"><br>
        <div class=3D"gmail_extra"><br>
          <div class=3D"gmail_quote">On Tue, Mar 10, 2015 at 11:56 AM, Ro=
b
            Withers <span dir=3D"ltr">&lt;<a moz-do-not-send=3D"true"
                href=3D"mailto:[email protected]" target=3D"_bla=
nk">[email protected]</a>&gt;</span>
            wrote:<br>
            <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-lef=
t-style:solid;padding-left:1ex">
              <div bgcolor=3D"#FFFFFF" text=3D"#000000"><span class=3D"">=
 <br>
                  <br>
                  <div>On 3/8/2015 7:35 PM, Rob Withers wrote:<br>
                  </div>
                  <blockquote type=3D"cite"> <br>
                    <div>On 3/8/2015 5:58 PM, Mark S. Miller wrote:<br>
                    </div>
                    <blockquote type=3D"cite">
                      <div dir=3D"ltr"><br>
                        <div class=3D"gmail_extra"><br>
                          <div class=3D"gmail_quote">On Sun, Mar 8, 2015
                            at 7:33 AM, Rob Withers <span dir=3D"ltr">&lt=
;<a
                                moz-do-not-send=3D"true"
                                href=3D"mailto:[email protected]=
"
                                target=3D"_blank">robert.w.withers@gmail.=
com</a>&gt;</span>
                            wrote:<br>
                            <blockquote class=3D"gmail_quote"
                              style=3D"margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-lef=
t-style:solid;padding-left:1ex">
                              <div bgcolor=3D"#FFFFFF" text=3D"#000000"> =
I
                                had not realized I had posed such a
                                challenging situation.=A0 In mulling over
                                what needs to happen, I think the
                                followOn message send (#hashCode) needs
                                to be a 3-vat situation, <b>of the
                                  Resolver</b>, to prevent GC.=A0 Here ar=
e
                                the steps I think are needed, #6 being
                                the point where my system is failing,
                                due to its absence? <br>
                              </div>
                            </blockquote>
                            <div><br>
                            </div>
                            <div>Hi Rob, I don't think I understand the
                              scenario that's driving this. I went back
                              to the beginning of the thread and found</d=
iv>
                          </div>
                        </div>
                      </div>
                    </blockquote>
                    <br>
                    Hi Mark, I suppose it is best to just post the
                    pertinent code. First is the GalaxyObject, the test
                    object:<br>
                    <br>
                    <font face=3D"Palatino Linotype" size=3D"-2">public
                      class GalaxyObject {</font><br>
                    <font face=3D"Palatino Linotype" size=3D"-2">=A0=A0=A0=
 public
                      int getTheAnswer() { return 42; }</font><br>
                    <font face=3D"Palatino Linotype" size=3D"-2">=A0=A0=A0=
 public
                      Ref redirectForTheAnswer(Ref ref) throws
                      NotResolvedException { return
                      ref.redirectMessage("getTheAnswer"); }</font><br>
                    <font face=3D"Palatino Linotype" size=3D"-2">}</font>=
<br>
                  </blockquote>
                  <br>
                </span> Hi Mark, does this make sense?=A0
                redirectForTheAnswer sends getTheAnswer to the arg Ref
                and returns the promise.=A0 In the code below, the arg Re=
f
                is Bob, a GalazyObject in a third Vat, so the return of
                redirectForTheAnswer is a RemotePromise.=A0 THe follow on
                message below is #hashCode, is sent to this
                RemotePromise.<span class=3D""><br>
                  =A0 <br>
                  <blockquote type=3D"cite"><font face=3D"Palatino Linoty=
pe"
                      size=3D"-2"> =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 Ref answ=
er =3D
                      alice.redirectMessage("redirectForTheAnswer",
                      bob).redirectMessage("hashCode");<br>
                      =A0 =A0 =A0 =A0 =A0 =A0</font></blockquote>
                </span></div>
            </blockquote>
            <div>Thanks Rob,</div>
            <div><br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <blockquote
cite=3D"mid:CABHxS9i+D=3D06UC91ob87o6nrNXhrnUgDZsGdqsm7uuyUdD8a6Q-Rq2MYuBUFGs@public.gmane.org=
ail.com"
      type=3D"cite">
      <div dir=3D"ltr">
        <div class=3D"gmail_extra">
          <div class=3D"gmail_quote">
            <div>I am able to follow this. As I started going through
              your scenario below, I started thinking "wait, I don't
              *think* that's right". I think of the evolution of
              distributed CapTP state very much using pictures, and
              found myself wanting to draw some. For this kind of thing
              I find slide-by-slide "animations" to show the dynamics is
              good. In terms of the colors and symbology of &lt;<a
                moz-do-not-send=3D"true"
                href=3D"http://erights.org/elib/distrib/captp/4tables.htm=
l">http://erights.org/elib/distrib/captp/4tables.html</a>&gt;,
              would you say that the first (and only at this moment)
              slide of &lt;<a moz-do-not-send=3D"true"
href=3D"https://docs.google.com/presentation/d/1VTMuCVZDPAI1f2aezDEeRUVFU=
ygRroiZcJG6ECKp8Nw/edit#slide=3Did.g8da6f1810_00">https://docs.google.com=
/presentation/d/1VTMuCVZDPAI1f2aezDEeRUVFUygRroiZcJG6ECKp8Nw/edit#slide=3D=
id.g8da6f1810_00</a>&gt;
              accurately reflects the initial conditions you have in
              mind, where Carol has obtain live references for Alice and
              Bob, which has quiesced into export/import far references?<=
/div>
            <div><br>
            </div>
            <div>If so, I'll proceed to illustrate how I think the
              scenario should go, and then compare to your's.
              (Especially when I'm rusty, I need pictures in order to
              think clearly.)</div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    Thanks Mark! That is sweet presentation software.=A0 It absolutely
    looks correct to me, after the lookupSwiss calls have completed for
    alice and bob.=A0 <br>
    <br>
    <blockquote
cite=3D"mid:CABHxS9i+D=3D06UC91ob87o6nrNXhrnUgDZsGdqsm7uuyUdD8a6Q-Rq2MYuBUFGs@public.gmane.org=
ail.com"
      type=3D"cite">
      <div dir=3D"ltr">
        <div class=3D"gmail_extra">
          <div class=3D"gmail_quote">
            <div><br>
            </div>
            <div><br>
            </div>
            <div>In answer to a previous question, the step where 2-vat
              interactions become 3-vat interactions is makeEventualDesc
              at &lt;<a moz-do-not-send=3D"true"
href=3D"https://github.com/tooantuh/pauwau/blob/master/e-jsrc/net/captp/j=
comm/CapTPConnection.java#L504">https://github.com/tooantuh/pauwau/blob/m=
aster/e-jsrc/net/captp/jcomm/CapTPConnection.java#L504</a>&gt;.
              In the upcoming initial message from Carol to Alice with
              Bob as argument, a', while encoding a message for Alice,
              asks itself to encode b' using this function. It sees that
              it has a handler for this comm system, so it is a remote
              reference. It then checks whether it is a remote reference
              with the same connection. In this case it is not.
              Therefore it is a reference to a third vat (Vat2), so it
              calls new3Desc to do the rest of the work.</div>
            <div><br>
            </div>
            <div>I think it corresponds to your steps #1 and #3, which I
              have yet to illustrate. Does this seem right?</div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    Yes, indeed.=A0 I do that work in my Scope object, both
    makeEventualDescriptor() and newPromise3DescriptorHandler().=A0 These
    do correspond to #1 and #3 in my steps.=A0 Step #3 encompasses work
    done in Carol and in Alice.<br>
    <br>
    <br>
    <blockquote
cite=3D"mid:CABHxS9i+D=3D06UC91ob87o6nrNXhrnUgDZsGdqsm7uuyUdD8a6Q-Rq2MYuBUFGs@public.gmane.org=
ail.com"
      type=3D"cite">
      <div dir=3D"ltr">
        <div class=3D"gmail_extra">
          <div class=3D"gmail_quote">
            <div><br>
            </div>
            <div><br>
            </div>
            <div>=A0</div>
            <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-lef=
t-style:solid;padding-left:1ex">
              <div bgcolor=3D"#FFFFFF" text=3D"#000000">
                <div>
                  <div class=3D"h5"> - Robert<br>
                    <br>
                    <blockquote type=3D"cite">
                      <blockquote type=3D"cite">
                        <div dir=3D"ltr">
                          <div class=3D"gmail_extra">
                            <div class=3D"gmail_quote">
                              <div>
                                <blockquote type=3D"cite">
                                  <div class=3D"gmail_extra">
                                    <div class=3D"gmail_quote">
                                      <blockquote class=3D"gmail_quote"
                                        style=3D"margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-lef=
t-style:solid;padding-left:1ex">
                                        <div bgcolor=3D"#FFFFFF"
                                          text=3D"#000000">
                                          <div> On 2/22/2015 6:19 PM,
                                            Rob Withers wrote:<br>
                                          </div>
                                          <blockquote type=3D"cite">I am
                                            stuck, both conceptually, as
                                            well as understanding code I
                                            wrote a long while ago.=A0 I
                                            was hoping to gain a little
                                            insight from the list of the
                                            insides of resolution
                                            redirection in the 3-way
                                            case.=A0 The recent change I
                                            have made results from my
                                            thinking I finally
                                            understand the ordering that
                                            MirandaMethods ensure.=A0 I
                                            made changes such that a
                                            whenMoreResolved directly
                                            follows the message that
                                            generates is by adding to
                                            the front of the msg
                                            queue.=A0=A0<br>
                                            <br>
                                            In the 3-way case, Carol is
                                            sending a message to Alice,
                                            passing Bob.=A0 Alice receive=
s
                                            the message and executes,
                                            which sends a message to
                                            Bob, then returns the result
                                            to Carol.=A0 In Alice's vat,
                                            the DelayedRedirector is
                                            resolved to the
                                            RemotePromise of the call to
                                            Bob, the return of Alice's
                                            computation and I think it
                                            sends whenMoreResolved to
                                            the proxy of the new promise
                                            resolver of the send to
                                            Bob.=A0 What little tracing I
                                            have I am posting below, as
                                            well as the
                                            DelayedRedirector value()
                                            and the ProxyResolver
                                            resolve() code, at the
                                            bottom.=A0 However, this is m=
y
                                            question, what should the
                                            redirector do in Alice's Vat
                                            to propagate the resolution
                                            from Bob, back to Carol?<br>
                                            <br>
                                            Thank you,<br>
                                            - Robert<br>
                                            <br>
                                            <br>
                                            // There are 3 messages sent
                                            to Bob, from Alice:<br>
                                            // =A0=A0=A0 1) getTheAnswer,
                                            which returns 42,=A0<br>
                                            // =A0=A0=A0 2)=A0<b>hashCode=
, again
                                              42</b>=A0and=A0<br>
                                            //=A0=A0 =A0 3)=A0<b>whenMore=
Resolved</b>,
                                            to forward to the redirector
                                            back in Alice.<br>
                                          </blockquote>
                                        </div>
                                      </blockquote>
                                    </div>
                                  </div>
                                </blockquote>
                              </div>
                              <div><br>
                              </div>
                              <div>which still seems to start in the
                                middle, or I may be misunderstanding.
                                What does the user code do, in what
                                initial conditions, that set the rest of
                                this scenario in motion?</div>
                              <div><br>
                              </div>
                              <div><br>
                              </div>
                              <div>=A0</div>
                              <blockquote class=3D"gmail_quote"
                                style=3D"margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-lef=
t-style:solid;padding-left:1ex">
                                <div bgcolor=3D"#FFFFFF" text=3D"#000000"=
>
                                  <ol>
                                    <li>Carol sends
                                      #redirectForTheAnswer to
                                      Alice::GalaxyObject with a ref to
                                      Bob::GalaxyObject, returning a
                                      RemotePromise1</li>
                                    <li>Carol sends #hashCode to the
                                      RemotePromise1 from the first
                                      send, which forwards to the
                                      Promise in Alice, where it is
                                      queued.<br>
                                    </li>
                                    <li>3-way: Carol sends a ProvideFor
                                      to Bob and Alice sends an
                                      AcceptFrom to Bob, so Alice
                                      resolves Bob::GalaxyObject.</li>
                                    <li>Alice::GalaxyObject, under
                                      computation of
                                      #redirectForTheAnswer, sends
                                      #getTheAnswer to
                                      Bob::GalaxyObject, returning a
                                      RemotePromise2, in Alice, from
                                      #redirectForTheAnswer.</li>
                                    <li>The pending #hashCode send is
                                      sent to the RemothePromise2, in
                                      Alice, which points to Bob.</li>
                                    <li>3-way: In Alice, the redirected
                                      #hashCode ought to become a 3-way
                                      for the Resolver in Carol, for the
                                      intial #hashCode send.=A0 Alice
                                      would send a ProvideFor to Carol,
                                      for that Resolver and Bob would
                                      send an AcceptFrom to Carol to
                                      gain a FarRef to the Resolver.</li>
                                    <li>Bob::GalaxyObject, under
                                      computation of #hashCode, returns
                                      the value 42.</li>
                                    <li>Bob sends the pending #hashCode
                                      to 42, and resolves the gift
                                      Resolver. </li>
                                  </ol>
                                  I believe the tricky thing is that it
                                  is the Resolver which is gifted, so
                                  it's a different export "polarization"
                                  of the minigraph for a remote send
                                  that has been forwarded. <br>
                                  <br>
                                  Thank you,<br>
                                  Robert<br>
                                  <br>
                                </div>
                              </blockquote>
                            </div>
                            <br clear=3D"all">
                            <div><br>
                            </div>
                            -- <br>
                            <div>=A0 =A0 Cheers,<br>
                              =A0 =A0 --MarkM</div>
                          </div>
                        </div>
                        <br>
                        <fieldset></fieldset>
                        <br>
                        <pre>____________________________________________=
___
e-lang mailing list
<a moz-do-not-send=3D"true" href=3D"mailto:[email protected]" targe=
t=3D"_blank">[email protected]</a>
<a moz-do-not-send=3D"true" href=3D"http://www.eros-os.org/mailman/listin=
fo/e-lang" target=3D"_blank">http://www.eros-os.org/mailman/listinfo/e-la=
ng</a>
</pre>
                      </blockquote>
                      <br>
                    </blockquote>
                    <br>
                  </div>
                </div>
              </div>
              <br>
              _______________________________________________<br>
              e-lang mailing list<br>
              <a moz-do-not-send=3D"true"
                href=3D"mailto:[email protected]">[email protected]=
os.org</a><br>
              <a moz-do-not-send=3D"true"
                href=3D"http://www.eros-os.org/mailman/listinfo/e-lang"
                target=3D"_blank">http://www.eros-os.org/mailman/listinfo=
/e-lang</a><br>
              <br>
            </blockquote>
          </div>
          <br>
          <br clear=3D"all">
          <div><br>
          </div>
          -- <br>
          <div class=3D"gmail_signature">=A0 =A0 Cheers,<br>
            =A0 =A0 --MarkM</div>
        </div>
      </div>
      <br>
      <fieldset class=3D"mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap=3D"">_______________________________________________
e-lang mailing list
<a class=3D"moz-txt-link-abbreviated" href=3D"mailto:[email protected]=
org">[email protected]</a>
<a class=3D"moz-txt-link-freetext" href=3D"http://www.eros-os.org/mailman=
/listinfo/e-lang">http://www.eros-os.org/mailman/listinfo/e-lang</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>

--===============2437347301083258371==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
e-lang mailing list
[email protected]
http://www.eros-os.org/mailman/listinfo/e-lang

--===============2437347301083258371==--