From f0bdcec2270ea154cbbdb5653e76d1ec01b93419 Mon Sep 17 00:00:00 2001 From: John Franklin Date: Tue, 25 Apr 2023 04:01:27 -0500 Subject: [PATCH 01/49] lib/server: de-indent ++ico-response --- pkg/base-dev/lib/server.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/base-dev/lib/server.hoon b/pkg/base-dev/lib/server.hoon index 431b5db8ac..e5bdd2d589 100644 --- a/pkg/base-dev/lib/server.hoon +++ b/pkg/base-dev/lib/server.hoon @@ -114,7 +114,7 @@ :_ `octs [200 [['content-type' 'image/svg+xml'] ?:(cache [max-1-wk ~] ~)]] :: - ++ ico-response + ++ ico-response |= =octs ^- simple-payload:http [[200 [['content-type' 'image/x-icon'] max-1-wk ~]] `octs] From 94ba9441887c8f57cc927cef89077a91d277ca11 Mon Sep 17 00:00:00 2001 From: Jonathan Paprocki Date: Tue, 25 Apr 2023 14:59:15 -0400 Subject: [PATCH 02/49] hoon: add doc parsing flag to +vang +vang is for setting +vast params, but was missing the parameter for doc. this adds it and changes the callsites to vang around %base to reflect this --- pkg/arvo/app/dojo.hoon | 8 ++++---- pkg/arvo/sys/hoon.hoon | 11 ++++++++--- pkg/arvo/sys/vane/clay.hoon | 2 +- pkg/base-dev/lib/language-server/parser.hoon | 2 +- pkg/landscape/app/chat-cli.hoon | 2 +- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/pkg/arvo/app/dojo.hoon b/pkg/arvo/app/dojo.hoon index e9c6904aaf..49b2b7eab1 100644 --- a/pkg/arvo/app/dojo.hoon +++ b/pkg/arvo/app/dojo.hoon @@ -118,7 +118,7 @@ |= [our=ship dir=beam] |% ++ default-app %hood - ++ hoon-parser (vang | (en-beam dir)) + ++ hoon-parser (vang | (en-beam dir) &) ++ our p.dir :: ++ parse-command-line ;~(sfix parse-command (star ace) (just '\0a')) @@ -309,7 +309,7 @@ ++ parse-rood :: XX should this use +hoon-parser instead to normalize the case? :: - => (vang | (en-beam dir)) + => (vang | (en-beam dir) &) ;~ pose rood :: @@ -1225,7 +1225,7 @@ :+ %clhp [%rock %tas %cx] %+ rash pax.source.com - rood:(vang | /(scot %p our.hid)/base/(scot %da now.hid)) + rood:(vang | /(scot %p our.hid)/base/(scot %da now.hid) &) :: %url [%ur (crip (en-purl:html url.source.com))] %api !! @@ -1256,7 +1256,7 @@ %hoon :* %do %+ rash code.source.com - tall:(vang | /(scot %p our.hid)/base/(scot %da now.hid)) + tall:(vang | /(scot %p our.hid)/base/(scot %da now.hid) &) $(num +(num), source.com next.source.com) == :: diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index 34e90bced7..ab272c0917 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -11422,9 +11422,14 @@ :: 5d: parser +| %parser :: -++ vang :: set ++vast params - |= [bug=? wer=path] :: bug: debug mode - %*(. vast bug bug, wer wer) :: wer: where we are +:: +vang: set +vast params +:: +:: bug: debug mode +:: wer: where we are +:: doc: doccord parsing +++ vang + |= [bug=? wer=path doc=?] + %*(. vast bug bug, wer wer, doc doc) :: ++ vast :: main parsing core =+ [bug=`?`| wer=*path doc=`?`&] diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index b443b59038..9b93a9073f 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -969,7 +969,7 @@ == :: %+ stag %tssg - (most gap tall:(vang & pax)) + (most gap tall:(vang & pax &)) == :: ++ pant diff --git a/pkg/base-dev/lib/language-server/parser.hoon b/pkg/base-dev/lib/language-server/parser.hoon index cf57790926..fc5d6b9e77 100644 --- a/pkg/base-dev/lib/language-server/parser.hoon +++ b/pkg/base-dev/lib/language-server/parser.hoon @@ -44,7 +44,7 @@ == :: %+ stag %tssg - (most gap tall:(vang & pax)) + (most gap tall:(vang & pax &)) == :: ++ pant diff --git a/pkg/landscape/app/chat-cli.hoon b/pkg/landscape/app/chat-cli.hoon index a5aa5dee2c..18ff4f146d 100644 --- a/pkg/landscape/app/chat-cli.hoon +++ b/pkg/landscape/app/chat-cli.hoon @@ -683,7 +683,7 @@ |= tub=nail %. tub %+ stag (crip q.tub) - wide:(vang & [&1:% &2:% (scot %da now.bowl) |3:%]) + wide:(vang & [&1:% &2:% (scot %da now.bowl) |3:%] &) -- :: +tab-list: command descriptions :: From 971db7effed8f264e236a9a4c044a1fa7816557a Mon Sep 17 00:00:00 2001 From: Jonathan Paprocki Date: Tue, 25 Apr 2023 15:07:54 -0400 Subject: [PATCH 03/49] doccords: parsing off for =*, +* see #6307 this turns doccord parsing off for =* and +*, which was not intended to be allowed for the first release, but it ended up not compiling if postfix doccords were put on either of these. the right way to fix this is to actually implement doccord parsing for =* and +*, but at least turning them off seems to fix the compile error here. --- pkg/arvo/sys/hoon.hoon | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index ab272c0917..10717d2a87 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -13340,7 +13340,7 @@ ;~ pose %+ ifix [;~(plug lus tar muck) muck] - (most muck ;~(gunk sym loaf)) + (most muck ;~(gunk sym loll)) :: (easy ~) == @@ -13417,7 +13417,13 @@ ++ hunk (most mush loan) :: gapped specs ++ jump ;~(pose leap:docs gap) :: gap before docs ++ loaf ?:(tol tall wide) :: hoon + ++ loll ?: tol :: hoon without docs + tall:(vang bug wer |) + wide:(vang bug wer |) ++ loan ?:(tol till wyde) :: spec + ++ lien ?: tol :: spec without docs + till:(vang bug wer |) + wyde:(vang bug wer |) ++ lore (sear |=(=hoon ~(flay ap hoon)) loaf) :: skin ++ lomp ;~(plug sym (punt ;~(pfix tis wyde))) :: typeable name ++ mash ?:(tol gap ;~(plug com ace)) :: list separator @@ -13466,7 +13472,7 @@ ++ expd |.(;~(goop loaf loaf loaf loaf)) :: four hoons ++ expe |.(wisp) :: core tail ++ expf |.(;~(goop ;~(pfix cen sym) loaf)) :: %term and hoon - ++ expg |.(;~(goop lomp loaf loaf)) :: term/spec, two hoons + ++ expg |.(;~(gunk lomp loll loll)) :: term/spec, two hoons ++ exph |.((butt ;~(gunk rope rick))) :: wing, [wing hoon]s ++ expi |.((butt ;~(goop loaf hank))) :: one or more hoons ++ expj |.(;~(goop lore loaf)) :: skin and hoon From f6c780a7e76668e126ce680df779dbd86d9e7143 Mon Sep 17 00:00:00 2001 From: Jonathan Paprocki Date: Wed, 26 Apr 2023 01:13:24 -0400 Subject: [PATCH 04/49] hoon: second hoon for =* has docs the issue with compiling not working is with doccords on the deferred expression, not everything that follows (which would turn off doccords for anything past =*) --- pkg/arvo/sys/hoon.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index 10717d2a87..42391f723d 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -13472,7 +13472,7 @@ ++ expd |.(;~(goop loaf loaf loaf loaf)) :: four hoons ++ expe |.(wisp) :: core tail ++ expf |.(;~(goop ;~(pfix cen sym) loaf)) :: %term and hoon - ++ expg |.(;~(gunk lomp loll loll)) :: term/spec, two hoons + ++ expg |.(;~(gunk lomp loll loaf)) :: term/spec, two hoons ++ exph |.((butt ;~(gunk rope rick))) :: wing, [wing hoon]s ++ expi |.((butt ;~(goop loaf hank))) :: one or more hoons ++ expj |.(;~(goop lore loaf)) :: skin and hoon From cbbd6d2c5858200d649b987b4fc8f31db9aa4112 Mon Sep 17 00:00:00 2001 From: yosoyubik Date: Wed, 26 Apr 2023 09:50:23 +0200 Subject: [PATCH 05/49] strandio,-keen: use (fixed) take-tune --- pkg/arvo/ted/keen.hoon | 18 ++++++++---------- pkg/base-dev/lib/strandio.hoon | 24 +++++++++--------------- 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/pkg/arvo/ted/keen.hoon b/pkg/arvo/ted/keen.hoon index fe01dcc113..e666dc6e9c 100644 --- a/pkg/arvo/ted/keen.hoon +++ b/pkg/arvo/ted/keen.hoon @@ -6,19 +6,17 @@ =/ m (strand ,vase) ^- form:m =+ !<([~ =spar:ames] arg) -;< dat=(unit roar:ames) bind:m - (keen:strandio spar) -?~ dat +;< [* roar=(unit roar:ames)] bind:m (keen:strandio spar) +?~ roar (pure:m !>(~)) +?~ data=q.dat.u.roar + (pure:m !>(~)) +:: ;< =bowl:spider bind:m get-bowl:strandio -=/ [=path data=(unit (cask))] dat.u.dat -?~ data - (pure:m !>(~)) =+ .^ =dais:clay %cb /(scot %p our.bowl)/[q.byk.bowl]/(scot %da now.bowl)/[p.u.data] == =/ res (mule |.((vale.dais q.u.data))) -?: ?=(%| -.res) - ~|(%keen-mark-fail (mean leaf+"-keen: ames vale fail {}" p.res)) -(pure:m p.res) - +?. ?=(%| -.res) + (pure:m p.res) +~|(%keen-mark-fail (mean leaf+"-keen: ames vale fail {}" p.res)) diff --git a/pkg/base-dev/lib/strandio.hoon b/pkg/base-dev/lib/strandio.hoon index ba62c4134e..194c9a899d 100644 --- a/pkg/base-dev/lib/strandio.hoon +++ b/pkg/base-dev/lib/strandio.hoon @@ -82,8 +82,6 @@ `[%done q.cage.u.in.tin] == :: -:: -:: ++ take-sign-arvo =/ m (strand ,[wire sign-arvo]) ^- form:m @@ -184,21 +182,20 @@ `[%done ~] `[%fail %timer-error u.error.sign-arvo.u.in.tin] == +:: ++ take-tune |= =wire - =/ m (strand ,~) + =/ m (strand ,[spar:ames (unit roar:ames)]) ^- form:m |= tin=strand-input:strand - ?+ in.tin `[%skip ~] + ?+ in.tin `[%skip ~] ~ `[%wait ~] - [~ %agent * %poke-ack *] + :: + [~ %sign * %ames %tune ^ *] ?. =(wire wire.u.in.tin) `[%skip ~] - ?~ p.sign.u.in.tin - `[%done ~] - `[%fail %poke-fail u.p.sign.u.in.tin] + `[%done +>.sign-arvo.u.in.tin] == - :: ++ take-poke-ack |= =wire @@ -336,13 +333,10 @@ :: ++ keen |= =spar:ames - =/ m (strand ,(unit roar:ames)) + =/ m (strand ,[spar:ames (unit roar:ames)]) ^- form:m - =/ =card:agent:gall [%pass /keen %arvo %a %keen spar] - ;< ~ bind:m (send-raw-card card) - ;< [wire sign=sign-arvo] bind:m take-sign-arvo - ?> ?=([%ames %tune *] sign) - (pure:m roar.sign) + ;< ~ bind:m (send-raw-card %pass /keen %arvo %a %keen spar) + (take-tune /keen) :: ++ sleep |= for=@dr From 6715f5eb37e447d089894f80c2ec90b6c63bb2b7 Mon Sep 17 00:00:00 2001 From: ~wicrum-wicrun <99811688+wicrum-wicrun@users.noreply.github.com> Date: Thu, 27 Apr 2023 00:36:54 +0200 Subject: [PATCH 06/49] gall: track outstanding `%keen`s and send `%yawn` on nuke --- pkg/arvo/sys/vane/gall.hoon | 115 ++++++++++++++++++++++++++++-------- 1 file changed, 91 insertions(+), 24 deletions(-) diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index d628d20758..0b7db1e310 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -42,9 +42,9 @@ :: $move: Arvo-level move :: +$ move [=duct move=(wind note-arvo gift-arvo)] -:: $state-12: overall gall state, versioned +:: $state-13: overall gall state, versioned :: -+$ state-12 [%12 state] ++$ state-13 [%13 state] :: $state: overall gall state :: :: system-duct: TODO document @@ -82,6 +82,7 @@ :: beak: compilation source :: marks: mark conversion requests :: sky: scry bindings +:: ken: open keen requests :: +$ yoke $% [%nuke sky=(map spur @ud)] @@ -98,6 +99,7 @@ =beak marks=(map duct mark) sky=(map spur path-state) + ken=(jug spar:ames wire) == == :: +$ path-state @@ -160,7 +162,7 @@ :: $spore: structures for update, produced by +stay :: +$ spore - $: %12 + $: %13 system-duct=duct outstanding=(map [wire duct] (qeu remote-request)) contacts=(set ship) @@ -185,11 +187,12 @@ =beak marks=(map duct mark) sky=(map spur path-state) + ken=(jug spar:ames wire) == == -- :: adult gall vane interface, for type compatibility with pupa :: -=| state=state-12 +=| state=state-13 |= [now=@da eny=@uvJ rof=roof] =* gall-payload . ~% %gall-top ..part ~ @@ -967,13 +970,22 @@ |= [=duct =ship =path] path =/ will=(list card:agent) - %+ welp + ;: welp ?: =(~ inbound-paths) ~ [%give %kick ~(tap in inbound-paths) ~]~ - %+ turn ~(tap by boat.yoke) - |= [[=wire =dock] ? =path] - [%pass wire %agent dock %leave ~] + :: + %+ turn ~(tap by boat.yoke) + |= [[=wire =dock] ? =path] + [%pass wire %agent dock %leave ~] + :: + %- zing + %+ turn ~(tap by ken.yoke) + |= [=spar:ames wyz=(set wire)] + %+ turn ~(tap in wyz) + |= =wire + [%pass wire %arvo %a %yawn spar] + == =^ maybe-tang ap-core (ap-ingest ~ |.([will *agent])) ap-core :: +ap-grow: bind a path in the agent's scry namespace @@ -1365,6 +1377,8 @@ =^ maybe-tang ap-core %+ ap-ingest ~ |. (on-arvo:ap-agent-core wire sign-arvo) + =? ken.yoke ?=([%ames %tune spar=* *] sign-arvo) + (~(del ju ken.yoke) spar.sign-arvo wire) ?^ maybe-tang (ap-error %arvo-response u.maybe-tang) ap-core @@ -1714,6 +1728,7 @@ :: =. agent.yoke &++.p.result =^ fex ap-core (ap-handle-sky -.p.result) + =. ken.yoke (ap-handle-ken fex) =/ moves (zing (turn fex ap-from-internal)) =. bitt.yoke (ap-handle-kicks moves) (ap-handle-peers moves) @@ -1732,6 +1747,17 @@ [%give *] $(caz t.caz, fex [i.caz fex]) [%slip *] !! == + :: +ap-handle-ken + :: + ++ ap-handle-ken + |= fex=(list carp) + ^+ ken.yoke + %+ roll fex + |= [=carp ken=_ken.yoke] + ?+ carp ken + [%pass * %arvo %a %keen spar=*] (~(put ju ken) [spar.q p]:carp) + [%pass * %arvo %a %yawn spar=*] (~(del ju ken) [spar.q p]:carp) + == :: +ap-handle-kicks: handle cancels of bitt.watches :: ++ ap-handle-kicks @@ -1875,10 +1901,36 @@ =? old ?=(%9 -.old) (spore-9-to-10 old) =? old ?=(%10 -.old) (spore-10-to-11 old) =? old ?=(%11 -.old) (spore-11-to-12 old) - ?> ?=(%12 -.old) + =? old ?=(%12 -.old) (spore-12-to-13 old) + ?> ?=(%13 -.old) gall-payload(state old) :: - +$ spore-any $%(spore spore-7 spore-8 spore-9 spore-10 spore-11) + +$ spore-any $%(spore spore-7 spore-8 spore-9 spore-10 spore-11 spore-12) + +$ spore-12 + $: %12 + system-duct=duct + outstanding=(map [wire duct] (qeu remote-request)) + contacts=(set ship) + eggs=(map term egg-12) + blocked=(map term (qeu blocked-move)) + =bug + == + +$ egg-12 + $% [%nuke sky=(map spur @ud)] + $: %live + control-duct=duct + run-nonce=@t + sub-nonce=@ + =stats + =bitt + =boat + =boar + code=~ + old-state=[%| vase] + =beak + marks=(map duct mark) + sky=(map spur path-state) + == == +$ spore-11 $: %11 system-duct=duct @@ -2010,20 +2062,6 @@ %+ murn ~(tap to q) |=(r=remote-request-9 ?:(?=(%cork r) ~ `r)) :: - :: added sky - :: - ++ spore-11-to-12 - |= old=spore-11 - ^- spore - %= old - - %12 - eggs - %- ~(urn by eggs.old) - |= [a=term e=egg-11] - ^- egg - live/e(marks [marks.e sky:*$>(%live egg)]) - == - :: :: removed live :: changed old-state from (each vase vase) to [%| vase] :: added code @@ -2039,6 +2077,35 @@ ^- egg-11 e(|3 |4.e(|4 `|8.e(old-state [%| p.old-state.e]))) == + :: + :: added sky + :: + ++ spore-11-to-12 + |= old=spore-11 + ^- spore-12 + %= old + - %12 + eggs + %- ~(urn by eggs.old) + |= [a=term e=egg-11] + ^- egg-12 + live/e(marks [marks.e sky:*$>(%live egg)]) + == + :: + :: added ken + :: + ++ spore-12-to-13 + |= old=spore-12 + ^- spore + %= old + - %13 + eggs + %- ~(urn by eggs.old) + |= [a=term e=egg-12] + ^- egg + ?: ?=(%nuke -.e) e + e(sky [sky.e ken:*$>(%live egg)]) + == -- :: +scry: standard scry :: From 45431dbc89e4e008be883a8db1f5acd403a4b5d2 Mon Sep 17 00:00:00 2001 From: Jonathan Paprocki Date: Wed, 26 Apr 2023 22:03:04 -0400 Subject: [PATCH 07/49] hoon: remove +lien its not actually being used anywhere, i just wrote it to balance out having a "hoon without docs" arm. but i guess this just adds needless bloat --- pkg/arvo/sys/hoon.hoon | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index 42391f723d..b72c29b2b5 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -13421,9 +13421,6 @@ tall:(vang bug wer |) wide:(vang bug wer |) ++ loan ?:(tol till wyde) :: spec - ++ lien ?: tol :: spec without docs - till:(vang bug wer |) - wyde:(vang bug wer |) ++ lore (sear |=(=hoon ~(flay ap hoon)) loaf) :: skin ++ lomp ;~(plug sym (punt ;~(pfix tis wyde))) :: typeable name ++ mash ?:(tol gap ;~(plug com ace)) :: list separator From cfc1a585598d32e85876f0946c4fac0b92d875a3 Mon Sep 17 00:00:00 2001 From: yosoyubik Date: Thu, 27 Apr 2023 13:55:06 +0200 Subject: [PATCH 08/49] spider: fix tracking remote-scry requests Prevously we were tracking remote scry requests using a map, assuming that every thread would do just one remote scry request. This is not right. A thread that did multiple +keen:strandio was treated as if just the last call existed, overwritten previous entries in the map. Now we track remote scries using a jug that accounts for multiple %keen tasks per thread. The logic for sending %yawns to %ames has been updated for the following scenarios: - +thread-fail will always send a %yawn task - +thread-done doesn't send %yawn tasks - unless a running thread is stopped - if %spider is reloaded: - %yawn tasks will be sent for any running or starting thread /lib/strandio also removes +take-tune from +keen, decoupling sending %tasks and receiving %signs. This allows for clients to request multiple paths at future cases, without blocking. --- pkg/arvo/app/spider.hoon | 98 +++++++++++++++++++++++----------- pkg/arvo/ted/keen.hoon | 5 +- pkg/base-dev/lib/strandio.hoon | 7 ++- 3 files changed, 74 insertions(+), 36 deletions(-) diff --git a/pkg/arvo/app/spider.hoon b/pkg/arvo/app/spider.hoon index 0d4e342e46..229d05cb62 100644 --- a/pkg/arvo/app/spider.hoon +++ b/pkg/arvo/app/spider.hoon @@ -15,7 +15,7 @@ running=(axal thread-form) tid=(map tid yarn) serving=(map tid [(unit @ta) =mark =desk]) - scries=(map tid [=ship =path]) + scrying=(jug tid [=wire =ship =path]) == :: +$ clean-slate-any @@ -25,16 +25,26 @@ clean-slate-2 clean-slate-3 clean-slate-4 + clean-slate-5 clean-slate == :: +$ clean-slate + $: %6 + starting=(map yarn [=trying =vase]) + running=(list yarn) + tid=(map tid yarn) + serving=(map tid [(unit @ta) =mark =desk]) + scrying=(jug tid [wire ship path]) + == +:: ++$ clean-slate-5 $: %5 starting=(map yarn [=trying =vase]) running=(list yarn) tid=(map tid yarn) serving=(map tid [(unit @ta) =mark =desk]) - scries=(map tid [ship path]) + scrying=(map tid [ship path]) == :: +$ clean-slate-4 @@ -110,17 +120,23 @@ =. any (old-to-3 any) =. any (old-to-4 any) =. any (old-to-5 any) - ?> ?=(%5 -.any) + =. any (old-to-6 any) + ?> ?=(%6 -.any) :: =. tid.state tid.any =/ yarns=(list yarn) %+ welp running.any ~(tap in ~(key by starting.any)) + ~& yarns+yarns |- ^- (quip card _this) - ?~ yarns + ?~ yarns [~[bind-eyre:sc] this] =^ cards-1 state - (handle-stop-thread:sc (yarn-to-tid i.yarns) |) + %. [(yarn-to-tid i.yarns) nice=%.n] + :: the |sc core needs to now about the previous + :: scrying state in order to send $yawns to %ames + :: + %*(handle-stop-thread sc scrying.state scrying.any) =^ cards-2 this $(yarns t.yarns) [:(weld upgrade-cards cards-1 cards-2) this] @@ -133,8 +149,8 @@ ++ old-to-2 |= old=clean-slate-any ^- (quip card clean-slate-any) - ?> ?=(?(%1 %2 %3 %4 %5) -.old) - ?: ?=(?(%2 %3 %4 %5) -.old) + ?> ?=(?(%1 %2 %3 %4 %5 %6) -.old) + ?: ?=(?(%2 %3 %4 %5 %6) -.old) `old :- ~[bind-eyre:sc] :* %2 @@ -147,8 +163,8 @@ ++ old-to-3 |= old=clean-slate-any ^- clean-slate-any - ?> ?=(?(%2 %3 %4 %5) -.old) - ?: ?=(?(%3 %4 %5) -.old) + ?> ?=(?(%2 %3 %4 %5 %6) -.old) + ?: ?=(?(%3 %4 %5 %6) -.old) old :* %3 starting.old @@ -156,11 +172,12 @@ tid.old (~(run by serving.old) |=([id=@ta =mark] [id mark q.byk.bowl])) == + :: ++ old-to-4 |= old=clean-slate-any ^- clean-slate-any - ?> ?=(?(%3 %4 %5) -.old) - ?: ?=(?(%4 %5) -.old) + ?> ?=(?(%3 %4 %5 %6) -.old) + ?: ?=(?(%4 %5 %6) -.old) old :* %4 starting.old @@ -171,10 +188,27 @@ :: ++ old-to-5 |= old=clean-slate-any - ^- clean-slate - ?> ?=(?(%4 %5) -.old) - ?: ?=(%5 -.old) old + ^- clean-slate-any + ?> ?=(?(%4 %5 %6) -.old) + ?: ?=(?(%5 %6) -.old) old [%5 +.old(serving [serving.old ~])] + :: + ++ old-to-6 + |= old=clean-slate-any + ^- clean-slate + ?> ?=(?(%5 %6) -.old) + ?: ?=(%6 -.old) old + :- %6 + %= +.old + scrying + %- ~(run by scrying.old) + |= [=ship =path] + %- ~(gas in *(set [wire ^ship ^path])) + :: XX +keen:strandio used /keen as the default wire + :: this assumes that any old thread used that as well + :: + [/keen ship path]~ + == -- :: ++ on-poke @@ -421,14 +455,13 @@ ?: (~(has of running.state) u.yarn) ?. nice (thread-fail u.yarn %cancelled ~) - =^ cancel-cards state (cancel-scry tid &) - =^ done-cards state (thread-done u.yarn *vase) - [(weld cancel-cards done-cards) state] + =^ done-cards state (thread-done u.yarn *vase silent=%.n) + [done-cards state] ?: (~(has by starting.state) u.yarn) (thread-fail-not-running tid %stopped-before-started ~) ~& [%thread-not-started u.yarn] ?: nice - (thread-done u.yarn *vase) + (thread-done u.yarn *vase silent=%.y) (thread-fail u.yarn %cancelled ~) :: ++ take-input @@ -457,8 +490,8 @@ ^- [(list card) _state] %+ roll cards.r |= [=card cards=(list card) s=_state] - :_ =? scries.s ?=([%pass ^ %arvo %a %keen @ *] card) - (~(put by scries.s) tid &6.card +>+>+>.card) + :_ =? scrying.s ?=([%pass ^ %arvo %a %keen @ *] card) + (~(put ju scrying.s) tid [&2 &6 |6]:card) s :_ cards ^- ^card @@ -476,7 +509,7 @@ ?- -.eval-result.r %next `state %fail (thread-fail yarn err.eval-result.r) - %done (thread-done yarn value.eval-result.r) + %done (thread-done yarn value.eval-result.r silent=%.y) == [(weld cards final-cards) state] :: @@ -500,12 +533,15 @@ ++ cancel-scry |= [=tid silent=?] ^- (quip card _state) - ?~ scry=(~(get by scries.state) tid) + ?~ scrying=(~(get ju scrying.state) tid) `state - :_ state(scries (~(del by scries.state) tid)) + :_ state(scrying (~(del by scrying.state) tid)) ?: silent ~ - %- (slog leaf+"cancelling {}: [{<[ship path]:u.scry>}]" ~) - [%pass /thread/[tid]/keen %arvo %a %yawn [ship path]:u.scry]~ + %- ~(rep in `(set [wire ship path])`scrying) + |= [[=wire =ship =path] cards=(list card)] + %- (slog leaf+"cancelling {}: [{<[wire ship path]>}]" ~) + :_ cards + [%pass (welp /thread/[tid] wire) %arvo %a %yawn ship path] :: ++ thread-http-fail |= [=tid =term =tang] @@ -535,9 +571,9 @@ ::%- (slog leaf+"strand {} failed" leaf+ tang) =/ =tid (yarn-to-tid yarn) =/ fail-cards (thread-say-fail tid term tang) - =^ cards state (thread-clean yarn) + =^ cards state (thread-clean yarn) =^ http-cards state (thread-http-fail tid term tang) - =^ scry-card state (cancel-scry tid |) + =^ scry-card state (cancel-scry tid silent=%.n) :_ state :(weld fail-cards cards http-cards scry-card) :: @@ -556,7 +592,7 @@ (json-response:gen:server !<(json (tube vase))) :: ++ thread-done - |= [=yarn =vase] + |= [=yarn =vase silent=?] ^- (quip card ^state) :: %- (slog leaf+"strand {} finished" (sell vase) ~) =/ =tid (yarn-to-tid yarn) @@ -566,8 +602,8 @@ == =^ http-cards state (thread-http-response tid vase) - =^ scry-card state (cancel-scry tid &) - =^ cards state (thread-clean yarn) + =^ scry-card state (cancel-scry tid silent) + =^ cards state (thread-clean yarn) [:(weld done-cards cards http-cards scry-card) state] :: ++ thread-clean @@ -640,7 +676,7 @@ :: ++ clean-state !> ^- clean-slate - 5+state(running (turn ~(tap of running.state) head)) + 6+state(running (turn ~(tap of running.state) head)) :: ++ convert-tube |= [from=mark to=mark =desk =bowl:gall] diff --git a/pkg/arvo/ted/keen.hoon b/pkg/arvo/ted/keen.hoon index e666dc6e9c..596f08e884 100644 --- a/pkg/arvo/ted/keen.hoon +++ b/pkg/arvo/ted/keen.hoon @@ -6,7 +6,10 @@ =/ m (strand ,vase) ^- form:m =+ !<([~ =spar:ames] arg) -;< [* roar=(unit roar:ames)] bind:m (keen:strandio spar) +;< ~ bind:m + (keen:strandio /keen spar) +;< [* roar=(unit roar:ames)] bind:m + (take-tune:strandio /keen) ?~ roar (pure:m !>(~)) ?~ data=q.dat.u.roar diff --git a/pkg/base-dev/lib/strandio.hoon b/pkg/base-dev/lib/strandio.hoon index 194c9a899d..6735d9060a 100644 --- a/pkg/base-dev/lib/strandio.hoon +++ b/pkg/base-dev/lib/strandio.hoon @@ -332,11 +332,10 @@ (take-wake `until) :: ++ keen - |= =spar:ames - =/ m (strand ,[spar:ames (unit roar:ames)]) + |= [=wire =spar:ames] + =/ m (strand ,~) ^- form:m - ;< ~ bind:m (send-raw-card %pass /keen %arvo %a %keen spar) - (take-tune /keen) + (send-raw-card %pass wire %arvo %a %keen spar) :: ++ sleep |= for=@dr From 7f7c1cb6aa5c664516094a89bc6af6ff60767428 Mon Sep 17 00:00:00 2001 From: yosoyubik Date: Thu, 27 Apr 2023 13:59:35 +0200 Subject: [PATCH 09/49] spider: fix extraneous debugging code --- pkg/arvo/app/spider.hoon | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/arvo/app/spider.hoon b/pkg/arvo/app/spider.hoon index 229d05cb62..c41e198379 100644 --- a/pkg/arvo/app/spider.hoon +++ b/pkg/arvo/app/spider.hoon @@ -127,9 +127,8 @@ =/ yarns=(list yarn) %+ welp running.any ~(tap in ~(key by starting.any)) - ~& yarns+yarns |- ^- (quip card _this) - ?~ yarns + ?~ yarns [~[bind-eyre:sc] this] =^ cards-1 state %. [(yarn-to-tid i.yarns) nice=%.n] From 84e0e1846221d6c912ad03ff1dbdaebc1b1be708 Mon Sep 17 00:00:00 2001 From: Pyry Kovanen Date: Thu, 27 Apr 2023 16:29:29 +0300 Subject: [PATCH 10/49] hood: do no subtract-underflow on null base hash --- pkg/base-dev/sur/hood.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/base-dev/sur/hood.hoon b/pkg/base-dev/sur/hood.hoon index f186235821..a1aa7791b8 100644 --- a/pkg/base-dev/sur/hood.hoon +++ b/pkg/base-dev/sur/hood.hoon @@ -140,7 +140,7 @@ ?. verb =/ base-hash ?.(=(1 (lent meb)) <(head meb)>) :~ leaf/"/sys/kelvin: {kul}" - leaf/"base hash ends in: {(slag (sub (lent base-hash) 5) base-hash)}" + leaf/"base hash ends in: {(slag (sub (max 5 (lent base-hash)) 5) base-hash)}" leaf/"%cz hash ends in: {(slag (sub (lent ) 5) )}" leaf/"app status: {sat}" leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}" From 9c124ceeaa3a752c614548eeec561bd27146c963 Mon Sep 17 00:00:00 2001 From: Pyry Kovanen Date: Thu, 27 Apr 2023 16:35:24 +0300 Subject: [PATCH 11/49] hood: revert 84e0e1846221d6c912ad03ff1dbdaebc1b1be708 --- pkg/base-dev/sur/hood.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/base-dev/sur/hood.hoon b/pkg/base-dev/sur/hood.hoon index a1aa7791b8..35d2fd82e2 100644 --- a/pkg/base-dev/sur/hood.hoon +++ b/pkg/base-dev/sur/hood.hoon @@ -140,7 +140,7 @@ ?. verb =/ base-hash ?.(=(1 (lent meb)) <(head meb)>) :~ leaf/"/sys/kelvin: {kul}" - leaf/"base hash ends in: {(slag (sub (max 5 (lent base-hash)) 5) base-hash)}" + leaf/"base hash ends in: {(slag (sub (lent base-hash)) base-hash)}" leaf/"%cz hash ends in: {(slag (sub (lent ) 5) )}" leaf/"app status: {sat}" leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}" From f89baab416e2d19bd6788754b218c3533d04fead Mon Sep 17 00:00:00 2001 From: Pyry Kovanen Date: Thu, 27 Apr 2023 16:39:37 +0300 Subject: [PATCH 12/49] hood: actually revert 84e0e1846221d6c912ad03ff1dbdaebc1b1be708 --- pkg/base-dev/sur/hood.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/base-dev/sur/hood.hoon b/pkg/base-dev/sur/hood.hoon index 35d2fd82e2..3957b82ea5 100644 --- a/pkg/base-dev/sur/hood.hoon +++ b/pkg/base-dev/sur/hood.hoon @@ -140,7 +140,7 @@ ?. verb =/ base-hash ?.(=(1 (lent meb)) <(head meb)>) :~ leaf/"/sys/kelvin: {kul}" - leaf/"base hash ends in: {(slag (sub (lent base-hash)) base-hash)}" + leaf/"base hash ends in: {(slag (sub (lent base-hash) base-hash)}" leaf/"%cz hash ends in: {(slag (sub (lent ) 5) )}" leaf/"app status: {sat}" leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}" From f3d7863527db99c0d14d475c8951b453ae68faee Mon Sep 17 00:00:00 2001 From: ~wicrum-wicrun <99811688+wicrum-wicrun@users.noreply.github.com> Date: Thu, 27 Apr 2023 19:18:38 +0200 Subject: [PATCH 13/49] gall: `%yawn` on uninstall --- pkg/arvo/sys/vane/gall.hoon | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index 0b7db1e310..c23b27c710 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -958,8 +958,18 @@ moves moves == :: + ++ ap-yawn-all + ^- (list card:agent) + %- zing + %+ turn ~(tap by ken.yoke) + |= [=spar:ames wyz=(set wire)] + %+ turn ~(tap in wyz) + |= =wire + [%pass wire %arvo %a %yawn spar] + :: ++ ap-idle ?: ?=(%| -.agent.yoke) ap-core + => (ap-ingest ~ |.([ap-yawn-all p.agent.yoke])) ap-core(agent.yoke |+on-save:ap-agent-core) :: ++ ap-nuke @@ -979,12 +989,7 @@ |= [[=wire =dock] ? =path] [%pass wire %agent dock %leave ~] :: - %- zing - %+ turn ~(tap by ken.yoke) - |= [=spar:ames wyz=(set wire)] - %+ turn ~(tap in wyz) - |= =wire - [%pass wire %arvo %a %yawn spar] + ap-yawn-all == =^ maybe-tang ap-core (ap-ingest ~ |.([will *agent])) ap-core From 11f53d680ac9d6b5ec36c5ee48ef4d058f57d201 Mon Sep 17 00:00:00 2001 From: ~wicrum-wicrun <99811688+wicrum-wicrun@users.noreply.github.com> Date: Thu, 27 Apr 2023 19:19:54 +0200 Subject: [PATCH 14/49] gall,lull: add outstanding `%keen`s to the `$bowl` --- pkg/arvo/sys/lull.hoon | 1 + pkg/arvo/sys/vane/gall.hoon | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg/arvo/sys/lull.hoon b/pkg/arvo/sys/lull.hoon index 3056308008..f0df3a57a0 100644 --- a/pkg/arvo/sys/lull.hoon +++ b/pkg/arvo/sys/lull.hoon @@ -2616,6 +2616,7 @@ $= sky :: scry bindings %+ map path :: ((mop @ud (pair @da (each page @uvI))) lte) :: + ken=(jug spar:ames wire) :: open keens == :: $: act=@ud :: change number eny=@uvJ :: entropy diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index c23b27c710..3cb8d980ab 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -1311,6 +1311,7 @@ :* wex=boat.yoke :: outgoing sup=bitt.yoke :: incoming sky=(~(run by sky.yoke) tail) :: bindings + ken=ken.yoke :: requests == :: :* act=change.stats.yoke :: tick eny=eny.stats.yoke :: nonce From 5819ee3ddd67c9ab6b38a3bdedd4f923bd57a5ba Mon Sep 17 00:00:00 2001 From: ~wicrum-wicrun <99811688+wicrum-wicrun@users.noreply.github.com> Date: Thu, 27 Apr 2023 19:22:41 +0200 Subject: [PATCH 15/49] Revert "gall,lull: add outstanding `%keen`s to the `$bowl`" This reverts commit 11f53d680ac9d6b5ec36c5ee48ef4d058f57d201. --- pkg/arvo/sys/lull.hoon | 1 - pkg/arvo/sys/vane/gall.hoon | 1 - 2 files changed, 2 deletions(-) diff --git a/pkg/arvo/sys/lull.hoon b/pkg/arvo/sys/lull.hoon index f0df3a57a0..3056308008 100644 --- a/pkg/arvo/sys/lull.hoon +++ b/pkg/arvo/sys/lull.hoon @@ -2616,7 +2616,6 @@ $= sky :: scry bindings %+ map path :: ((mop @ud (pair @da (each page @uvI))) lte) :: - ken=(jug spar:ames wire) :: open keens == :: $: act=@ud :: change number eny=@uvJ :: entropy diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index 3cb8d980ab..c23b27c710 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -1311,7 +1311,6 @@ :* wex=boat.yoke :: outgoing sup=bitt.yoke :: incoming sky=(~(run by sky.yoke) tail) :: bindings - ken=ken.yoke :: requests == :: :* act=change.stats.yoke :: tick eny=eny.stats.yoke :: nonce From 06c78c85d0b4dbc09fb57cba4d89c0f98a62d3ec Mon Sep 17 00:00:00 2001 From: Hunter Miller Date: Thu, 27 Apr 2023 16:08:03 -0500 Subject: [PATCH 16/49] json: used optimized arm --- pkg/base-dev/mar/json.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/base-dev/mar/json.hoon b/pkg/base-dev/mar/json.hoon index 1ee1a59ad6..9fcc2a9b10 100644 --- a/pkg/base-dev/mar/json.hoon +++ b/pkg/base-dev/mar/json.hoon @@ -17,7 +17,7 @@ -- ++ grab |% :: convert from - ++ mime |=([p=mite q=octs] (fall (rush (@t q.q) apex:de:json) *^json)) + ++ mime |=([p=mite q=octs] (fall (de:json:html (@t q.q)) *^json)) ++ noun ^json :: clam from %noun ++ numb numb:enjs ++ time time:enjs From f9cf4b154b3cc8899bc928a76205375b9620b508 Mon Sep 17 00:00:00 2001 From: Pyry Kovanen Date: Fri, 28 Apr 2023 00:53:03 +0300 Subject: [PATCH 17/49] hood: revert my nonsense that's part of PR #6520 --- pkg/base-dev/sur/hood.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/base-dev/sur/hood.hoon b/pkg/base-dev/sur/hood.hoon index 3957b82ea5..f186235821 100644 --- a/pkg/base-dev/sur/hood.hoon +++ b/pkg/base-dev/sur/hood.hoon @@ -140,7 +140,7 @@ ?. verb =/ base-hash ?.(=(1 (lent meb)) <(head meb)>) :~ leaf/"/sys/kelvin: {kul}" - leaf/"base hash ends in: {(slag (sub (lent base-hash) base-hash)}" + leaf/"base hash ends in: {(slag (sub (lent base-hash) 5) base-hash)}" leaf/"%cz hash ends in: {(slag (sub (lent ) 5) )}" leaf/"app status: {sat}" leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}" From 93f8b3b0c9dc2d9d9200526534cd760fae3115b8 Mon Sep 17 00:00:00 2001 From: Hunter Miller Date: Thu, 27 Apr 2023 17:39:40 -0500 Subject: [PATCH 18/49] json: no need to reference from html, already exposed Co-authored-by: Joe Bryan --- pkg/base-dev/mar/json.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/base-dev/mar/json.hoon b/pkg/base-dev/mar/json.hoon index 9fcc2a9b10..7d6fcbf890 100644 --- a/pkg/base-dev/mar/json.hoon +++ b/pkg/base-dev/mar/json.hoon @@ -17,7 +17,7 @@ -- ++ grab |% :: convert from - ++ mime |=([p=mite q=octs] (fall (de:json:html (@t q.q)) *^json)) + ++ mime |=([p=mite q=octs] (fall (de:json (@t q.q)) *^json)) ++ noun ^json :: clam from %noun ++ numb numb:enjs ++ time time:enjs From a017c02c4f92827867ecbbba79cef31b23e8f67d Mon Sep 17 00:00:00 2001 From: John Franklin Date: Thu, 27 Apr 2023 18:23:34 -0500 Subject: [PATCH 19/49] hood: +report-vat: handle desks with multiple base hashes (=verb |) --- pkg/base-dev/sur/hood.hoon | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkg/base-dev/sur/hood.hoon b/pkg/base-dev/sur/hood.hoon index f186235821..322382e749 100644 --- a/pkg/base-dev/sur/hood.hoon +++ b/pkg/base-dev/sur/hood.hoon @@ -16,6 +16,12 @@ :: +$ sync-state [nun=@ta kid=(unit desk) let=@ud] +$ sink (unit [her=@p sud=desk kid=(unit desk) let=@ud]) +:: +truncate-hash: get last 5 digits of hash and convert to tape +:: +++ truncate-hash + |= hash=@uv + ^- tape + (slag 2 <`@uv`(mod hash 0v1.00000)>) :: +report-prep: get data required for reports :: ++ report-prep @@ -138,10 +144,13 @@ |= [=weft =tape] (welp " {<[lal num]:weft>}" tape) ?. verb - =/ base-hash ?.(=(1 (lent meb)) <(head meb)>) + =/ cut=(list tape) (turn meb truncate-hash) + =/ base-hash + ?: =(1 (lent cut)) (head cut) + "~[{`tape`(zing (join " " `(list tape)`cut))}]" :~ leaf/"/sys/kelvin: {kul}" - leaf/"base hash ends in: {(slag (sub (lent base-hash) 5) base-hash)}" - leaf/"%cz hash ends in: {(slag (sub (lent ) 5) )}" + leaf/"base hash ends in: {base-hash}" + leaf/"%cz hash ends in: {(truncate-hash hash)}" leaf/"app status: {sat}" leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}" == From 013f294cde5c274469c67e64a01332871884a59e Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Thu, 27 Apr 2023 17:09:33 -0700 Subject: [PATCH 20/49] clay: correctly save cache after goad The refactor from aeon to tako is from May 2022, but unmerged until March 2023. In the meantime, I added another usage of aeon-flow in July 2022, which was converted to aeon-flow in March 2023, but the argument itself was unchanged. This meant we didn't save the cache after +goad. --- pkg/arvo/sys/vane/clay.hoon | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index d011800547..5fe52b8f16 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -4558,7 +4558,8 @@ |* [her=ship syd=desk yon=(unit aeon) res=* =state:ford:fusion] =^ moves ruf =/ den ((de now rof hen ruf) her syd) - abet:+:(tako-flow:den ?~(yon let.dom:den u.yon) res cache.state &2.state) + =/ tak (aeon-to-tako:ze:den ?~(yon let.dom:den u.yon)) + abet:+:(tako-flow:den tak res cache.state &2.state) [res (emil moves)] :: ++ trace From 249eb50d4207c95123600d2a55ed32d54c59a90f Mon Sep 17 00:00:00 2001 From: John Franklin Date: Thu, 27 Apr 2023 20:10:53 -0500 Subject: [PATCH 21/49] hood: +report-vat: handle desks with null base hash (=verb |) --- pkg/base-dev/sur/hood.hoon | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/base-dev/sur/hood.hoon b/pkg/base-dev/sur/hood.hoon index 322382e749..e103a199cf 100644 --- a/pkg/base-dev/sur/hood.hoon +++ b/pkg/base-dev/sur/hood.hoon @@ -145,8 +145,10 @@ (welp " {<[lal num]:weft>}" tape) ?. verb =/ cut=(list tape) (turn meb truncate-hash) + =/ len (lent cut) =/ base-hash - ?: =(1 (lent cut)) (head cut) + ?: =(0 len) "~" + ?: =(1 len) (head cut) "~[{`tape`(zing (join " " `(list tape)`cut))}]" :~ leaf/"/sys/kelvin: {kul}" leaf/"base hash ends in: {base-hash}" From b804ab3a23dc19778ba457da7492f044536bc7d7 Mon Sep 17 00:00:00 2001 From: ~wicrum-wicrun <99811688+wicrum-wicrun@users.noreply.github.com> Date: Fri, 28 Apr 2023 19:19:42 +0200 Subject: [PATCH 22/49] gall: hold on to `.ken.yoke` through uninstalls --- pkg/arvo/sys/vane/gall.hoon | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index c23b27c710..0ab76c8908 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -968,9 +968,10 @@ [%pass wire %arvo %a %yawn spar] :: ++ ap-idle + ^+ ap-core ?: ?=(%| -.agent.yoke) ap-core - => (ap-ingest ~ |.([ap-yawn-all p.agent.yoke])) - ap-core(agent.yoke |+on-save:ap-agent-core) + => [ken=ken.yoke (ap-ingest ~ |.([ap-yawn-all *agent]))] + ap-core(ken.yoke ken, agent.yoke |+on-save:ap-agent-core) :: ++ ap-nuke ^+ ap-core @@ -1327,6 +1328,12 @@ ?: ?=(%& -.agent.yoke) on-save:ap-agent-core p.agent.yoke + =? ap-core &(?=(%| -.agent.yoke) ?=(^ ken.yoke)) + =- +:(ap-ingest ~ |.([+< agent])) + %- zing + %+ turn ~(tap by `(jug spar:ames wire)`ken.yoke) + |= [=spar:ames wyz=(set wire)] + (turn ~(tap in wyz) |=(=wire [%pass wire %arvo %a %keen spar])) =^ error ap-core (ap-install(agent.yoke &+agent) `old-state) ?~ error From 3fc62792e30b7388944d8ad4251c78fc19a1e5c2 Mon Sep 17 00:00:00 2001 From: John Franklin Date: Sat, 29 Apr 2023 02:20:14 -0500 Subject: [PATCH 23/49] meta: command corrections in CONTRIBUTING.md --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e35391b733..59db35a6bd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -167,7 +167,7 @@ should be accompanied by an updated [solid pill](#the-kernel-and-pills). Pills are tracked in the repository via [git LFS][git-lfs]. ``` -$ git lfs init +$ git lfs install $ git lfs pull ``` @@ -185,7 +185,7 @@ directory as `urbit.pill`. You can boot a new ship from your local pill with `-B`: ``` -$ urbit -F zod -B path/to/urbit.pill my-fake-zod +$ urbit -F zod -B path/to/urbit.pill -c my-fake-zod ``` Release pills, i.e. those corresponding to vere releases, are cached at From dd024448766cd3206b8b9a26139ccb1af0ac1cbd Mon Sep 17 00:00:00 2001 From: John Franklin Date: Sat, 29 Apr 2023 04:04:30 -0500 Subject: [PATCH 24/49] +vats: sort %base and %kids (sometimes) --- pkg/arvo/gen/vats.hoon | 22 ++++++++------ pkg/base-dev/sur/hood.hoon | 62 ++++++++++++++++++++------------------ 2 files changed, 44 insertions(+), 40 deletions(-) diff --git a/pkg/arvo/gen/vats.hoon b/pkg/arvo/gen/vats.hoon index 51db85bca7..5fdfaec745 100644 --- a/pkg/arvo/gen/vats.hoon +++ b/pkg/arvo/gen/vats.hoon @@ -1,21 +1,23 @@ -:: Print diagnostic information about desks. +:: Print diagnostic information about desks. :: -:: Accepts an optional argument of a list of one or more desks, returns info +:: Accepts an optional argument of a list of one or more desks, returns info :: on all desks if no desks are specified. :: -:: Keyword arguments include =filt and =verb. =filt takes one of %running, +:: Keyword arguments include =filt and =verb. =filt takes one of %running, :: %suspended, %exists, %exists-not, or %blocking; =verb takes either & or | -:: +:: :: If both a list of desks and a filter are provided, the output will include -:: the desks from the list that match the filter, with the exception of the +:: the desks from the list that match the filter, with the exception of the :: %blocking filter which always returns all desks that match. :: /- *hood :- %say |= [[now=@da * bec=beak] deks=$@(~ (list desk)) filt=@tas verb=_|] -?: &(=(~ deks) =(%$ filt)) - :- %tang - %+ turn - ~(tap in .^((set desk) %cd /(scot %p p.bec)/base/(scot %da now))) +?: &(=(~ deks) =(%$ filt)) + :- %tang + %+ turn + %+ sort + ~(tap in .^((set desk) %cd /(scot %p p.bec)/base/(scot %da now))) + |=([a=desk b=desk] ?|(=(a %kids) =(b %base))) |=(syd=desk (report-vat (report-prep p.bec now) p.bec now syd verb)) -[%tang (report-vats p.bec now deks filt verb)] +[%tang (report-vats p.bec now deks filt verb)] diff --git a/pkg/base-dev/sur/hood.hoon b/pkg/base-dev/sur/hood.hoon index e103a199cf..2cfd73e64f 100644 --- a/pkg/base-dev/sur/hood.hoon +++ b/pkg/base-dev/sur/hood.hoon @@ -41,53 +41,55 @@ |= [our=@p now=@da desks=(list desk) filt=@tas verb=?] =/ ego (scot %p our) =/ wen (scot %da now) - =/ prep (report-prep our now) + =/ prep (report-prep our now) ?~ filt %+ turn (flop desks) |=(syd=@tas (report-vat prep our now syd verb)) - =/ deks - ?~ desks ~(tap in -.prep) - %+ skip ~(tap in -.prep) + =/ deks + ?~ desks + %+ sort ~(tap in -.prep) + |=([[a=desk *] [b=desk *]] ?|(=(a %kids) =(b %base))) + %+ skip ~(tap in -.prep) |=([syd=@tas *] =(~ (find ~[syd] desks))) - ?: =(filt %blocking) + ?: =(filt %blocking) =/ base-wic %+ sort ~(tap by wic:(~(got by -.prep) %base)) - |=([[* a=@ud] [* b=@ud]] (gth a b)) - ?~ base-wic ~[leaf+"%base already up-to-date"] + |=([[* a=@ud] [* b=@ud]] (gth a b)) + ?~ base-wic ~[leaf+"%base already up-to-date"] =/ blockers=(list desk) %+ turn %+ skip ~(tap in -.prep) - |= [* [zest=@tas wic=(set weft)]] - ?. =(zest %live) & - (~(has in wic) i.base-wic) - |=([syd=desk *] syd) + |= [* [zest=@tas wic=(set weft)]] + ?. =(zest %live) & + (~(has in wic) i.base-wic) + |=([syd=desk *] syd) ?~ blockers ~[leaf+"No desks blocking upgrade, run |bump to apply"] :- [%rose [" %" "To unblock upgrade run |suspend %" ""] blockers] %+ turn (flop blockers) - |=(syd=desk (report-vat prep our now syd verb)) + |=(syd=desk (report-vat prep our now syd verb)) %+ turn - ?+ filt !! - :: - %exists - %+ skip deks - |=([syd=desk *] =(ud:.^(cass %cw /[ego]/[syd]/[wen]) 0)) - :: - %running - %+ skim deks + ?+ filt !! + :: + %exists + %+ skip deks + |=([syd=desk *] =(ud:.^(cass %cw /[ego]/[syd]/[wen]) 0)) + :: + %running + %+ skim deks |=([* [zest=@tas *]] =(zest %live)) - :: - %suspended - %+ skip deks - |= [syd=@tas [zest=@tas *]] - ?| =(syd %kids) + :: + %suspended + %+ skip deks + |= [syd=@tas [zest=@tas *]] + ?| =(syd %kids) =(zest %live) =(ud:.^(cass %cw /[ego]/[syd]/[wen]) 0) - == - :: - %exists-not + == + :: + %exists-not %+ skim deks |=([syd=desk *] =(ud:.^(cass %cw /[ego]/[syd]/[wen]) 0)) - == + == |=([syd=desk *] (report-vat prep our now syd verb)) :: +report-vat: report on a single desk installation :: @@ -155,7 +157,7 @@ leaf/"%cz hash ends in: {(truncate-hash hash)}" leaf/"app status: {sat}" leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}" - == + == :~ leaf/"/sys/kelvin: {kul}" leaf/"base hash: {?.(=(1 (lent meb)) <(head meb)>)}" leaf/"%cz hash: {}" From d51c8bf50d2c50dd587531992815daf4499e3591 Mon Sep 17 00:00:00 2001 From: John Franklin Date: Sat, 29 Apr 2023 07:36:28 -0500 Subject: [PATCH 25/49] meta: don't codeblock table in MAINTAINERS.md --- MAINTAINERS.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 2be1149e3b..2f5025e4bc 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -13,15 +13,12 @@ also simple to reason about. The branches and their corresponding moons that comprise the stages of the release pipeline are: -``` ----------------------------------------------------------------------------------------------- - Branch | Moon | Target audience | Contains ----------------------------------------------------------------------------------------------- -`develop` | `~binnec-dozzod-marzod` | Kernel developers | Latest `develop` branch commit -`release` | `~marnec-dozzod-marzod` | Early Adopters | Latest `release` branch commit -`release` | `~doznec-dozzod-marzod` | App Developers | Latest release candidate -`master` | `~zod` | Everyone else | Latest release -``` +| Branch | Moon | Target Audience | Contains | +|:---------:|:-----------------------:|:-----------------:|:------------------------------:| +| `develop` | `~binnec-dozzod-marzod` | Kernel Developers | Latest `develop` branch commit | +| `release` | `~marnec-dozzod-marzod` | Early Adopters | Latest `release` branch commit | +| `release` | `~doznec-dozzod-marzod` | App Developers | Latest release candidate | +| `master` | `~zod` | Everyone Else | Latest release | **WARNING**: If you lack the requisite skills to troubleshoot and fix kernel issues, you should not sync from develop/~binnec. If you're not prepared to breach your ship in response to an issue stemming from an early release, do not use pre-release moons. From 05a7c755c69800400f95434e4c65391ba3c6fa6b Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Fri, 28 Apr 2023 15:19:01 -0400 Subject: [PATCH 26/49] base: pin the %kelvin mark in sur/hood for +vats --- pkg/base-dev/sur/hood.hoon | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/base-dev/sur/hood.hoon b/pkg/base-dev/sur/hood.hoon index 2cfd73e64f..28883c8a67 100644 --- a/pkg/base-dev/sur/hood.hoon +++ b/pkg/base-dev/sur/hood.hoon @@ -1,3 +1,4 @@ +/% kelvin %kelvin =, clay =* dude dude:gall |% From d732e5a91ad822810b77e830e29a0e8d3311320e Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Fri, 28 Apr 2023 16:47:51 -0400 Subject: [PATCH 27/49] vats: hack to always render multi-line tanks --- pkg/arvo/gen/vats.hoon | 1 + pkg/base-dev/sur/hood.hoon | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/pkg/arvo/gen/vats.hoon b/pkg/arvo/gen/vats.hoon index 5fdfaec745..061df9516b 100644 --- a/pkg/arvo/gen/vats.hoon +++ b/pkg/arvo/gen/vats.hoon @@ -15,6 +15,7 @@ |= [[now=@da * bec=beak] deks=$@(~ (list desk)) filt=@tas verb=_|] ?: &(=(~ deks) =(%$ filt)) :- %tang + %- zing %+ turn %+ sort ~(tap in .^((set desk) %cd /(scot %p p.bec)/base/(scot %da now))) diff --git a/pkg/base-dev/sur/hood.hoon b/pkg/base-dev/sur/hood.hoon index 28883c8a67..bbe55e4e1a 100644 --- a/pkg/base-dev/sur/hood.hoon +++ b/pkg/base-dev/sur/hood.hoon @@ -40,10 +40,12 @@ :: ++ report-vats |= [our=@p now=@da desks=(list desk) filt=@tas verb=?] + ^- tang =/ ego (scot %p our) =/ wen (scot %da now) =/ prep (report-prep our now) ?~ filt + %- zing %+ turn (flop desks) |=(syd=@tas (report-vat prep our now syd verb)) =/ deks @@ -66,8 +68,11 @@ |=([syd=desk *] syd) ?~ blockers ~[leaf+"No desks blocking upgrade, run |bump to apply"] :- [%rose [" %" "To unblock upgrade run |suspend %" ""] blockers] + %- zing %+ turn (flop blockers) |=(syd=desk (report-vat prep our now syd verb)) + :: + %- zing %+ turn ?+ filt !! :: @@ -100,6 +105,15 @@ == our=ship now=@da syd=desk verb=? == + ^- tang + =- :: hack to force wrapped rendering + :: + :: edg=6 empirically prevents dedent + :: + %+ roll + (~(win re -) [0 6]) + |=([a=tape b=(list @t)] [(crip a) b]) + :: ^- tank =/ ego (scot %p our) =/ wen (scot %da now) From 92a1f50a499d254ee75e9b27d2d2cfa095824221 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Sat, 29 Apr 2023 10:05:56 -0400 Subject: [PATCH 28/49] vats: refactor generator --- pkg/arvo/gen/vats.hoon | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/pkg/arvo/gen/vats.hoon b/pkg/arvo/gen/vats.hoon index 061df9516b..e8d20b0e3a 100644 --- a/pkg/arvo/gen/vats.hoon +++ b/pkg/arvo/gen/vats.hoon @@ -12,13 +12,16 @@ :: /- *hood :- %say -|= [[now=@da * bec=beak] deks=$@(~ (list desk)) filt=@tas verb=_|] -?: &(=(~ deks) =(%$ filt)) - :- %tang - %- zing - %+ turn - %+ sort - ~(tap in .^((set desk) %cd /(scot %p p.bec)/base/(scot %da now))) - |=([a=desk b=desk] ?|(=(a %kids) =(b %base))) - |=(syd=desk (report-vat (report-prep p.bec now) p.bec now syd verb)) -[%tang (report-vats p.bec now deks filt verb)] +|= $: [now=@da * bec=beak] + deks=(list desk) + [filt=@tas verb=_|] + == +:- %tang ^- tang +?. &(=(~ deks) =(%$ filt)) + (report-vats p.bec now deks filt verb) +%- zing +%+ turn + %+ sort + ~(tap in .^((set desk) %cd /(scot %p p.bec)/base/(scot %da now))) + |=([a=desk b=desk] ?|(=(a %kids) =(b %base))) +|=(syd=desk (report-vat (report-prep p.bec now) p.bec now syd verb)) From b7bf1e68caab856f45db9eaec20b46e98b2b80ec Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Sat, 29 Apr 2023 10:13:50 -0400 Subject: [PATCH 29/49] vats: sort alphabetically within constraints (%base first, %kids last) --- pkg/arvo/gen/vats.hoon | 3 ++- pkg/base-dev/sur/hood.hoon | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/arvo/gen/vats.hoon b/pkg/arvo/gen/vats.hoon index e8d20b0e3a..51e0059065 100644 --- a/pkg/arvo/gen/vats.hoon +++ b/pkg/arvo/gen/vats.hoon @@ -22,6 +22,7 @@ %- zing %+ turn %+ sort - ~(tap in .^((set desk) %cd /(scot %p p.bec)/base/(scot %da now))) + =/ sed .^((set desk) %cd /(scot %p p.bec)/base/(scot %da now)) + (sort ~(tap in sed) |=([a=@ b=@] !(aor a b))) |=([a=desk b=desk] ?|(=(a %kids) =(b %base))) |=(syd=desk (report-vat (report-prep p.bec now) p.bec now syd verb)) diff --git a/pkg/base-dev/sur/hood.hoon b/pkg/base-dev/sur/hood.hoon index bbe55e4e1a..9c7e065813 100644 --- a/pkg/base-dev/sur/hood.hoon +++ b/pkg/base-dev/sur/hood.hoon @@ -50,8 +50,9 @@ |=(syd=@tas (report-vat prep our now syd verb)) =/ deks ?~ desks - %+ sort ~(tap in -.prep) - |=([[a=desk *] [b=desk *]] ?|(=(a %kids) =(b %base))) + %+ sort + (sort ~(tap in -.prep) |=([[a=@ *] b=@ *] !(aor a b))) + |=([[a=@ *] [b=@ *]] ?|(=(a %kids) =(b %base))) %+ skip ~(tap in -.prep) |=([syd=@tas *] =(~ (find ~[syd] desks))) ?: =(filt %blocking) From 444242b5fc4c374eb7193a023b40f7eb723702cf Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Sat, 29 Apr 2023 10:25:27 -0400 Subject: [PATCH 30/49] vats: sort force on/off lists --- pkg/base-dev/sur/hood.hoon | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkg/base-dev/sur/hood.hoon b/pkg/base-dev/sur/hood.hoon index 9c7e065813..3c53210056 100644 --- a/pkg/base-dev/sur/hood.hoon +++ b/pkg/base-dev/sur/hood.hoon @@ -142,9 +142,6 @@ ?~ sink [hash]~ (mergebase-hashes our syd now her.u.sink sud.u.sink) =/ dek (~(got by tyr) syd) - =/ =dome (~(got by cone) our syd) - =/ [on=(list [@tas ?]) of=(list [@tas ?])] - (skid ~(tap by ren.dome) |=([* ?] +<+)) =/ sat ?- zest.dek %live "running" @@ -174,13 +171,17 @@ leaf/"app status: {sat}" leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}" == + :: + =/ [on=(list [@tas ?]) of=(list [@tas ?])] + =/ =dome (~(got by cone) our syd) + (skid ~(tap by ren.dome) |=([* ?] +<+)) :~ leaf/"/sys/kelvin: {kul}" leaf/"base hash: {?.(=(1 (lent meb)) <(head meb)>)}" leaf/"%cz hash: {}" :: leaf/"app status: {sat}" - leaf/"force on: {?:(=(~ on) "~" )}" - leaf/"force off: {?:(=(~ of) "~" )}" + leaf/"force on: {<(sort (turn on head) aor)>}" + leaf/"force off: {<(sort (turn of head) aor)>}" :: leaf/"publishing ship: {?~(sink <~> <(get-publisher our syd now)>)}" leaf/"updates: {?~(sink "local" "remote")}" From 565869f86df1eb1a397cb17d0913d9970dbd0f89 Mon Sep 17 00:00:00 2001 From: Hunter Miller Date: Mon, 1 May 2023 09:59:19 -0500 Subject: [PATCH 31/49] landscape: compat w/ 413 --- pkg/landscape/app/dm-hook.hoon | 2 +- pkg/landscape/sys.kelvin | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/landscape/app/dm-hook.hoon b/pkg/landscape/app/dm-hook.hoon index 9859d1a898..1a4ee6c913 100644 --- a/pkg/landscape/app/dm-hook.hoon +++ b/pkg/landscape/app/dm-hook.hoon @@ -41,7 +41,7 @@ :_ this :_ ~ =/ dms=(list resource) - ?. .^(? %gu (scry:io %graph-store ~)) + ?. .^(? %gu (scry:io %graph-store $ ~)) ~ %+ skim ~(tap in get-keys:gra) |=([ship name=term] ?=(^ (rush name ;~(pfix (jest 'dm--') fed:ag)))) diff --git a/pkg/landscape/sys.kelvin b/pkg/landscape/sys.kelvin index a36738916e..3fbd8589b0 100644 --- a/pkg/landscape/sys.kelvin +++ b/pkg/landscape/sys.kelvin @@ -1,3 +1 @@ -[%zuse 416] -[%zuse 415] -[%zuse 414] \ No newline at end of file +[%zuse 413] \ No newline at end of file From e7184231353f6a43ebd39853eb1977289a1d4bde Mon Sep 17 00:00:00 2001 From: Jonathan Paprocki Date: Mon, 1 May 2023 11:37:27 -0400 Subject: [PATCH 32/49] hoon: remove swap +vang for (doc |) in +loll --- pkg/arvo/sys/hoon.hoon | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index b72c29b2b5..550959886e 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -13417,9 +13417,7 @@ ++ hunk (most mush loan) :: gapped specs ++ jump ;~(pose leap:docs gap) :: gap before docs ++ loaf ?:(tol tall wide) :: hoon - ++ loll ?: tol :: hoon without docs - tall:(vang bug wer |) - wide:(vang bug wer |) + ++ loll ?:(tol tall(doc |) wide(doc |)) :: hoon without docs ++ loan ?:(tol till wyde) :: spec ++ lore (sear |=(=hoon ~(flay ap hoon)) loaf) :: skin ++ lomp ;~(plug sym (punt ;~(pfix tis wyde))) :: typeable name From 5f67d7941130188e345ed8d9485a9ceaa34dc8c2 Mon Sep 17 00:00:00 2001 From: Hunter Miller Date: Mon, 1 May 2023 14:26:38 -0500 Subject: [PATCH 33/49] landscape: use correct args and syntax --- pkg/landscape/app/dm-hook.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/landscape/app/dm-hook.hoon b/pkg/landscape/app/dm-hook.hoon index 1a4ee6c913..8f8a24d1bf 100644 --- a/pkg/landscape/app/dm-hook.hoon +++ b/pkg/landscape/app/dm-hook.hoon @@ -41,7 +41,7 @@ :_ this :_ ~ =/ dms=(list resource) - ?. .^(? %gu (scry:io %graph-store $ ~)) + ?. .^(? %gu (scry:io %graph-store /$)) ~ %+ skim ~(tap in get-keys:gra) |=([ship name=term] ?=(^ (rush name ;~(pfix (jest 'dm--') fed:ag)))) From 9c59c970e376543cf2562d631b2f1ba862d7d807 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Mon, 1 May 2023 16:30:21 -0400 Subject: [PATCH 34/49] vats: fixes +vat --- pkg/arvo/gen/vat.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/arvo/gen/vat.hoon b/pkg/arvo/gen/vat.hoon index 0265e97dfe..230a70adce 100644 --- a/pkg/arvo/gen/vat.hoon +++ b/pkg/arvo/gen/vat.hoon @@ -1,7 +1,7 @@ /- *hood :- %say |= [[now=@da eny=@uvJ bec=beak] [syd=desk ~] verb=_&] -:~ %tang +:* %tang leaf+"Notice: +vat is deprecated as +vats now takes lists of one or more desks" (report-vat (report-prep p.bec now) p.bec now syd verb) == From 4a1aae5c4825ed29889582275acc0e7fefe3231a Mon Sep 17 00:00:00 2001 From: bacwyls Date: Mon, 1 May 2023 18:32:49 -0500 Subject: [PATCH 35/49] clay: fix read-s subs for 413 =case was added as an argument to read-s to support %cs subs it was accidentally removed as an argument during a merge, breaking %cs subs by causing it to always crash in a comparison between case and [%da now], because case resolved to the mold rather than a value. this commit restores intended functionality. --- pkg/arvo/sys/vane/clay.hoon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index d011800547..864533b180 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -4243,7 +4243,7 @@ :: +read-s: produce miscellaneous :: ++ read-s - |= [tak=tako pax=path] + |= [tak=tako pax=path =case] ^- (unit (unit cage)) ?: ?=([%subs ~] pax) ?. =([%da now] case) ~ @@ -4514,7 +4514,7 @@ %f (read-f tak path.mun) %p [(read-p path.mun) ..park] %r (read-r tak path.mun) - %s [(read-s tak path.mun) ..park] + %s [(read-s tak path.mun case.mun) ..park] %t [(read-t tak path.mun) ..park] %u [(read-u tak path.mun) ..park] %v [(read-v tak path.mun) ..park] From d7a2c53df8f980ed274392fbadf3372432ce7c0e Mon Sep 17 00:00:00 2001 From: ~wicrum-wicrun <99811688+wicrum-wicrun@users.noreply.github.com> Date: Tue, 2 May 2023 15:17:25 +0200 Subject: [PATCH 36/49] lull,ames: use `mop` instead of `pha` in `.wan.keens` --- pkg/arvo/app/dbug.hoon | 5 +- pkg/arvo/sys/lull.hoon | 21 ++++- pkg/arvo/sys/vane/ames.hoon | 151 ++++++++++++++++++++++++++++++------ pkg/arvo/sys/zuse.hoon | 4 + 4 files changed, 152 insertions(+), 29 deletions(-) diff --git a/pkg/arvo/app/dbug.hoon b/pkg/arvo/app/dbug.hoon index 9578b036dd..036d53eaf9 100644 --- a/pkg/arvo/app/dbug.hoon +++ b/pkg/arvo/app/dbug.hoon @@ -831,7 +831,10 @@ |= keen-state |^ ^- json %- pairs - :~ 'wan'^a/(turn (tap:(deq want) wan) wants) + :~ :- %wan + :- %a + (turn (tap:((on @sd want) lth-wan) wan) |=([@ a=_+6:wants] (wants a))) + :: 'nex'^a/(turn nex wants) :: :- 'hav' diff --git a/pkg/arvo/sys/lull.hoon b/pkg/arvo/sys/lull.hoon index 3056308008..6129d73f6d 100644 --- a/pkg/arvo/sys/lull.hoon +++ b/pkg/arvo/sys/lull.hoon @@ -49,6 +49,9 @@ :: :: +pha: finger tree :: +:: DO NOT USE THIS +:: It's wrong and only kept around for state migration purposes. +:: ++ pha |$ [val] $~ [%nul ~] @@ -461,6 +464,13 @@ ?: (compare key.n.a key.n.b) $(l.b $(b l.b, r.a ~), a r.a) $(r.b $(b r.b, l.a ~), a l.a) + :: +wyt: measure size + :: + ++ wyt + ~/ %wyt + |= a=(tree item) + ^- @ud + ?~(a 0 +((add $(a l.a) $(a r.a)))) -- :: +$ deco ?(~ %bl %br %un) :: text decoration @@ -1029,9 +1039,9 @@ keens=(map path keen-state) == +$ keen-state - $: wan=(pha want) :: request packets, sent - nex=(list want) :: request packets, unsent - hav=(list have) :: response packets, backward + $: wan=((mop @sd want) lth-wan) :: request packts, sent + nex=(list want) :: request packets, unsent + hav=(list have) :: response packets, backward num-fragments=@ud num-received=@ud next-wake=(unit @da) @@ -1183,6 +1193,11 @@ %.n (lte fragment-num.a fragment-num.b) :: + ++ lth-wan + |= [@sd @sd] + ^- ? + =(-1 (cmp:si +<)) + :: :: $pump-metrics: congestion control state for a |packet-pump :: :: This is an Ames adaptation of TCP's Reno congestion control diff --git a/pkg/arvo/sys/vane/ames.hoon b/pkg/arvo/sys/vane/ames.hoon index 1721de1002..2fa4911759 100644 --- a/pkg/arvo/sys/vane/ames.hoon +++ b/pkg/arvo/sys/vane/ames.hoon @@ -777,6 +777,52 @@ ++ com |~(a=pass ^?(..nu)) -- -- +:: ++$ ames-state-13 + $: peers=(map ship ship-state-13) + =unix=duct + =life + =rift + crypto-core=acru:ames + =bug + snub=[form=?(%allow %deny) ships=(set ship)] + cong=[msg=@ud mem=@ud] + == +:: ++$ ship-state-13 + $% [%alien alien-agenda] + [%known peer-state-13] + == +:: ++$ peer-state-13 + $: $: =symmetric-key + =life + =rift + =public-key + sponsor=ship + == + route=(unit [direct=? =lane]) + =qos + =ossuary + snd=(map bone message-pump-state) + rcv=(map bone message-sink-state) + nax=(set [=bone =message-num]) + heeds=(set duct) + closing=(set bone) + corked=(set bone) + keens=(map path keen-state-13) + == +:: ++$ keen-state-13 + $: wan=(pha want) :: request packts, sent + nex=(list want) :: request packets, unsent + hav=(list have) :: response packets, backward + num-fragments=@ud + num-received=@ud + next-wake=(unit @da) + listeners=(set duct) + metrics=pump-metrics + == :: $bug: debug printing configuration :: :: veb: verbosity toggles @@ -909,7 +955,8 @@ [%10 ames-state-10] [%11 ames-state-11] [%12 ames-state-12] - [%13 ^ames-state] + [%13 ames-state-13] + [%14 ^ames-state] == :: |= [now=@da eny=@ rof=roof] @@ -1032,7 +1079,7 @@ :: lifecycle arms; mostly pass-throughs to the contained adult ames :: ++ scry scry:adult-core - ++ stay [%13 %larva queued-events ames-state.adult-gate] + ++ stay [%14 %larva queued-events ames-state.adult-gate] ++ load |= $= old $% $: %4 @@ -1099,6 +1146,13 @@ [%adult state=ames-state-12] == == $: %13 + $% $: %larva + events=(qeu queued-event) + state=ames-state-13 + == + [%adult state=ames-state-13] + == == + $: %14 $% $: %larva events=(qeu queued-event) state=_ames-state.adult-gate @@ -1113,7 +1167,7 @@ =. state.old (state-4-to-5:load:adult-core state.old) $(-.old %5) :: - [%5 %adult *] + [%5 %adult *] =. cached-state `[%5 state.old] ~> %slog.0^leaf/"ames: larva reload" larval-gate @@ -1201,14 +1255,24 @@ =. queued-events events.old larval-gate :: - [%13 %adult *] (load:adult-core %13 state.old) + [%13 %adult *] + =. cached-state `[%13 state.old] + ~> %slog.0^leaf/"ames: larva reload" + larval-gate :: [%13 %larva *] ~> %slog.1^leaf/"ames: larva: load" + =. cached-state `[%13 state.old] =. queued-events events.old - =. adult-gate (load:adult-core %13 state.old) larval-gate :: + [%14 %adult *] (load:adult-core %14 state.old) + :: + [%14 %larva *] + ~> %slog.1^leaf/"ames: larva: load" + =. queued-events events.old + =. adult-gate (load:adult-core %14 state.old) + larval-gate == :: ++ event-11-to-12 @@ -1250,7 +1314,9 @@ 12+(state-11-to-12:load:adult-core +.u.cached-state) =? u.cached-state ?=(%12 -.u.cached-state) 13+(state-12-to-13:load:adult-core +.u.cached-state) - ?> ?=(%13 -.u.cached-state) + =? u.cached-state ?=(%13 -.u.cached-state) + 14+(state-13-to-14:load:adult-core +.u.cached-state) + ?> ?=(%14 -.u.cached-state) =. ames-state.adult-gate +.u.cached-state [moz larval-core(cached-state ~)] -- @@ -3813,9 +3879,25 @@ ^+ same (trace %fine verb her ships.bug.ames-state print) :: + ++ fi-mop + =, ((on @sd want) lth-wan) + |% + ++ cons + |= [a=_wan.keen =want] + ^+ a + =- (put a - want) + ?~ prev=(pry a) --0 + (dif:si key.u.prev --1) + :: + ++ snoc + |= [a=_wan.keen =want] + ^+ a + =- (put a - want) + ?~ prev=(pry a) --0 + (sum:si key.u.prev --1) + -- ++ fi-emit |=(move fine(event-core (emit +<))) - ++ fi-deq (deq want) - ++ fi-gauge (ga metrics.keen (wyt:fi-deq wan.keen)) + ++ fi-gauge (ga metrics.keen (wyt:fi-mop wan.keen)) ++ fi-wait |=(tim=@da (fi-pass-timer %b %wait tim)) ++ fi-rest |=(tim=@da (fi-pass-timer %b %rest tim)) :: @@ -3839,7 +3921,7 @@ =/ fra=@ 1 =/ req=hoot (fi-etch-wail fra) =/ =want [fra req last=now tries=1 skips=0] - =. wan.keen (cons:fi-deq *(pha ^want) want) + =. wan.keen (cons:fi-mop ~ want) (fi-send `@ux`req) :: ++ fi-rcv @@ -3909,12 +3991,12 @@ =| marked=(list want) |= fra=@ud ^- [? _fine] - =; [[found=? cor=_fine] wan=(pha want)] + =; [[found=? cor=_fine] wan=_wan.keen] :- found ?.(found fine cor(wan.keen wan)) - %^ (dip-left:fi-deq ,[found=? cor=_fine]) wan.keen + %^ (dip:fi-mop ,[found=? cor=_fine]) wan.keen [| fine] - |= [[found=? cor=_fine] =want] + |= [[found=? cor=_fine] @sd =want] ^- [(unit _want) stop=? [found=? cor=_fine]] =. fine cor ?: =(fra fra.want) @@ -3965,7 +4047,7 @@ =^ =want nex.keen nex.keen =. last-sent.want now =. tries.want +(tries.want) - =. wan.keen (snoc:fi-deq wan.keen want) + =. wan.keen (snoc:fi-mop wan.keen want) =. fine (fi-send `@ux`hoot.want) $(inx +(inx)) :: @@ -3981,11 +4063,11 @@ :: ++ fi-fast-retransmit |= fra=@ud - =; [cor=_fine wants=(pha want)] + =; [cor=_fine wants=_wan.keen] cor(wan.keen wants) - %^ (dip-left:fi-deq ,cor=_fine) wan.keen + %^ (dip:fi-mop ,cor=_fine) wan.keen fine - |= [cor=_fine =want] + |= [cor=_fine @sd =want] ^- [(unit ^want) stop=? cor=_fine] ?. (lte fra.want fra) [`want & cor] @@ -4003,9 +4085,9 @@ ++ fi-set-wake ^+ fine =/ next-wake=(unit @da) - ?~ want=(peek-left:fi-deq wan.keen) + ?~ want=(pry:fi-mop wan.keen) ~ - `(next-expiry:fi-gauge +>:u.want) + `(next-expiry:fi-gauge +>:val.u.want) ?: =(next-wake next-wake.keen) fine =? fine !=(~ next-wake.keen) @@ -4027,13 +4109,13 @@ =. peer-state (update-peer-route her peer-state) =. metrics.keen on-timeout:fi-gauge =^ want=(unit want) wan.keen - (pop-left:fi-deq wan.keen) + (fall (mole |.([`val.head rest]:(pop:fi-mop wan.keen))) `wan.keen) ~| %took-wake-for-empty-want ?> ?=(^ want) =: tries.u.want +(tries.u.want) last-sent.u.want now == - =. wan.keen (cons:fi-deq wan.keen u.want) + =. wan.keen (cons:fi-mop wan.keen u.want) (fi-send `@ux`hoot.u.want) -- :: +ga: constructor for |pump-gauge congestion control core @@ -4252,15 +4334,15 @@ [moves ames-gate] :: +stay: extract state before reload :: -++ stay [%13 %adult ames-state] +++ stay [%14 %adult ames-state] :: +load: load in old state after reload :: ++ load =< |= $= old-state - $% [%13 ^ames-state] + $% [%14 ^ames-state] == ^+ ames-gate - ?> ?=(%13 -.old-state) + ?> ?=(%14 -.old-state) ames-gate(ames-state +.old-state) :: all state transitions are called from larval ames :: @@ -4379,7 +4461,7 @@ :: ++ state-12-to-13 |= old=ames-state-12 - ^- ^ames-state + ^- ames-state-13 =+ !< =rift q:(need (need (rof ~ %j `beam`[[our %rift %da now] /(scot %p our)]))) =+ pk=sec:ex:crypto-core.old @@ -4397,10 +4479,29 @@ :: ++ ship-state-12-to-13 |= old=ship-state-12 - ^- ship-state + ^- ship-state-13 ?: ?=(%alien -.old) old(heeds [heeds.old ~]) old(corked [corked.old ~]) + :: + ++ state-13-to-14 + |= old=ames-state-13 + ^- ^ames-state + =- old(peers -) + %- ~(run by peers.old) + |= old=ship-state-13 + ?: ?=(%alien -.old) old + old(keens (~(run by keens.old) keen-state-13-to-14)) + :: + ++ keen-state-13-to-14 + |= old=keen-state-13 + ^- keen-state + =- old(wan wan) + %^ (dip-left:(deq want) ,[@ud wan=((mop @sd want) lth-wan)]) wan.old + [0 ~] + |= [[ix=@ud wan=((mop @sd want) lth-wan)] =want] + ^- [(unit ^want) ? @ud _wan] + [~ | +(ix) (put:((on @sd ^want) lth-wan) wan (sun:si ix) want)] -- :: +scry: dereference namespace :: diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index 58ebb9cf2a..9d8b4ec1f0 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5593,6 +5593,10 @@ $(pops [oldest pops]) -- -- +:: +deq: deque +:: +:: DO NOT USE THIS +:: It's wrong and only kept around for state migration purposes. :: ++ deq |* val=mold From ded0b7591480d1f36eea5b1619d315f963c68efe Mon Sep 17 00:00:00 2001 From: ~wicrum-wicrun <99811688+wicrum-wicrun@users.noreply.github.com> Date: Tue, 2 May 2023 16:25:51 +0200 Subject: [PATCH 37/49] ames,lull: `.wan.keen` uses fragment as mop key --- pkg/arvo/app/dbug.hoon | 3 +-- pkg/arvo/sys/lull.hoon | 12 +++--------- pkg/arvo/sys/vane/ames.hoon | 39 ++++++++++++------------------------- 3 files changed, 16 insertions(+), 38 deletions(-) diff --git a/pkg/arvo/app/dbug.hoon b/pkg/arvo/app/dbug.hoon index 036d53eaf9..5e8e8e2d78 100644 --- a/pkg/arvo/app/dbug.hoon +++ b/pkg/arvo/app/dbug.hoon @@ -832,8 +832,7 @@ |^ ^- json %- pairs :~ :- %wan - :- %a - (turn (tap:((on @sd want) lth-wan) wan) |=([@ a=_+6:wants] (wants a))) + a/(turn (tap:((on @ud want) lte) wan) |=([@ a=_+6:wants] (wants a))) :: 'nex'^a/(turn nex wants) :: diff --git a/pkg/arvo/sys/lull.hoon b/pkg/arvo/sys/lull.hoon index 6129d73f6d..8b4465e383 100644 --- a/pkg/arvo/sys/lull.hoon +++ b/pkg/arvo/sys/lull.hoon @@ -1039,9 +1039,9 @@ keens=(map path keen-state) == +$ keen-state - $: wan=((mop @sd want) lth-wan) :: request packts, sent - nex=(list want) :: request packets, unsent - hav=(list have) :: response packets, backward + $: wan=((mop @ud want) lte) :: request packets, sent + nex=(list want) :: request packets, unsent + hav=(list have) :: response packets, backward num-fragments=@ud num-received=@ud next-wake=(unit @da) @@ -1192,12 +1192,6 @@ ?: (gth message-num.a message-num.b) %.n (lte fragment-num.a fragment-num.b) - :: - ++ lth-wan - |= [@sd @sd] - ^- ? - =(-1 (cmp:si +<)) - :: :: $pump-metrics: congestion control state for a |packet-pump :: :: This is an Ames adaptation of TCP's Reno congestion control diff --git a/pkg/arvo/sys/vane/ames.hoon b/pkg/arvo/sys/vane/ames.hoon index 2fa4911759..8f9e01c591 100644 --- a/pkg/arvo/sys/vane/ames.hoon +++ b/pkg/arvo/sys/vane/ames.hoon @@ -3879,24 +3879,8 @@ ^+ same (trace %fine verb her ships.bug.ames-state print) :: - ++ fi-mop - =, ((on @sd want) lth-wan) - |% - ++ cons - |= [a=_wan.keen =want] - ^+ a - =- (put a - want) - ?~ prev=(pry a) --0 - (dif:si key.u.prev --1) - :: - ++ snoc - |= [a=_wan.keen =want] - ^+ a - =- (put a - want) - ?~ prev=(pry a) --0 - (sum:si key.u.prev --1) - -- ++ fi-emit |=(move fine(event-core (emit +<))) + ++ fi-mop ((on @ud want) lte) ++ fi-gauge (ga metrics.keen (wyt:fi-mop wan.keen)) ++ fi-wait |=(tim=@da (fi-pass-timer %b %wait tim)) ++ fi-rest |=(tim=@da (fi-pass-timer %b %rest tim)) @@ -3921,7 +3905,7 @@ =/ fra=@ 1 =/ req=hoot (fi-etch-wail fra) =/ =want [fra req last=now tries=1 skips=0] - =. wan.keen (cons:fi-mop ~ want) + =. wan.keen (put:fi-mop ~ [fra .]:want) (fi-send `@ux`req) :: ++ fi-rcv @@ -3996,7 +3980,7 @@ ?.(found fine cor(wan.keen wan)) %^ (dip:fi-mop ,[found=? cor=_fine]) wan.keen [| fine] - |= [[found=? cor=_fine] @sd =want] + |= [[found=? cor=_fine] @ud =want] ^- [(unit _want) stop=? [found=? cor=_fine]] =. fine cor ?: =(fra fra.want) @@ -4047,7 +4031,7 @@ =^ =want nex.keen nex.keen =. last-sent.want now =. tries.want +(tries.want) - =. wan.keen (snoc:fi-mop wan.keen want) + =. wan.keen (put:fi-mop wan.keen [fra .]:want) =. fine (fi-send `@ux`hoot.want) $(inx +(inx)) :: @@ -4067,7 +4051,7 @@ cor(wan.keen wants) %^ (dip:fi-mop ,cor=_fine) wan.keen fine - |= [cor=_fine @sd =want] + |= [cor=_fine @ud =want] ^- [(unit ^want) stop=? cor=_fine] ?. (lte fra.want fra) [`want & cor] @@ -4115,7 +4099,7 @@ =: tries.u.want +(tries.u.want) last-sent.u.want now == - =. wan.keen (cons:fi-mop wan.keen u.want) + =. wan.keen (put:fi-mop wan.keen [fra .]:u.want) (fi-send `@ux`hoot.u.want) -- :: +ga: constructor for |pump-gauge congestion control core @@ -4497,11 +4481,12 @@ |= old=keen-state-13 ^- keen-state =- old(wan wan) - %^ (dip-left:(deq want) ,[@ud wan=((mop @sd want) lth-wan)]) wan.old - [0 ~] - |= [[ix=@ud wan=((mop @sd want) lth-wan)] =want] - ^- [(unit ^want) ? @ud _wan] - [~ | +(ix) (put:((on @sd ^want) lth-wan) wan (sun:si ix) want)] + %^ (dip-left:(deq want) ,wan=((mop @ud want) lte)) + wan.old + ~ + |= [wan=((mop @ud want) lte) =want] + ^- [(unit ^want) ? _wan] + [~ | (put:((on @ud ^want) lte) wan [fra .]:want)] -- :: +scry: dereference namespace :: From ecaf70bc004e69182e41f47c1beb3dc44368c0d8 Mon Sep 17 00:00:00 2001 From: ~wicrum-wicrun <99811688+wicrum-wicrun@users.noreply.github.com> Date: Tue, 2 May 2023 16:26:59 +0200 Subject: [PATCH 38/49] ames,lull,zuse: move `+pha` and `+deq` into ames to not pollute kelvin code --- pkg/arvo/sys/lull.hoon | 24 --- pkg/arvo/sys/vane/ames.hoon | 241 ++++++++++++++++++++++++++++-- pkg/arvo/sys/zuse.hoon | 286 ------------------------------------ 3 files changed, 230 insertions(+), 321 deletions(-) diff --git a/pkg/arvo/sys/lull.hoon b/pkg/arvo/sys/lull.hoon index 8b4465e383..ed6e156c53 100644 --- a/pkg/arvo/sys/lull.hoon +++ b/pkg/arvo/sys/lull.hoon @@ -36,30 +36,6 @@ max-size=_2.048 depth=_1 == -:: -:: +afx: polymorphic node type for finger trees -:: -++ afx - |$ [val] - $% [%1 p=val ~] - [%2 p=val q=val ~] - [%3 p=val q=val r=val ~] - [%4 p=val q=val r=val s=val ~] - == -:: -:: +pha: finger tree -:: -:: DO NOT USE THIS -:: It's wrong and only kept around for state migration purposes. -:: -++ pha - |$ [val] - $~ [%nul ~] - $% [%nul ~] - [%one p=val] - [%big p=(afx val) q=(pha val) r=(afx val)] - == -:: :: +mop: constructs and validates ordered ordered map based on key, :: val, and comparator gate :: diff --git a/pkg/arvo/sys/vane/ames.hoon b/pkg/arvo/sys/vane/ames.hoon index 8f9e01c591..7b793053d0 100644 --- a/pkg/arvo/sys/vane/ames.hoon +++ b/pkg/arvo/sys/vane/ames.hoon @@ -813,16 +813,235 @@ keens=(map path keen-state-13) == :: -+$ keen-state-13 - $: wan=(pha want) :: request packts, sent - nex=(list want) :: request packets, unsent - hav=(list have) :: response packets, backward - num-fragments=@ud - num-received=@ud - next-wake=(unit @da) - listeners=(set duct) - metrics=pump-metrics - == +++ keen-state-13 + =< $: wan=(pha want) :: request packts, sent + nex=(list want) :: request packets, unsent + hav=(list have) :: response packets, backward + num-fragments=@ud + num-received=@ud + next-wake=(unit @da) + listeners=(set duct) + metrics=pump-metrics + == + |% + :: +afx: polymorphic node type for finger trees + :: + ++ afx + |$ [val] + $% [%1 p=val ~] + [%2 p=val q=val ~] + [%3 p=val q=val r=val ~] + [%4 p=val q=val r=val s=val ~] + == + :: +pha: finger tree + :: + :: DO NOT USE THIS + :: It's wrong and only kept around for state migration purposes. + :: + ++ pha + |$ [val] + $~ [%nul ~] + $% [%nul ~] + [%one p=val] + [%big p=(afx val) q=(pha val) r=(afx val)] + == + :: +deq: deque + :: + :: DO NOT USE THIS + :: It's wrong and only kept around for state migration purposes. + :: + ++ deq + |* val=mold + |% + :: + :: +| %utilities + :: + ++ make-afx + |= ls=(list val) + ?+ ls ~|(bad-finger/(lent ls) !!) + [* ~] [%1 ls] + [* * ~] [%2 ls] + [* * * ~] [%3 ls] + [* * * * ~] [%4 ls] + == + ++ afx-to-pha + |= =(afx val) + ^- (pha val) + (apl *(pha val) +.afx) + :: + :: +| %left-biased-operations + :: + :: +pop-left: remove leftmost value from tree + :: + ++ pop-left + |= a=(pha val) + ^- [val=(unit val) pha=(pha val)] + ?- -.a + %nul ~^a + :: + %one [`p.a nul/~] + :: + %big + [`p.p.a (big-left +.+.p.a q.a r.a)] + == + ++ apl + |= [a=(pha val) vals=(list val)] + ^- (pha val) + =. vals (flop vals) + |- + ?~ vals a + $(a (cons a i.vals), vals t.vals) + :: + :: + ++ dip-left + |* state=mold + |= $: a=(pha val) + =state + f=$-([state val] [(unit val) ? state]) + == + ^+ [state a] + =/ acc [stop=`?`%.n state=state] + =| new=(pha val) + |- + ?: stop.acc + :: cat new and old + [state.acc (weld a new)] + =^ val=(unit val) a + (pop-left a) + ?~ val + [state.acc new] + =^ res=(unit ^val) acc + (f state.acc u.val) + ?~ res $ + $(new (snoc new u.res)) + :: + ++ big-left + |= [ls=(list val) a=(pha val) sf=(afx val)] + ^- (pha val) + ?. =(~ ls) + [%big (make-afx ls) a sf] + =/ [val=(unit val) inner=_a] + (pop-left a) + ?~ val + (afx-to-pha sf) + [%big [%1 u.val ~] inner sf] + :: + ++ cons + =| b=(list val) + |= [a=(pha val) c=val] + ^- (pha val) + =. b [c b] + |- + ?~ b a + ?- -.a + :: + %nul + $(a [%one i.b], b t.b) + :: + %one + %= $ + b t.b + a [%big [%1 i.b ~] [%nul ~] [%1 p.a ~]] + == + :: + %big + ?. ?=(%4 -.p.a) + %= $ + b t.b + :: + a + ?- -.p.a + %1 big/[[%2 i.b p.p.a ~] q.a r.a] + %2 big/[[%3 i.b p.p.a q.p.a ~] q.a r.a] + %3 big/[[%4 i.b p.p.a q.p.a r.p.a ~] q.a r.a] + == + == + =/ inner + $(a q.a, b ~[s.p.a r.p.a q.p.a]) + =. inner + $(a inner, b t.b) + big/[[%2 i.b p.p.a ~] inner r.a] + == + :: + :: +| %right-biased-operations + :: + :: +snoc: append to end (right) of tree + :: + ++ snoc + |= [a=(pha val) b=val] + ^+ a + ?- -.a + %nul [%one b] + :: + %one + :- %big + :* [%1 p.a ~] + [%nul ~] + [%1 b ~] + == + :: + %big + ?- -.r.a + :: + %1 + :- %big + [p.a q.a [%2 p.r.a b ~]] + :: + %2 + :- %big + [p.a q.a [%3 p.r.a q.r.a b ~]] + :: + %3 + :- %big + [p.a q.a [%4 p.r.a q.r.a r.r.a b ~]] + :: + %4 + =/ inner + $(a q.a, b p.r.a) + =. inner + $(a inner, b q.r.a) + =. inner + $(a inner, b r.r.a) + :- %big + :* p.a + inner + [%2 s.r.a b ~] + == + == + == + :: +apr: append list to end (right) of tree + :: + ++ apr + |= [a=(pha val) vals=(list val)] + ^- (pha val) + ?~ vals a + $(a (snoc a i.vals), vals t.vals) + :: +| %manipulation + :: + :: +weld: concatenate two trees + :: + :: O(log n) + ++ weld + =| c=(list val) + |= [a=(pha val) b=(pha val)] + ^- (pha val) + ?- -.b + %nul (apr a c) + %one (snoc (apr a c) p.b) + :: + %big + ?- -.a + %nul (apl b c) + %one (cons (apl b c) p.a) + :: + %big + :- %big + =- [p.a - r.b] + $(a q.a, b q.b, c :(welp +.r.a c +.p.b)) + == + == + -- + -- :: $bug: debug printing configuration :: :: veb: verbosity toggles @@ -4481,7 +4700,7 @@ |= old=keen-state-13 ^- keen-state =- old(wan wan) - %^ (dip-left:(deq want) ,wan=((mop @ud want) lte)) + %^ (dip-left:(deq:keen-state-13 want) ,wan=((mop @ud want) lte)) wan.old ~ |= [wan=((mop @ud want) lte) =want] diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index 9d8b4ec1f0..166c6727b9 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5593,292 +5593,6 @@ $(pops [oldest pops]) -- -- -:: +deq: deque -:: -:: DO NOT USE THIS -:: It's wrong and only kept around for state migration purposes. -:: -++ deq - |* val=mold - |% - :: - :: +| %utilities - :: - ++ make-afx - |= ls=(list val) - ?+ ls ~|(bad-finger/(lent ls) !!) - [* ~] [%1 ls] - [* * ~] [%2 ls] - [* * * ~] [%3 ls] - [* * * * ~] [%4 ls] - == - :: - ++ wyt - |= a=(pha val) - ^- @ud - ?- -.a - %nul 0 - %one 1 - %big :(add (lent +.p.a) (lent +.r.a) $(a q.a)) - == - :: - ++ afx-to-pha - |= =(afx val) - ^- (pha val) - (apl *(pha val) +.afx) - :: - :: +| %left-biased-operations - :: - :: +pop-left: remove leftmost value from tree - :: - ++ pop-left - |= a=(pha val) - ^- [val=(unit val) pha=(pha val)] - ?- -.a - %nul ~^a - :: - %one [`p.a nul/~] - :: - %big - [`p.p.a (big-left +.+.p.a q.a r.a)] - == - :: - :: +peek-left: inspect leftmost value - :: - ++ peek-left - |= a=(pha val) - ^- (unit val) - ?- -.a - %nul ~ - %one `p.a - %big `p.p.a - == - :: - ++ apl - |= [a=(pha val) vals=(list val)] - ^- (pha val) - =. vals (flop vals) - |- - ?~ vals a - $(a (cons a i.vals), vals t.vals) - :: - :: - ++ dip-left - |* state=mold - |= $: a=(pha val) - =state - f=$-([state val] [(unit val) ? state]) - == - ^+ [state a] - =/ acc [stop=`?`%.n state=state] - =| new=(pha val) - |- - ?: stop.acc - :: cat new and old - [state.acc (weld a new)] - =^ val=(unit val) a - (pop-left a) - ?~ val - [state.acc new] - =^ res=(unit ^val) acc - (f state.acc u.val) - ?~ res $ - $(new (snoc new u.res)) - :: - ++ big-left - |= [ls=(list val) a=(pha val) sf=(afx val)] - ^- (pha val) - ?. =(~ ls) - [%big (make-afx ls) a sf] - =/ [val=(unit val) inner=_a] - (pop-left a) - ?~ val - (afx-to-pha sf) - [%big [%1 u.val ~] inner sf] - :: - ++ cons - =| b=(list val) - |= [a=(pha val) c=val] - ^- (pha val) - =. b [c b] - |- - ?~ b a - ?- -.a - :: - %nul - $(a [%one i.b], b t.b) - :: - %one - %= $ - b t.b - a [%big [%1 i.b ~] [%nul ~] [%1 p.a ~]] - == - :: - %big - ?. ?=(%4 -.p.a) - %= $ - b t.b - :: - a - ?- -.p.a - %1 big/[[%2 i.b p.p.a ~] q.a r.a] - %2 big/[[%3 i.b p.p.a q.p.a ~] q.a r.a] - %3 big/[[%4 i.b p.p.a q.p.a r.p.a ~] q.a r.a] - == - == - =/ inner - $(a q.a, b ~[s.p.a r.p.a q.p.a]) - =. inner - $(a inner, b t.b) - big/[[%2 i.b p.p.a ~] inner r.a] - == - :: - :: +| %right-biased-operations - :: - :: +snoc: append to end (right) of tree - :: - ++ snoc - |= [a=(pha val) b=val] - ^+ a - ?- -.a - %nul [%one b] - :: - %one - :- %big - :* [%1 p.a ~] - [%nul ~] - [%1 b ~] - == - :: - %big - ?- -.r.a - :: - %1 - :- %big - [p.a q.a [%2 p.r.a b ~]] - :: - %2 - :- %big - [p.a q.a [%3 p.r.a q.r.a b ~]] - :: - %3 - :- %big - [p.a q.a [%4 p.r.a q.r.a r.r.a b ~]] - :: - %4 - =/ inner - $(a q.a, b p.r.a) - =. inner - $(a inner, b q.r.a) - =. inner - $(a inner, b r.r.a) - :- %big - :* p.a - inner - [%2 s.r.a b ~] - == - == - == - :: +apr: append list to end (right) of tree - :: - ++ apr - |= [a=(pha val) vals=(list val)] - ^- (pha val) - ?~ vals a - $(a (snoc a i.vals), vals t.vals) - :: - :: +big-right: construct a tree, automatically balancing the right - :: side - ++ big-right - |= [pf=(afx val) a=(pha val) ls=(list val)] - ^- (pha val) - ?. =(~ ls) - [%big pf a (make-afx ls)] - =/ [val=(unit val) inner=_a] - (pop-right a) - ?~ val - (afx-to-pha pf) - [%big pf inner [%1 u.val ~]] - :: - :: +pop-right: remove rightmost value from tree - :: - ++ pop-right - |= a=(pha val) - ^- [val=(unit val) pha=(pha val)] - ?- -.a - %nul ~^a - :: - %one [`p.a nul/~] - :: - %big - =/ ls=(list val) +.r.a - =^ item ls (flop ls) - [`item (big-right p.a q.a (flop ls))] - == - :: - ++ peek-right - |= a=(pha val) - ?- -.a - %nul ~ - %one `p.a - %big (rear +.r.a) - == - :: - :: +| %manipulation - :: - :: +weld: concatenate two trees - :: - :: O(log n) - ++ weld - =| c=(list val) - |= [a=(pha val) b=(pha val)] - ^- (pha val) - ?- -.b - %nul (apr a c) - %one (snoc (apr a c) p.b) - :: - %big - ?- -.a - %nul (apl b c) - %one (cons (apl b c) p.a) - :: - %big - :- %big - =- [p.a - r.b] - $(a q.a, b q.b, c :(welp +.r.a c +.p.b)) - == - == - :: +tap: transform tree to list - :: - ++ tap - =| res=(list val) - |= a=(pha val) - !. - |^ ^+ res - ?- -.a - %nul ~ - %one ~[p.a] - :: - %big - =/ fst=_res - (tap-afx p.a) - =/ lst=_res - (tap-afx r.a) - =/ mid=_res - $(a q.a) - :(welp fst mid lst) - == - ++ tap-afx - |= ax=(afx val) - ^+ res - ?- -.ax - %1 +.ax - %2 +.ax - %3 +.ax - %4 +.ax - == - -- - -- :: :: :::: ++userlib :: (2u) non-vane utils :: :::: From 4a92c7d7d423d0b5f54d0f3fb19153ccea566157 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 2 May 2023 10:31:42 -0400 Subject: [PATCH 39/49] Revert "hoon: add doc parsing flag to +vang" This reverts commit 94ba9441887c8f57cc927cef89077a91d277ca11. --- pkg/arvo/app/dojo.hoon | 8 ++++---- pkg/arvo/sys/hoon.hoon | 11 +++-------- pkg/arvo/sys/vane/clay.hoon | 2 +- pkg/base-dev/lib/language-server/parser.hoon | 2 +- pkg/landscape/app/chat-cli.hoon | 2 +- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/pkg/arvo/app/dojo.hoon b/pkg/arvo/app/dojo.hoon index 49b2b7eab1..e9c6904aaf 100644 --- a/pkg/arvo/app/dojo.hoon +++ b/pkg/arvo/app/dojo.hoon @@ -118,7 +118,7 @@ |= [our=ship dir=beam] |% ++ default-app %hood - ++ hoon-parser (vang | (en-beam dir) &) + ++ hoon-parser (vang | (en-beam dir)) ++ our p.dir :: ++ parse-command-line ;~(sfix parse-command (star ace) (just '\0a')) @@ -309,7 +309,7 @@ ++ parse-rood :: XX should this use +hoon-parser instead to normalize the case? :: - => (vang | (en-beam dir) &) + => (vang | (en-beam dir)) ;~ pose rood :: @@ -1225,7 +1225,7 @@ :+ %clhp [%rock %tas %cx] %+ rash pax.source.com - rood:(vang | /(scot %p our.hid)/base/(scot %da now.hid) &) + rood:(vang | /(scot %p our.hid)/base/(scot %da now.hid)) :: %url [%ur (crip (en-purl:html url.source.com))] %api !! @@ -1256,7 +1256,7 @@ %hoon :* %do %+ rash code.source.com - tall:(vang | /(scot %p our.hid)/base/(scot %da now.hid) &) + tall:(vang | /(scot %p our.hid)/base/(scot %da now.hid)) $(num +(num), source.com next.source.com) == :: diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index 550959886e..a4afa0bba4 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -11422,14 +11422,9 @@ :: 5d: parser +| %parser :: -:: +vang: set +vast params -:: -:: bug: debug mode -:: wer: where we are -:: doc: doccord parsing -++ vang - |= [bug=? wer=path doc=?] - %*(. vast bug bug, wer wer, doc doc) +++ vang :: set ++vast params + |= [bug=? wer=path] :: bug: debug mode + %*(. vast bug bug, wer wer) :: wer: where we are :: ++ vast :: main parsing core =+ [bug=`?`| wer=*path doc=`?`&] diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 9b93a9073f..b443b59038 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -969,7 +969,7 @@ == :: %+ stag %tssg - (most gap tall:(vang & pax &)) + (most gap tall:(vang & pax)) == :: ++ pant diff --git a/pkg/base-dev/lib/language-server/parser.hoon b/pkg/base-dev/lib/language-server/parser.hoon index fc5d6b9e77..cf57790926 100644 --- a/pkg/base-dev/lib/language-server/parser.hoon +++ b/pkg/base-dev/lib/language-server/parser.hoon @@ -44,7 +44,7 @@ == :: %+ stag %tssg - (most gap tall:(vang & pax &)) + (most gap tall:(vang & pax)) == :: ++ pant diff --git a/pkg/landscape/app/chat-cli.hoon b/pkg/landscape/app/chat-cli.hoon index 18ff4f146d..a5aa5dee2c 100644 --- a/pkg/landscape/app/chat-cli.hoon +++ b/pkg/landscape/app/chat-cli.hoon @@ -683,7 +683,7 @@ |= tub=nail %. tub %+ stag (crip q.tub) - wide:(vang & [&1:% &2:% (scot %da now.bowl) |3:%] &) + wide:(vang & [&1:% &2:% (scot %da now.bowl) |3:%]) -- :: +tab-list: command descriptions :: From 1c26d431f562edff7b36f5b479110da17d930d1d Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 2 May 2023 10:31:49 -0400 Subject: [PATCH 40/49] hoon: threads doccords flags through +vang, compatibly --- pkg/arvo/sys/hoon.hoon | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index a4afa0bba4..6e5df34bd3 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -11422,9 +11422,15 @@ :: 5d: parser +| %parser :: -++ vang :: set ++vast params - |= [bug=? wer=path] :: bug: debug mode - %*(. vast bug bug, wer wer) :: wer: where we are +:: +vang: set +vast params +:: +:: bug: debug mode +:: doc: doccord parsing +:: wer: where we are +:: +++ vang + |= [f=$@(? [bug=? doc=?]) wer=path] + %*(. vast bug ?@(f f bug.f), doc ?@(f & doc.f), wer wer) :: ++ vast :: main parsing core =+ [bug=`?`| wer=*path doc=`?`&] From c03c3dc13be3d69cd69554265e44a0588ee14566 Mon Sep 17 00:00:00 2001 From: ~wicrum-wicrun <99811688+wicrum-wicrun@users.noreply.github.com> Date: Tue, 2 May 2023 17:01:53 +0200 Subject: [PATCH 41/49] ames: migration uses `+tap:deq` instead of `+dip-left:deq` --- pkg/arvo/sys/vane/ames.hoon | 401 +++++++++++++++++++----------------- 1 file changed, 214 insertions(+), 187 deletions(-) diff --git a/pkg/arvo/sys/vane/ames.hoon b/pkg/arvo/sys/vane/ames.hoon index 7b793053d0..f154de9ab5 100644 --- a/pkg/arvo/sys/vane/ames.hoon +++ b/pkg/arvo/sys/vane/ames.hoon @@ -853,193 +853,223 @@ ++ deq |* val=mold |% +:: :: +:: :: +| %utilities +:: :: +:: ++ make-afx +:: |= ls=(list val) +:: ?+ ls ~|(bad-finger/(lent ls) !!) +:: [* ~] [%1 ls] +:: [* * ~] [%2 ls] +:: [* * * ~] [%3 ls] +:: [* * * * ~] [%4 ls] +:: == +:: ++ afx-to-pha +:: |= =(afx val) +:: ^- (pha val) +:: (apl *(pha val) +.afx) +:: :: +:: :: +| %left-biased-operations +:: :: +:: :: +pop-left: remove leftmost value from tree +:: :: +:: ++ pop-left +:: |= a=(pha val) +:: ^- [val=(unit val) pha=(pha val)] +:: ?- -.a +:: %nul ~^a +:: :: +:: %one [`p.a nul/~] +:: :: +:: %big +:: [`p.p.a (big-left +.+.p.a q.a r.a)] +:: == +:: ++ apl +:: |= [a=(pha val) vals=(list val)] +:: ^- (pha val) +:: =. vals (flop vals) +:: |- +:: ?~ vals a +:: $(a (cons a i.vals), vals t.vals) +:: :: +:: :: +:: ++ dip-left +:: |* state=mold +:: |= $: a=(pha val) +:: =state +:: f=$-([state val] [(unit val) ? state]) +:: == +:: ^+ [state a] +:: =/ acc [stop=`?`%.n state=state] +:: =| new=(pha val) +:: |- +:: ?: stop.acc +:: :: cat new and old +:: [state.acc (weld a new)] +:: =^ val=(unit val) a +:: (pop-left a) +:: ?~ val +:: [state.acc new] +:: =^ res=(unit ^val) acc +:: (f state.acc u.val) +:: ?~ res $ +:: $(new (snoc new u.res)) +:: :: +:: ++ big-left +:: |= [ls=(list val) a=(pha val) sf=(afx val)] +:: ^- (pha val) +:: ?. =(~ ls) +:: [%big (make-afx ls) a sf] +:: =/ [val=(unit val) inner=_a] +:: (pop-left a) +:: ?~ val +:: (afx-to-pha sf) +:: [%big [%1 u.val ~] inner sf] +:: :: +:: ++ cons +:: =| b=(list val) +:: |= [a=(pha val) c=val] +:: ^- (pha val) +:: =. b [c b] +:: |- +:: ?~ b a +:: ?- -.a +:: :: +:: %nul +:: $(a [%one i.b], b t.b) +:: :: +:: %one +:: %= $ +:: b t.b +:: a [%big [%1 i.b ~] [%nul ~] [%1 p.a ~]] +:: == +:: :: +:: %big +:: ?. ?=(%4 -.p.a) +:: %= $ +:: b t.b +:: :: +:: a +:: ?- -.p.a +:: %1 big/[[%2 i.b p.p.a ~] q.a r.a] +:: %2 big/[[%3 i.b p.p.a q.p.a ~] q.a r.a] +:: %3 big/[[%4 i.b p.p.a q.p.a r.p.a ~] q.a r.a] +:: == +:: == +:: =/ inner +:: $(a q.a, b ~[s.p.a r.p.a q.p.a]) +:: =. inner +:: $(a inner, b t.b) +:: big/[[%2 i.b p.p.a ~] inner r.a] +:: == +:: :: +:: :: +| %right-biased-operations +:: :: +:: :: +snoc: append to end (right) of tree +:: :: +:: ++ snoc +:: |= [a=(pha val) b=val] +:: ^+ a +:: ?- -.a +:: %nul [%one b] +:: :: +:: %one +:: :- %big +:: :* [%1 p.a ~] +:: [%nul ~] +:: [%1 b ~] +:: == +:: :: +:: %big +:: ?- -.r.a +:: :: +:: %1 +:: :- %big +:: [p.a q.a [%2 p.r.a b ~]] +:: :: +:: %2 +:: :- %big +:: [p.a q.a [%3 p.r.a q.r.a b ~]] +:: :: +:: %3 +:: :- %big +:: [p.a q.a [%4 p.r.a q.r.a r.r.a b ~]] +:: :: +:: %4 +:: =/ inner +:: $(a q.a, b p.r.a) +:: =. inner +:: $(a inner, b q.r.a) +:: =. inner +:: $(a inner, b r.r.a) +:: :- %big +:: :* p.a +:: inner +:: [%2 s.r.a b ~] +:: == +:: == +:: == +:: :: +apr: append list to end (right) of tree +:: :: +:: ++ apr +:: |= [a=(pha val) vals=(list val)] +:: ^- (pha val) +:: ?~ vals a +:: $(a (snoc a i.vals), vals t.vals) +:: :: +| %manipulation +:: :: +:: :: +weld: concatenate two trees +:: :: +:: :: O(log n) +:: ++ weld +:: =| c=(list val) +:: |= [a=(pha val) b=(pha val)] +:: ^- (pha val) +:: ?- -.b +:: %nul (apr a c) +:: %one (snoc (apr a c) p.b) +:: :: +:: %big +:: ?- -.a +:: %nul (apl b c) +:: %one (cons (apl b c) p.a) +:: :: +:: %big +:: :- %big +:: =- [p.a - r.b] +:: $(a q.a, b q.b, c :(welp +.r.a c +.p.b)) +:: == +:: == + :: +tap: transform tree to list :: - :: +| %utilities - :: - ++ make-afx - |= ls=(list val) - ?+ ls ~|(bad-finger/(lent ls) !!) - [* ~] [%1 ls] - [* * ~] [%2 ls] - [* * * ~] [%3 ls] - [* * * * ~] [%4 ls] - == - ++ afx-to-pha - |= =(afx val) - ^- (pha val) - (apl *(pha val) +.afx) - :: - :: +| %left-biased-operations - :: - :: +pop-left: remove leftmost value from tree - :: - ++ pop-left + ++ tap + =| res=(list val) |= a=(pha val) - ^- [val=(unit val) pha=(pha val)] + !. + |^ ^+ res ?- -.a - %nul ~^a - :: - %one [`p.a nul/~] + %nul ~ + %one ~[p.a] :: %big - [`p.p.a (big-left +.+.p.a q.a r.a)] - == - ++ apl - |= [a=(pha val) vals=(list val)] - ^- (pha val) - =. vals (flop vals) - |- - ?~ vals a - $(a (cons a i.vals), vals t.vals) - :: - :: - ++ dip-left - |* state=mold - |= $: a=(pha val) - =state - f=$-([state val] [(unit val) ? state]) - == - ^+ [state a] - =/ acc [stop=`?`%.n state=state] - =| new=(pha val) - |- - ?: stop.acc - :: cat new and old - [state.acc (weld a new)] - =^ val=(unit val) a - (pop-left a) - ?~ val - [state.acc new] - =^ res=(unit ^val) acc - (f state.acc u.val) - ?~ res $ - $(new (snoc new u.res)) - :: - ++ big-left - |= [ls=(list val) a=(pha val) sf=(afx val)] - ^- (pha val) - ?. =(~ ls) - [%big (make-afx ls) a sf] - =/ [val=(unit val) inner=_a] - (pop-left a) - ?~ val - (afx-to-pha sf) - [%big [%1 u.val ~] inner sf] - :: - ++ cons - =| b=(list val) - |= [a=(pha val) c=val] - ^- (pha val) - =. b [c b] - |- - ?~ b a - ?- -.a - :: - %nul - $(a [%one i.b], b t.b) - :: - %one - %= $ - b t.b - a [%big [%1 i.b ~] [%nul ~] [%1 p.a ~]] - == - :: - %big - ?. ?=(%4 -.p.a) - %= $ - b t.b - :: - a - ?- -.p.a - %1 big/[[%2 i.b p.p.a ~] q.a r.a] - %2 big/[[%3 i.b p.p.a q.p.a ~] q.a r.a] - %3 big/[[%4 i.b p.p.a q.p.a r.p.a ~] q.a r.a] - == - == - =/ inner - $(a q.a, b ~[s.p.a r.p.a q.p.a]) - =. inner - $(a inner, b t.b) - big/[[%2 i.b p.p.a ~] inner r.a] + =/ fst=_res + (tap-afx p.a) + =/ lst=_res + (tap-afx r.a) + =/ mid=_res + $(a q.a) + :(welp fst mid lst) == - :: - :: +| %right-biased-operations - :: - :: +snoc: append to end (right) of tree - :: - ++ snoc - |= [a=(pha val) b=val] - ^+ a - ?- -.a - %nul [%one b] - :: - %one - :- %big - :* [%1 p.a ~] - [%nul ~] - [%1 b ~] + ++ tap-afx + |= ax=(afx val) + ^+ res + ?- -.ax + %1 +.ax + %2 +.ax + %3 +.ax + %4 +.ax == - :: - %big - ?- -.r.a - :: - %1 - :- %big - [p.a q.a [%2 p.r.a b ~]] - :: - %2 - :- %big - [p.a q.a [%3 p.r.a q.r.a b ~]] - :: - %3 - :- %big - [p.a q.a [%4 p.r.a q.r.a r.r.a b ~]] - :: - %4 - =/ inner - $(a q.a, b p.r.a) - =. inner - $(a inner, b q.r.a) - =. inner - $(a inner, b r.r.a) - :- %big - :* p.a - inner - [%2 s.r.a b ~] - == - == - == - :: +apr: append list to end (right) of tree - :: - ++ apr - |= [a=(pha val) vals=(list val)] - ^- (pha val) - ?~ vals a - $(a (snoc a i.vals), vals t.vals) - :: +| %manipulation - :: - :: +weld: concatenate two trees - :: - :: O(log n) - ++ weld - =| c=(list val) - |= [a=(pha val) b=(pha val)] - ^- (pha val) - ?- -.b - %nul (apr a c) - %one (snoc (apr a c) p.b) - :: - %big - ?- -.a - %nul (apl b c) - %one (cons (apl b c) p.a) - :: - %big - :- %big - =- [p.a - r.b] - $(a q.a, b q.b, c :(welp +.r.a c +.p.b)) - == - == + -- -- -- :: $bug: debug printing configuration @@ -4699,13 +4729,10 @@ ++ keen-state-13-to-14 |= old=keen-state-13 ^- keen-state - =- old(wan wan) - %^ (dip-left:(deq:keen-state-13 want) ,wan=((mop @ud want) lte)) - wan.old - ~ - |= [wan=((mop @ud want) lte) =want] - ^- [(unit ^want) ? _wan] - [~ | (put:((on @ud ^want) lte) wan [fra .]:want)] + =- old(wan -) + %+ gas:((on @ud want) lte) ~ + %+ turn (tap:(deq:keen-state-13 want) wan.old) + |= =want [fra .]:want -- :: +scry: dereference namespace :: From 99ca67db7f501fd87de6fc666a3a5c31e9f43621 Mon Sep 17 00:00:00 2001 From: ~wicrum-wicrun <99811688+wicrum-wicrun@users.noreply.github.com> Date: Tue, 2 May 2023 17:02:58 +0200 Subject: [PATCH 42/49] tests: remove defunct deq test --- tests/sys/lull/deq.hoon | 98 ----------------------------------------- 1 file changed, 98 deletions(-) delete mode 100644 tests/sys/lull/deq.hoon diff --git a/tests/sys/lull/deq.hoon b/tests/sys/lull/deq.hoon deleted file mode 100644 index e97cf94424..0000000000 --- a/tests/sys/lull/deq.hoon +++ /dev/null @@ -1,98 +0,0 @@ -/+ *test -=/ big-num - 100 -=/ de (deq ,@) -=/ big-list - (gulf 1 big-num) -=/ big - (apl:de *(pha @) big-list) -=/ foo-list (gulf 1 8) -|% -++ foo - (apl:de *(pha @) 1 2 3 4 5 6 7 8 ~) -++ bar - `(pha @)`(apl:de *(pha @) 8 9 10 11 12 13 14 15 ~) -:: -++ test-tap - =/ ls - ~> %bout.[1 %tap] - (tap:de big) - (expect-eq !>(ls) !>(big-list)) -:: -++ test-wyt - =/ le - ~> %bout.[1 %wyt] - (wyt:de big) - (expect-eq !>(le) !>(big-num)) -:: -++ test-left - ^- tang - =/ bar - ~> %bout.[1 %cons] - (cons:de bar 7) - =. bar - ~> %bout.[1 %apl] - (apl:de bar 1 2 3 4 5 6 ~) - %- zing - :- - ~> %bout.[1 %eq-1] - (expect-eq !>((tap:de bar)) !>((gulf 1 15))) - =^ val=(unit @) bar - ~> %bout.[1 %pop-left] - (pop-left:de bar) - ~> %bout.[1 %eq-2] - :~ (expect-eq !>(1) !>((need val))) - (expect-eq !>((gulf 2 15)) !>((tap:de bar))) - == -:: -++ test-cons-tree - =/ foo - (cons:de foo 1) - ~ -:: -++ test-cons-list - =/ big-list - [1 big-list] - ~ -:: -++ test-rear-tree - =/ big big - =/ res (peek-right:de big) - ~ -:: -++ test-rear-list - =/ last (rear big-list) - ~ -:: -++ test-right - ^- tang - =/ foo - ~> %bout.[1 %snoc] - (snoc:de foo 9) - =. foo - (apr:de foo 10 11 12 13 14 15 ~) - %- zing - :- (expect-eq !>((tap:de foo)) !>((gulf 1 15))) - =^ val=(unit @) foo - (pop-right:de foo) - :~ (expect-eq !>((need val)) !>(15)) - (expect-eq !>((gulf 1 14)) !>((tap:de foo))) - == -++ test-queue - ^- tang - =/ foo foo - =. foo - (apr:de foo 9 10 11 12 13 14 15 ~) - =/ expected (gulf 1 15) - %- zing - |- ^- (list tang) - =^ val=(unit @) foo - (pop-left:de foo) - ?~ val - (expect-eq !>(~) !>(expected))^~ - ~& got/u.val - ?~ expected - ~[leaf/"queue mismatch"] - :- (expect-eq !>(i.expected) !>(u.val)) - $(expected t.expected) --- From c1e14bdbf538e3f5d0bacfef84ed045ddbe784b1 Mon Sep 17 00:00:00 2001 From: ~wicrum-wicrun <99811688+wicrum-wicrun@users.noreply.github.com> Date: Tue, 2 May 2023 17:07:14 +0200 Subject: [PATCH 43/49] ames: use `+pry:mop` and `+del:mop` instead of virtualizing --- pkg/arvo/sys/vane/ames.hoon | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/vane/ames.hoon b/pkg/arvo/sys/vane/ames.hoon index f154de9ab5..2aa5a1fbff 100644 --- a/pkg/arvo/sys/vane/ames.hoon +++ b/pkg/arvo/sys/vane/ames.hoon @@ -4342,7 +4342,8 @@ =. peer-state (update-peer-route her peer-state) =. metrics.keen on-timeout:fi-gauge =^ want=(unit want) wan.keen - (fall (mole |.([`val.head rest]:(pop:fi-mop wan.keen))) `wan.keen) + ?~ res=(pry:fi-mop wan.keen) `wan.keen + (del:fi-mop wan.keen key.u.res) ~| %took-wake-for-empty-want ?> ?=(^ want) =: tries.u.want +(tries.u.want) From 451a84d4674a3170f2b34765121343f5674874d6 Mon Sep 17 00:00:00 2001 From: ~wicrum-wicrun <99811688+wicrum-wicrun@users.noreply.github.com> Date: Tue, 2 May 2023 17:36:22 +0200 Subject: [PATCH 44/49] jael: fake ships always have rift=0 --- pkg/arvo/sys/vane/jael.hoon | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/arvo/sys/vane/jael.hoon b/pkg/arvo/sys/vane/jael.hoon index 3f2047635f..4b93a005bf 100644 --- a/pkg/arvo/sys/vane/jael.hoon +++ b/pkg/arvo/sys/vane/jael.hoon @@ -336,7 +336,7 @@ =. pos.zim.pki %+ ~(put by pos.zim.pki) our - [rift=1 life=1 (my [`@ud`1 [`life`1 pub:ex:cub]] ~) `(^sein:title our)] + [rift=0 life=1 (my [`@ud`1 [`life`1 pub:ex:cub]] ~) `(^sein:title our)] :: our private key :: :: Private key updates are disallowed for fake ships, @@ -825,7 +825,7 @@ %+ turn passes |= [who=ship =pass] ^- [who=ship =point] - [who [rift=1 life=1 (my [1 1 pass] ~) `(^sein:title who)]] + [who [rift=0 life=1 (my [1 1 pass] ~) `(^sein:title who)]] =. moz [[hen %give %public-keys %full (my points)] moz] ..feel -- @@ -1140,10 +1140,10 @@ [~ ~] =/ who (slaw %p i.tyl) ?~ who [~ ~] - :: fake ships always have rift=1 + :: fake ships always have rift=0 :: ?: fak.own.pki.lex - ``[%atom !>(1)] + ``[%atom !>(0)] =/ pos (~(get by pos.zim.pki.lex) u.who) ?~ pos ~ ``[%atom !>(rift.u.pos)] @@ -1154,10 +1154,10 @@ [~ ~] =/ who (slaw %p i.tyl) ?~ who [~ ~] - :: fake ships always have rift=1 + :: fake ships always have rift=0 :: ?: fak.own.pki.lex - ``[%noun !>((some 1))] + ``[%noun !>((some 0))] =/ pos (~(get by pos.zim.pki.lex) u.who) ?~ pos ``[%noun !>(~)] ``[%noun !>((some rift.u.pos))] From 7f2257e581a7ad0fe0d57885e31f81425ae8f76d Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 2 May 2023 17:16:22 -0400 Subject: [PATCH 45/49] clay: virtualize parsing to workaround runaway memoization --- pkg/arvo/sys/vane/clay.hoon | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index fdce6a93cc..0cf03ada43 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -925,7 +925,9 @@ ~/ %parse-pile |= [pax=path tex=tape] ^- pile - =/ [=hair res=(unit [=pile =nail])] ((pile-rule pax) [1 1] tex) + =/ [=hair res=(unit [=pile =nail])] + %- road |. + ((pile-rule pax) [1 1] tex) ?^ res pile.u.res %- mean %- flop =/ lyn p.hair From 7fb2f613d43a500c881d393f6958b635c25c4019 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Wed, 3 May 2023 18:25:10 -0400 Subject: [PATCH 46/49] eyre: no-op on agent-error when missing connection state --- pkg/arvo/sys/vane/eyre.hoon | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/vane/eyre.hoon b/pkg/arvo/sys/vane/eyre.hoon index d45e587b6f..bf25603094 100644 --- a/pkg/arvo/sys/vane/eyre.hoon +++ b/pkg/arvo/sys/vane/eyre.hoon @@ -1986,7 +1986,10 @@ |= =tang ^- [(list move) server-state] :: - =+ connection=(~(got by connections.state) duct) + ?~ connection-state=(~(get by connections.state) duct) + %. `state + (trace 0 |.("{} error on invalid outstanding connection")) + =* connection u.connection-state =/ moves-1=(list move) ?. ?=(%app -.action.connection) ~ From 007a32c47a473dc6fb9eb04d1419335957400d9c Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Wed, 3 May 2023 18:25:48 -0400 Subject: [PATCH 47/49] eyre: remove redundant connection retrieval --- pkg/arvo/sys/vane/eyre.hoon | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/arvo/sys/vane/eyre.hoon b/pkg/arvo/sys/vane/eyre.hoon index bf25603094..e58636f760 100644 --- a/pkg/arvo/sys/vane/eyre.hoon +++ b/pkg/arvo/sys/vane/eyre.hoon @@ -2058,8 +2058,8 @@ (session-cookie-string u.session-id &) headers.response-header.http-event :: - =/ connection=outstanding-connection - (~(got by connections.state) duct) + =* connection u.connection-state + :: :: if the request was a simple cors request from an approved origin :: append the necessary cors headers to the response :: @@ -2078,7 +2078,7 @@ =. connections.state %- (trace 2 |.("{} start")) %+ ~(put by connections.state) duct - %_ connection + %= connection response-header `response-header bytes-sent ?~(data.http-event 0 p.u.data.http-event) == From c349d154b6081bedc1002f55743593fa8d3ca8f9 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Wed, 3 May 2023 18:39:19 -0400 Subject: [PATCH 48/49] eyre: optimizes responses, removes redundant connection state updates --- pkg/arvo/sys/vane/eyre.hoon | 38 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/pkg/arvo/sys/vane/eyre.hoon b/pkg/arvo/sys/vane/eyre.hoon index e58636f760..3f6759ee45 100644 --- a/pkg/arvo/sys/vane/eyre.hoon +++ b/pkg/arvo/sys/vane/eyre.hoon @@ -2076,6 +2076,11 @@ :: =. response-header.http-event response-header =. connections.state + ?: complete.http-event + :: XX optimize by not requiring +put:by in +request + :: + (~(del by connections.state) duct) + :: %- (trace 2 |.("{} start")) %+ ~(put by connections.state) duct %= connection @@ -2083,9 +2088,6 @@ bytes-sent ?~(data.http-event 0 p.u.data.http-event) == :: - =? state complete.http-event - log-complete-request - :: pass-response :: %continue @@ -2094,14 +2096,18 @@ (trace 0 |.("{} error continue without start")) :: =. connections.state - %- (trace 2 |.("{} continuing ")) - %+ ~(jab by connections.state) duct - |= connection=outstanding-connection - =+ size=?~(data.http-event 0 p.u.data.http-event) - connection(bytes-sent (add bytes-sent.connection size)) - :: - =? state complete.http-event - log-complete-request + ?: complete.http-event + %- (trace 2 |.("{} completed")) + (~(del by connections.state) duct) + :: + %- (trace 2 |.("{} continuing")) + ?~ data.http-event + connections.state + :: + %+ ~(put by connections.state) duct + =* size p.u.data.http-event + =* conn u.connection-state + conn(bytes-sent (add size bytes-sent.conn)) :: pass-response :: @@ -2115,16 +2121,6 @@ ^- [(list move) server-state] [[duct %give %response http-event]~ state] :: - ++ log-complete-request - :: todo: log the complete request - :: - :: remove all outstanding state for this connection - :: - =. connections.state - %. (~(del by connections.state) duct) - (trace 2 |.("{} completed")) - state - :: ++ error-connection :: todo: log application error :: From c42f1d26637cb2edce8200bb7fc1f7a14d0b0b9e Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Wed, 3 May 2023 18:40:22 -0400 Subject: [PATCH 49/49] eyre: corrects connection lifecycle comment --- pkg/arvo/sys/vane/eyre.hoon | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/vane/eyre.hoon b/pkg/arvo/sys/vane/eyre.hoon index 3f6759ee45..674e592171 100644 --- a/pkg/arvo/sys/vane/eyre.hoon +++ b/pkg/arvo/sys/vane/eyre.hoon @@ -656,7 +656,8 @@ =/ connection=outstanding-connection [action [authenticated secure address request] ~ 0] =. connections.state - :: XX pretty sure this is superfluous - done in +handle-response + :: NB: required by +handle-response. XX optimize + :: (~(put by connections.state) duct connection) :: redirect to https if insecure, redirects enabled :: and secure port live