From bdbd35fcf3777846f7188b7a19de80b04a02cff7 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Thu, 21 Nov 2019 14:45:56 -0800 Subject: [PATCH] gall: virtualize scry Compare +mute and +mule. Those pass through scry, which doesn't allow us to catch crashes due to blocking scry. If you intercept scry, you can't preserve the type polymorphically. By monomorphizing, we are able to do so safely. --- bin/solid.pill | 4 ++-- pkg/arvo/sys/vane/gall.hoon | 34 +++++++++++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/bin/solid.pill b/bin/solid.pill index 60b31753c..22a0c6ecd 100644 --- a/bin/solid.pill +++ b/bin/solid.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3bbcdd56cca219b1f9ae56951bfcc904ea61c20a516bb5519a7e19c1a5dbb064 -size 9190612 +oid sha256:ed6affa7a4c8d5b50f0f6235907173e9730b81f008712c753244b56e94bf18b5 +size 9195975 diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index ad0763b1b..9f7f6a6e4 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -156,7 +156,7 @@ eny=@uvJ :: activate :: - ska=sley + ski=sley == ~% %gall-top ..is ~ |% @@ -1040,7 +1040,7 @@ =/ tyl tyl.marked :: =/ peek-result=(each (unit (unit cage)) tang) - (mule |.((on-peek:ap-agent-core [term tyl]))) + (ap-mule-peek |.((on-peek:ap-agent-core [term tyl]))) :: ?- -.peek-result %& p.peek-result @@ -1303,6 +1303,34 @@ (ap-pass wire %agent dock %leave ~) =/ way [%out (scot %p p.dock) q.dock wire] (ap-pass way %arvo %b %huck !>([%unto %kick ~])) + :: +ap-mule: run virtualized with intercepted scry, preserving type + :: + :: Compare +mute and +mule. Those pass through scry, which + :: doesn't allow us to catch crashes due to blocking scry. If + :: you intercept scry, you can't preserve the type + :: polymorphically. By monomorphizing, we are able to do so + :: safely. + :: + ++ ap-mule + |= run=_^?(|.(*step:agent)) + ^- (each step:agent tang) + =/ res (mock [run %9 2 %0 1] (sloy ski)) + ?- -.res + %0 [%& !<(step:agent [-:!>(*step:agent) p.res])] + %1 [%| (turn p.res |=(a=* (smyt (path a))))] + %2 [%| p.res] + == + :: +ap-mule-peek: same as +ap-mule but for (unit (unit cage)) + :: + ++ ap-mule-peek + |= run=_^?(|.(*(unit (unit cage)))) + ^- (each (unit (unit cage)) tang) + =/ res (mock [run %9 2 %0 1] (sloy ski)) + ?- -.res + %0 [%& !<((unit (unit cage)) [-:!>(*(unit (unit cage))) p.res])] + %1 [%| (turn p.res |=(a=* (smyt (path a))))] + %2 [%| p.res] + == :: +ap-ingest: call agent arm :: :: Handle acks here because they need to be emitted before the @@ -1311,7 +1339,7 @@ ++ ap-ingest |= [ack=?(%poke-ack %watch-ack ~) run=_^?(|.(*step:agent))] ^- [(unit tang) _ap-core] - =/ result (mule run) + =/ result (ap-mule run) =^ new-moves ap-core (ap-handle-result result) =/ maybe-tang=(unit tang) ?: ?=(%& -.result)