From 51f9b2e269d83664d498bd133ecd4c2273f16387 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Tue, 3 Dec 2019 23:53:42 -0800 Subject: [PATCH] aqua: make faster so moon-az can finish --- pkg/arvo/app/aqua.hoon | 7 ++++++- pkg/arvo/app/spider.hoon | 5 +++++ pkg/arvo/gen/aqua/file.hoon | 6 ++++-- pkg/arvo/gen/spider/kill.hoon | 3 +++ pkg/arvo/lib/aqua-vane-thread.hoon | 8 ++++++-- pkg/arvo/lib/ethio.hoon | 3 ++- pkg/arvo/lib/ph/io.hoon | 6 +++--- pkg/arvo/lib/strandio.hoon | 2 +- pkg/arvo/ted/aqua/ames.hoon | 2 +- pkg/arvo/ted/aqua/behn.hoon | 2 +- pkg/arvo/ted/aqua/dill.hoon | 2 +- pkg/arvo/ted/aqua/eyre-azimuth.hoon | 5 ++++- pkg/arvo/ted/aqua/eyre.hoon | 2 +- 13 files changed, 38 insertions(+), 15 deletions(-) create mode 100644 pkg/arvo/gen/spider/kill.hoon diff --git a/pkg/arvo/app/aqua.hoon b/pkg/arvo/app/aqua.hoon index 5a1b8cb69b..00a7f87d1d 100644 --- a/pkg/arvo/app/aqua.hoon +++ b/pkg/arvo/app/aqua.hoon @@ -78,6 +78,8 @@ ^- step:agent:gall ?: ?=([?(%effects %effect) ~] path) `this + ?: ?=([%effect @ ~] path) + `this ?. ?=([?(%effects %effect %evens %boths) @ ~] path) ~| [%aqua-bad-subscribe-path path] !! @@ -251,9 +253,12 @@ %- zing %+ turn ~(tap by unix-effects) |= [=ship ufs=(list unix-effect)] + %- zing %+ turn ufs |= uf=unix-effect - [%give %fact `path %aqua-effect !>(`aqua-effect`[ship uf])] + :~ [%give %fact `/effect %aqua-effect !>(`aqua-effect`[ship uf])] + [%give %fact `/effect/[-.q.uf] %aqua-effect !>(`aqua-effect`[ship uf])] + == :: =. this =/ =path /effects diff --git a/pkg/arvo/app/spider.hoon b/pkg/arvo/app/spider.hoon index a6c9ec149d..e98165ceca 100644 --- a/pkg/arvo/app/spider.hoon +++ b/pkg/arvo/app/spider.hoon @@ -127,6 +127,9 @@ |- ^- (quip card _this) ?~ yarns `this + ?. ?=([@ ~] i.yarns) + $(yarns t.yarns) + ~| killing=i.yarns =^ cards-1 state (handle-stop-thread:sc (yarn-to-tid i.yarns) |) =^ cards-2 this @@ -136,6 +139,8 @@ ++ on-poke |= [=mark =vase] ^- (quip card _this) + ?: ?=(%spider-kill mark) + (on-load on-save) =^ cards state ?+ mark (on-poke:def mark vase) %spider-input (on-poke-input:sc !<(input vase)) diff --git a/pkg/arvo/gen/aqua/file.hoon b/pkg/arvo/gen/aqua/file.hoon index f9d3c72837..6486b19112 100644 --- a/pkg/arvo/gen/aqua/file.hoon +++ b/pkg/arvo/gen/aqua/file.hoon @@ -1,9 +1,11 @@ /- aquarium =, aquarium :- %say -|= [* [her=ship pax=path] ~] +|= [* [her=ship pax=path ~] ~] :- %aqua-events :_ ~ +^- aqua-event:aquarium :+ %event her ?> ?=([@ @ @ *] pax) =/ file [/text/plain (as-octs:mimes:html .^(@ %cx pax))] -[//sync/0v1n.2m9vh %into i.t.pax | [t.t.t.pax `file]~]~ +:- //sync/0v1n.2m9vh +[%into `desk`i.t.pax | `mode:clay`[t.t.t.pax `file]~] diff --git a/pkg/arvo/gen/spider/kill.hoon b/pkg/arvo/gen/spider/kill.hoon new file mode 100644 index 0000000000..7505d9cc3e --- /dev/null +++ b/pkg/arvo/gen/spider/kill.hoon @@ -0,0 +1,3 @@ +:- %say +|= * +[%spider-kill ~] diff --git a/pkg/arvo/lib/aqua-vane-thread.hoon b/pkg/arvo/lib/aqua-vane-thread.hoon index dc7f0023f6..dcbb2ede28 100644 --- a/pkg/arvo/lib/aqua-vane-thread.hoon +++ b/pkg/arvo/lib/aqua-vane-thread.hoon @@ -16,12 +16,16 @@ -- :: =; core - |= handler=vane-handler + |= [effect-filter=(list term) handler=vane-handler] ^- thread:spider |= vase =/ m (strand ,vase) ^- form:m - ;< ~ bind:m (watch-our:strandio /effects %aqua /effect) + =* loop $ + ?^ effect-filter + =/ =path /effect/[i.effect-filter] + ;< ~ bind:m (watch-our:strandio path %aqua path) + loop(effect-filter t.effect-filter) ;< ~ bind:m %- (main-loop:strandio ,_handler) :~ handle-unix-effect:core diff --git a/pkg/arvo/lib/ethio.hoon b/pkg/arvo/lib/ethio.hoon index 2f8a434c4f..2031f62bd6 100644 --- a/pkg/arvo/lib/ethio.hoon +++ b/pkg/arvo/lib/ethio.hoon @@ -71,7 +71,8 @@ ?~ array ~& %incomplete-batch (strand-fail:strandio %rpc-result-incomplete-batch >u.jon< ~) - =- ?~ err (pure:m `res) + =- ?~ err + (pure:m `res) ~& [%error-results err] (pure:m ~) %+ roll u.array diff --git a/pkg/arvo/lib/ph/io.hoon b/pkg/arvo/lib/ph/io.hoon index aef0de2b2a..3f750c7b0a 100644 --- a/pkg/arvo/lib/ph/io.hoon +++ b/pkg/arvo/lib/ph/io.hoon @@ -11,7 +11,7 @@ ++ take-unix-effect =/ m (strand ,[ship unix-effect]) ^- form:m - ;< =cage bind:m (take-fact /effects) + ;< [=path =cage] bind:m (take-fact-prefix /effect) ?> ?=(%aqua-effect p.cage) (pure:m !<([aqua-effect] q.cage)) :: @@ -35,7 +35,7 @@ ^- form:m ~& > "starting" ;< ~ bind:m (start-threads vane-threads) - ;< ~ bind:m (watch-our /effects %aqua /effect) + ;< ~ bind:m (watch-our /effect %aqua /effect) :: Get our very own event with no mistakes in it... yet. :: :: We want to wait for the vane threads to actually start and get @@ -55,7 +55,7 @@ ^- form:m ~& > "done" ;< ~ bind:m (stop-threads vane-threads) - ;< ~ bind:m (leave-our /effects %aqua) + ;< ~ bind:m (leave-our /effect %aqua) (pure:m ~) :: ++ start-threads diff --git a/pkg/arvo/lib/strandio.hoon b/pkg/arvo/lib/strandio.hoon index 28caadfece..6493111543 100644 --- a/pkg/arvo/lib/strandio.hoon +++ b/pkg/arvo/lib/strandio.hoon @@ -96,7 +96,7 @@ ?+ in.tin `[%skip ~] ~ `[%wait ~] [~ %agent * %fact *] - ?. =(watch+wire (scag (lent wire) wire.u.in.tin)) + ?. =(watch+wire (scag +((lent wire)) wire.u.in.tin)) `[%skip ~] `[%done (slag (lent wire) wire.u.in.tin) cage.sign.u.in.tin] == diff --git a/pkg/arvo/ted/aqua/ames.hoon b/pkg/arvo/ted/aqua/ames.hoon index 7c06862d84..76d02c4a31 100644 --- a/pkg/arvo/ted/aqua/ames.hoon +++ b/pkg/arvo/ted/aqua/ames.hoon @@ -48,7 +48,7 @@ [%| `address:ames``@`ship] -- :: -%- aqua-vane-thread +%+ aqua-vane-thread ~[%restore %send] |_ =bowl:spider +* this . ++ handle-unix-effect diff --git a/pkg/arvo/ted/aqua/behn.hoon b/pkg/arvo/ted/aqua/behn.hoon index 6722da3aee..274c45d0e9 100644 --- a/pkg/arvo/ted/aqua/behn.hoon +++ b/pkg/arvo/ted/aqua/behn.hoon @@ -85,7 +85,7 @@ -- -- :: -%- aqua-vane-thread +%+ aqua-vane-thread ~[%sleep %restore %doze] |_ =bowl:spider +* this . ++ handle-unix-effect diff --git a/pkg/arvo/ted/aqua/dill.hoon b/pkg/arvo/ted/aqua/dill.hoon index 25221428ee..adc03dc41d 100644 --- a/pkg/arvo/ted/aqua/dill.hoon +++ b/pkg/arvo/ted/aqua/dill.hoon @@ -30,7 +30,7 @@ ~ -- :: -%- aqua-vane-thread +%+ aqua-vane-thread ~[%blit] |_ =bowl:spider +* this . ++ handle-unix-effect diff --git a/pkg/arvo/ted/aqua/eyre-azimuth.hoon b/pkg/arvo/ted/aqua/eyre-azimuth.hoon index 614adcbd63..08596456e4 100644 --- a/pkg/arvo/ted/aqua/eyre-azimuth.hoon +++ b/pkg/arvo/ted/aqua/eyre-azimuth.hoon @@ -22,7 +22,10 @@ |= args=vase =/ m (strand ,vase) ^- form:m - ;< ~ bind:m (watch-our:strandio /effects %aqua /effect) + ;< ~ bind:m (watch-our:strandio /effect/request %aqua /effect/request) + :: need blits for raw-ship to check booted + :: + ;< ~ bind:m (watch-our:strandio /effect/blit %aqua /effect/blit) ;< ~ bind:m %- (main-loop:strandio ,state) :~ |=(=state ~(handle-unix-effect core state)) diff --git a/pkg/arvo/ted/aqua/eyre.hoon b/pkg/arvo/ted/aqua/eyre.hoon index 42a988f47c..9cfa5c285b 100644 --- a/pkg/arvo/ted/aqua/eyre.hoon +++ b/pkg/arvo/ted/aqua/eyre.hoon @@ -100,7 +100,7 @@ -- -- :: -%- aqua-vane-thread +%+ aqua-vane-thread ~[%sleep %restore %thus] |_ =bowl:spider +* this . ++ handle-unix-effect