From e8c5dd9806417cb819f745e7cbb99070c29b3351 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Mon, 19 Oct 2020 11:05:31 -0700 Subject: [PATCH 01/62] [hoon co] Fix float printer overuse of scientific notation I.e, print `.10` as `.10` not `.1e1`. Only use `e+-N` when it would be shorter. Before: ``` > (turn (gulf 1 10) |=(a=@u (turn (gulf 0 9) |=(b=@u (grd:rs d/[& -5 (mul (pow 10 a) +((pow 10 b)))]))))) ~[ ~[.2e-3 .1.1e-3 .1.01e-2 .1.001e-1 .1.0001 .1.00001e1 .1.000001e2 .1.0000001e3 .1e4 .1e5] ~[.2e-2 .1.1e-2 .1.01e-1 .1.001 .1.0001e1 .1.00001e2 .1.000001e3 .1.0000001e4 .1e5 .1e6] ~[.2e-1 .1.1e-1 .1.01 .1.001e1 .1.0001e2 .1.00001e3 .1.000001e4 .1.0000001e5 .1e6 .1e7] ~[.2 .1.1 .1.01e1 .1.001e2 .1.0001e3 .1.00001e4 .1.000001e5 .1.0000001e6 .1e7 .1e8] ~[.2e1 .1.1e1 .1.01e2 .1.001e3 .1.0001e4 .1.00001e5 .1.000001e6 .1.0000001e7 .1e8 .1e9] ~[.2e2 .1.1e2 .1.01e3 .1.001e4 .1.0001e5 .1.00001e6 .1.000001e7 .1.0000001e8 .1e9 .1e10] ~[.2e3 .1.1e3 .1.01e4 .1.001e5 .1.0001e6 .1.00001e7 .1.00000096e8 .1.0000001e9 .1e10 .1e11] ~[.2e4 .1.1e4 .1.01e5 .1.001e6 .1.0001e7 .1.00001e8 .1.000001e9 .1.0000001e10 .1e11 .1e12] ~[.2e5 .1.1e5 .1.01e6 .1.001e7 .1.0001e8 .1.00001e9 .1.000001e10 .1.0000001e11 .1e12 .1e13] ~[.2e6 .1.1e6 .1.01e7 .1.001e8 .1.00009997e9 .1.00001e10 .1.000001e11 .1.0000001e12 .1e13 .1e14] ] ``` After: ``` > (turn (gulf 1 10) |=(a=@u (turn (gulf 0 9) |=(b=@u (grd:rs d/[& -5 (mul (pow 10 a) +((pow 10 b)))]))))) ~[ ~[.2e-4 .1.1e-3 .0.0101 .0.1001 .1.0001 .10.0001 .100.0001 .1000.0001 .1e4 .1e5] ~[.2e-3 .0.011 .0.101 .1.001 .10.001 .100.001 .1000.001 .10000.001 .1e5 .1e6] ~[.0.02 .0.11 .1.01 .10.01 .100.01 .1000.01 .10000.01 .100000.01 .1e6 .1e7] ~[.0.2 .1.1 .10.1 .100.1 .1000.1 .10000.1 .100000.1 .1000000.1 .1e7 .1e8] ~[.2 .11 .101 .1001 .10001 .100001 .1000001 .10000001 .1e8 .1e9] ~[.20 .110 .1010 .10010 .100010 .1000010 .10000010 .100000010 .1e9 .1e10] ~[.200 .1100 .10100 .100100 .1000100 .10000100 .100000096 .1000000100 .1e10 .1e11] ~[.2e3 .1.1e4 .1.01e5 .1.001e6 .1.0001e7 .1.00001e8 .1.000001e9 .1.0000001e10 .1e11 .1e12] ~[.2e4 .1.1e5 .1.01e6 .1.001e7 .1.0001e8 .1.00001e9 .1.000001e10 .1.0000001e11 .1e12 .1e13] ~[.2e5 .1.1e6 .1.01e7 .1.001e8 .1000099970 .1.00001e10 .1.000001e11 .1.0000001e12 .1e13 .1e14] ] ``` --- pkg/arvo/sys/hoon.hoon | 43 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index b3602bfd4..43386d489 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -6024,17 +6024,17 @@ |= a/dn ?: ?=({$i *} a) (weld ?:(s.a "inf" "-inf") rep) ?: ?=({$n *} a) (weld "nan" rep) - =+ ^= e %+ ed-co [10 1] - |= {a/? b/@ c/tape} - ?: a [~(d ne b) '.' c] - [~(d ne b) c] - =+ ^= f - =>(.(rep ~) (e a.a)) - =. e.a (sum:si e.a (sun:si (dec +.f))) - =+ b=?:((syn:si e.a) "e" "e-") - => .(rep ?~(e.a rep (weld b ((d-co 1) (abs:si e.a))))) - => .(rep (weld -.f rep)) - ?:(s.a rep ['-' rep]) + =; rep ?:(s.a rep ['-' rep]) + =/ f ((d-co 1) a.a) + =^ e e.a + =/ e=@s (sun:si (lent f)) + =/ sci :(sum:si e.a e -1) + ?: (syn:si (dif:si e.a --3)) [--1 sci] :: 12000 -> 12e3 e>+2 + ?: !(syn:si (dif:si sci -2)) [--1 sci] :: 0.001 -> 1e-3 e<-2 + [(sum:si sci --1) --0] :: 1.234e2 -> '.'@3 -> 123 .4 + =? rep !=(--0 e.a) + :(weld ?:((syn:si e.a) "e" "e-") ((d-co 1) (abs:si e.a))) + (weld (ed-co e f) rep) :: ++ s-co |= esc/(list @) ^- tape @@ -6064,20 +6064,13 @@ == :: ++ ed-co - |= {{bas/@ min/@} par/$-({? @ tape} tape)} - =+ [fir=& cou=0] - |= hol/@ - ^- {tape @} - ?: &(=(0 hol) =(0 min)) - [rep cou] - =+ [rad=(mod hol bas) dar=(div hol bas)] - %= $ - min ?:(=(0 min) 0 (dec min)) - hol dar - rep (par &(=(0 dar) !fir) rad rep) - fir | - cou +(cou) - == + |= [exp=@s int=tape] ^- tape + =/ [pos=? dig=@u] [=(--1 (cmp:si exp --0)) (abs:si exp)] + ?. pos + (into (weld (reap +(dig) '0') int) 1 '.') + =/ len (lent int) + ?: (lth dig len) (into int dig '.') + (weld int (reap (sub dig len) '0')) :: ++ ox-co |= {{bas/@ gop/@} dug/$-(@ @)} From b55417a1c325eaf8eea5727e08ae268b40816306 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Fri, 5 Mar 2021 16:53:35 -0500 Subject: [PATCH 02/62] clay: remove +bunt from marks --- pkg/arvo/app/dojo.hoon | 2 +- pkg/arvo/lib/strandio.hoon | 2 +- pkg/arvo/sys/lull.hoon | 2 -- pkg/arvo/sys/vane/clay.hoon | 11 ++++------- pkg/arvo/tests/sys/vane/clay.hoon | 6 +++--- pkg/arvo/tests/sys/vane/eyre.hoon | 1 - 6 files changed, 9 insertions(+), 15 deletions(-) diff --git a/pkg/arvo/app/dojo.hoon b/pkg/arvo/app/dojo.hoon index 70e07d618..2252a3d01 100644 --- a/pkg/arvo/app/dojo.hoon +++ b/pkg/arvo/app/dojo.hoon @@ -875,7 +875,7 @@ %ge (dy-run-generator (dy-cage p.p.p.bil) q.p.bil) %sa =+ .^(=dais:clay cb+(en-beam he-beak /[p.bil])) - (dy-hand p.bil bunt:dais) + (dy-hand p.bil *vale:dais) :: %as =/ cag=cage (dy-cage p.q.bil) diff --git a/pkg/arvo/lib/strandio.hoon b/pkg/arvo/lib/strandio.hoon index a8b52ede1..9d8161d10 100644 --- a/pkg/arvo/lib/strandio.hoon +++ b/pkg/arvo/lib/strandio.hoon @@ -490,7 +490,7 @@ =/ m (strand ,vase) ^- form:m ;< =riot:clay bind:m - (warp ship desk ~ %sing %b case /[mak]) + (warp ship desk ~ %sing %e case /[mak]) ?~ riot (strand-fail %build-nave >arg< ~) ?> =(%nave p.r.u.riot) diff --git a/pkg/arvo/sys/lull.hoon b/pkg/arvo/sys/lull.hoon index 23d08ae5b..3a0e75297 100644 --- a/pkg/arvo/sys/lull.hoon +++ b/pkg/arvo/sys/lull.hoon @@ -955,7 +955,6 @@ $_ ^? |% - ++ bunt *typ ++ diff |~([old=typ new=typ] *dif) ++ form *mark ++ join |~([a=dif b=dif] *(unit (unit dif))) @@ -970,7 +969,6 @@ +$ dais $_ ^| |_ sam=vase - ++ bunt sam ++ diff |~(new=_sam *vase) ++ form *mark ++ join |~([a=vase b=vase] *(unit (unit vase))) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index af2f65303..a46282f52 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -559,7 +559,6 @@ =/ dif diff:deg ^- (nave typ dif) |% - ++ bunt +<.cor ++ diff |= [old=typ new=typ] ^- dif @@ -581,7 +580,6 @@ =/ dif _*diff:grad:cor ^- (nave:clay typ dif) |% - ++ bunt +<.cor ++ diff |=([old=typ new=typ] (diff:~(grad cor old) new)) ++ form form:grad:cor ++ join @@ -622,7 +620,6 @@ :_ nub ^- dais |_ sam=vase - ++ bunt (slap nav limb/%bunt) ++ diff |= new=vase (slam (slap nav limb/%diff) (slop sam new)) @@ -649,7 +646,7 @@ |= diff=vase (slam (slap nav limb/%pact) (slop sam diff)) ++ vale - |= =noun + |: noun=q:(slap nav !,(*hoon *vale)) (slam (slap nav limb/%vale) noun/noun) -- :: +build-cast: produce gate to convert mark .a to, statically typed @@ -2313,7 +2310,7 @@ =+ (slag (dec (lent path)) path) ?~(- %$ i.-) =/ =dais (get-dais mark) - =/ res=(unit (unit vase)) (~(join dais bunt:dais) q.cal q.cob) + =/ res=(unit (unit vase)) (~(join dais *vale:dais) q.cal q.cob) ?~ res `[form:dais q.cob] ?~ u.res @@ -3528,11 +3525,11 @@ [[~ ~] fod.dom] =/ cached=(unit [=vase *]) (~(get by naves.fod.dom) i.path) ?^ cached - :_(fod.dom [~ ~ %& %nave !>(vase.u.cached)]) + :_(fod.dom [~ ~ %& %nave vase.u.cached]) =^ =vase fod.dom %- wrap:fusion (build-nave:(ford:fusion static-ford-args) i.path) - :_(fod.dom [~ ~ %& %nave !>(vase)]) + :_(fod.dom [~ ~ %& %nave vase]) :: ++ read-f !. diff --git a/pkg/arvo/tests/sys/vane/clay.hoon b/pkg/arvo/tests/sys/vane/clay.hoon index 636efd3a3..5b201e627 100644 --- a/pkg/arvo/tests/sys/vane/clay.hoon +++ b/pkg/arvo/tests/sys/vane/clay.hoon @@ -112,7 +112,7 @@ ;: weld %+ expect-eq !>(*mime) - (slap res limb/%bunt) + (slap res !,(*hoon *vale)) :: %+ expect-eq !> (~(gas in *(set path)) /mar/mime/hoon ~) @@ -139,7 +139,7 @@ ;: weld %+ expect-eq !>(*@t) - (slap res limb/%bunt) + (slap res !,(*hoon *vale)) :: %+ expect-eq !> (~(gas in *(set path)) /mar/udon/hoon /lib/cram/hoon ~) @@ -170,7 +170,7 @@ =/ changes %- my :~ [/mar/mime/hoon &+hoon+mar-mime] - [/lib/foo/hoon &+hoon+'/% moo %mime\0abunt:moo'] + [/lib/foo/hoon &+hoon+'/% moo %mime\0a*vale:moo'] == =/ ford %: ford:fusion diff --git a/pkg/arvo/tests/sys/vane/eyre.hoon b/pkg/arvo/tests/sys/vane/eyre.hoon index 0b83d3a84..6710fa2ae 100644 --- a/pkg/arvo/tests/sys/vane/eyre.hoon +++ b/pkg/arvo/tests/sys/vane/eyre.hoon @@ -2353,7 +2353,6 @@ :^ ~ ~ %dais !> ^- dais:clay |_ sam=vase - ++ bunt !! ++ diff !! ++ form !! ++ join !! From f76a8b79111e7e627319582de7d5f2c28293deba Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Fri, 5 Mar 2021 17:44:40 -0500 Subject: [PATCH 03/62] pill: update solid --- bin/solid.pill | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/solid.pill b/bin/solid.pill index 65f89637d..82ae034f4 100644 --- a/bin/solid.pill +++ b/bin/solid.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ec80a42446a1d80974f32bf87283435547441cb7ea3fcd340711df2ce6cbec81 -size 9146390 +oid sha256:4c9d91a355b034f50de24c959b5f11751b1d75c92c6a9e26e7e22c865c773144 +size 9726392 From ef1b125c3ebe7b69cd2358920bea550dba4fb9a5 Mon Sep 17 00:00:00 2001 From: J Date: Fri, 12 Mar 2021 19:54:04 +0000 Subject: [PATCH 04/62] zuse: fix time fix regression Fixes #4598. #4474 made the JSON time conversion no longer invertible, which caused problems for chat, which uses message timestamp in milliseconds as a key -- so chat would send a message with ms timestamp x, it would get encoded as @da x, but then when it went back through the conversion to milliseconds, it would often (not always) get encoded as x-1. I still do not fully understand why this is -- and why it doesn't seem to be a problem with seconds based on cursory testing -- but integer multiplication and division generally do not invert. And adding a half a millisecond to the input date before converting it resolves the issue and makes the functions invertible. I added a regression test, so hopefully the next courageous adventurer who winds up here after wondering why +unm looks funny will have a safeguard against some of the mistakes I made. --- pkg/arvo/sys/zuse.hoon | 3 ++- pkg/arvo/tests/sys/zuse/format.hoon | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index eaf098937..14c34390d 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5535,7 +5535,8 @@ :: :: ++unm:chrono:userlib ++ unm :: Urbit to Unix ms |= a=@da - (div (mul (sub a ~1970.1.1) 1.000) ~s1) + =- (div (mul - 1.000) ~s1) + (sub (add a (div ~s1 2.000)) ~1970.1.1) :: :: ++unt:chrono:userlib ++ unt :: Urbit to Unix time |= a=@da diff --git a/pkg/arvo/tests/sys/zuse/format.hoon b/pkg/arvo/tests/sys/zuse/format.hoon index 8719ab241..a8ee826a4 100644 --- a/pkg/arvo/tests/sys/zuse/format.hoon +++ b/pkg/arvo/tests/sys/zuse/format.hoon @@ -179,6 +179,11 @@ %+ expect-eq !> [%n '1000'] !> (time ~1970.1.1..0.0.1) + :: timestamps should invert + :: + %+ expect-eq + !> [%n '1001'] + !> (time (from-unix-ms:chrono:userlib 1.001)) :: ship - store ship identity as a string :: %+ expect-eq From 549c5e5db9f999604d1d09667b458274a13494da Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Wed, 17 Mar 2021 14:21:58 -0700 Subject: [PATCH 05/62] hoon: update seminoun bunt to be fully blocked --- 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 834cbcf39..ed2e92fad 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -6627,7 +6627,7 @@ +$ seminoun :: partial noun; blocked subtrees are ~ :: - $~ [[%full ~] ~] + $~ [[%full / ~ ~] ~] [mask=stencil data=noun] :: :: +stencil: noun knowledge map From 19d5bd0de4228198b867d41c8d3b534bf6b49801 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 18 Mar 2021 17:04:08 -0700 Subject: [PATCH 06/62] ames: gate "fragment crashed" printf on msg.veb --- pkg/arvo/sys/vane/ames.hoon | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/arvo/sys/vane/ames.hoon b/pkg/arvo/sys/vane/ames.hoon index bd267477e..ccf31d062 100644 --- a/pkg/arvo/sys/vane/ames.hoon +++ b/pkg/arvo/sys/vane/ames.hoon @@ -1944,11 +1944,11 @@ =/ =bone bone.shut-packet :: ?: ?=(%& -.meat.shut-packet) - =+ ?~ dud ~ + =+ ?. &(?=(^ dud) msg.veb) ~ %. ~ - %+ slog - leaf+"ames: {} fragment crashed {}" - ?.(msg.veb ~ tang.u.dud) + %- slog + :_ tang.u.dud + leaf+"ames: {} fragment crashed {}" (run-message-sink bone %hear lane shut-packet ?=(~ dud)) :: Just try again on error, printing trace :: From 7b55097ef4c4703d960029ebc3b88c1959e000bb Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Sun, 28 Mar 2021 00:21:30 -0700 Subject: [PATCH 07/62] hoon: memoize rend:co We commonly print many names in a row, often the same ones. For example, on landscape's initial load, we send all the members of all the groups we're in, and there's substantial overlap. At least half the cost is in +fein, which is not currently jetted, but I believe there's an old jet in the git history. --- pkg/arvo/sys/hoon.hoon | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index 834cbcf39..e5298ea74 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -5455,9 +5455,10 @@ ~% %co ..co ~ =< |_ lot=coin ++ rear |=(rom=tape rend(rep rom)) - ++ rent `@ta`(rap 3 rend) + ++ rent ~+ `@ta`(rap 3 rend) ++ rend ^- tape + ~+ ?: ?=(%blob -.lot) ['~' '0' ((v-co 1) (jam p.lot))] ?: ?=(%many -.lot) From a1647a976712d4ba5d723fda5dc3d32feb288b82 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Sun, 28 Mar 2021 00:47:37 -0700 Subject: [PATCH 08/62] clay, eyre: add profiling hints --- pkg/arvo/sys/vane/clay.hoon | 4 ++++ pkg/arvo/sys/vane/eyre.hoon | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index af2f65303..55e3ea7af 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -3962,8 +3962,10 @@ ruf=raft :: revision tree == :: |= [now=@da eny=@uvJ rof=roof] :: current invocation +~% %clay-top ..part ~ |% :: ++ call :: handle request + ~/ %clay-call |= $: hen=duct dud=(unit goof) wrapped-task=(hobo task) @@ -4273,6 +4275,7 @@ -- :: ++ scry :: inspect + ~/ %clay-scry ^- roon |= [lyc=gang car=term bem=beam] ^- (unit (unit cage)) @@ -4334,6 +4337,7 @@ == :: ++ take :: accept response + ~/ %clay-take |= [tea=wire hen=duct dud=(unit goof) hin=sign] ^+ [*(list move) ..^$] ?^ dud diff --git a/pkg/arvo/sys/vane/eyre.hoon b/pkg/arvo/sys/vane/eyre.hoon index b509e7131..e878c6433 100644 --- a/pkg/arvo/sys/vane/eyre.hoon +++ b/pkg/arvo/sys/vane/eyre.hoon @@ -1597,6 +1597,7 @@ :: +channel-event-to-sign: attempt to recover a sign from a channel-event :: ++ channel-event-to-sign + ~% %eyre-channel-event-to-sign ..part ~ |= event=channel-event ^- (unit sign:agent:gall) ?. ?=(%fact -.event) `event @@ -1677,6 +1678,7 @@ == :: ++ event-json-to-wall + ~% %eyre-json-to-wall ..part ~ |= [event-id=@ud =json] ^- wall :~ (weld "id: " (format-ud-as-integer event-id)) @@ -2094,6 +2096,7 @@ ~% %http-server ..part ~ |% ++ call + ~/ %eyre-call |= [=duct dud=(unit goof) wrapped-task=(hobo task)] ^- [(list move) _http-server-gate] :: @@ -2296,6 +2299,7 @@ == :: ++ take + ~/ %eyre-take |= [=wire =duct dud=(unit goof) =sign] ^- [(list move) _http-server-gate] ?^ dud @@ -2483,6 +2487,7 @@ :: +scry: request a path in the urbit namespace :: ++ scry + ~/ %eyre-scry ^- roon |= [lyc=gang car=term bem=beam] ^- (unit (unit cage)) From a777567bb65b2ead63a6b8b08820dabc0e5ef792 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Sun, 28 Mar 2021 00:57:33 -0700 Subject: [PATCH 09/62] eyre: faster wain-to-octs conversion Avoid allocating hundreds of thousands of cells when giving large requests. This took the footprint of this function on initial landscape load from 1 second to 100 ms. --- pkg/arvo/sys/vane/eyre.hoon | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/sys/vane/eyre.hoon b/pkg/arvo/sys/vane/eyre.hoon index e878c6433..bc09d4dd0 100644 --- a/pkg/arvo/sys/vane/eyre.hoon +++ b/pkg/arvo/sys/vane/eyre.hoon @@ -425,10 +425,12 @@ :- ~ %- as-octs:mimes:html %- crip - %- zing + %- zing ^- ^wall + %- zing ^- (list ^wall) %+ turn wall |= t=tape - "{t}\0a" + ^- ^wall + ~[t "\0a"] :: +internal-server-error: 500 page, with a tang :: ++ internal-server-error From fda5e4b36139e1c2a7e8e17314c3cec39d838306 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Sun, 28 Mar 2021 00:59:08 -0700 Subject: [PATCH 10/62] zuse: hack enjs to speed up ship printing In +en-json, the vast majority of our time is in +jesc (json string escaping). Since ships will always be string-safe, we pretend they're numbers to bypass the escaper. This saves about a second on initial landscape load. --- pkg/arvo/sys/zuse.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index eaf098937..7ca6e825e 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -3286,7 +3286,7 @@ ++ ship :: string from ship |= a=^ship ^- json - (tape (slag 1 (scow %p a))) + [%n (rap 3 '"' (scot %p a) '"' ~)] :: :: ++numb:enjs:format ++ numb :: number from unsigned |= a=@u From 820aee04781b3f389efc262bbeae134a0abca2a2 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Sun, 28 Mar 2021 01:58:21 -0700 Subject: [PATCH 11/62] zuse: strip ~ from ships in enjs --- pkg/arvo/sys/zuse.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index 7ca6e825e..8f11ba359 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -3286,7 +3286,7 @@ ++ ship :: string from ship |= a=^ship ^- json - [%n (rap 3 '"' (scot %p a) '"' ~)] + [%n (rap 3 '"' (rsh [3 1] (scot %p a)) '"' ~)] :: :: ++numb:enjs:format ++ numb :: number from unsigned |= a=@u From 06faf0b13cfc931d8851d1e9fb94e438107bf136 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Wed, 31 Mar 2021 14:54:28 -0400 Subject: [PATCH 12/62] gall: print on missing request for ack --- pkg/arvo/sys/vane/gall.hoon | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index a48130787..690fa615e 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -646,6 +646,7 @@ :: cleared queue in +load 3-to-4 or +load-4-to-5 :: =? stand ?=(~ stand) + ~& [%gall-missing wire hen] (~(put to *(qeu remote-request)) %missing) ~| [full-wire=full-wire hen=hen stand=stand] =^ rr stand ~(get to stand) From 1ec5e5acfb5dc733886f0241558ffcd7456a07df Mon Sep 17 00:00:00 2001 From: fang Date: Wed, 7 Apr 2021 21:14:13 +0200 Subject: [PATCH 13/62] hoon: add +stap, path parser And cleans up a bunch of locally hand-written implementations of it. --- pkg/arvo/lib/language-server/parser.hoon | 4 ++-- pkg/arvo/sys/hoon.hoon | 5 ++--- pkg/arvo/sys/vane/clay.hoon | 4 ++-- pkg/arvo/sys/vane/eyre.hoon | 2 +- pkg/arvo/sys/zuse.hoon | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/pkg/arvo/lib/language-server/parser.hoon b/pkg/arvo/lib/language-server/parser.hoon index d4f5002fb..58e4b91b7 100644 --- a/pkg/arvo/lib/language-server/parser.hoon +++ b/pkg/arvo/lib/language-server/parser.hoon @@ -21,7 +21,7 @@ (most ;~(plug com gaw) taut-rule) :: %+ rune tis - ;~(plug sym ;~(pfix gap fas (more fas urs:ab))) + ;~(plug sym ;~(pfix gap stap)) :: %+ rune cen ;~(plug sym ;~(pfix gap ;~(pfix cen sym))) @@ -37,7 +37,7 @@ ;~ (glue gap) sym ;~(pfix cen sym) - ;~(pfix fas (more fas urs:ab)) + stap == :: %+ stag %tssg diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index 834cbcf39..d40777ca7 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -5965,9 +5965,8 @@ :: ++ spat |=(pax=path (crip (spud pax))) :: render path to cord ++ spud |=(pax=path ~(ram re (smyt pax))) :: render path to tape -++ stab :: parse cord to path - =+ fel=;~(pfix fas (more fas urs:ab)) - |=(zep=@t `path`(rash zep fel)) +++ stab |=(zep=@t `path`(rash zep stap)) :: parse cord to path +++ stap ;~(pfix fas (more fas urs:ab)) :: path parser :: :::: 4n: virtualization :: diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index af2f65303..5458e0026 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -869,7 +869,7 @@ (most ;~(plug com gaw) taut-rule) :: %+ rune tis - ;~(plug sym ;~(pfix gap fas (more fas urs:ab))) + ;~(plug sym ;~(pfix gap stap)) :: %+ rune cen ;~(plug sym ;~(pfix gap ;~(pfix cen sym))) @@ -885,7 +885,7 @@ ;~ (glue gap) sym ;~(pfix cen sym) - ;~(pfix fas (more fas urs:ab)) + ;~(pfix stap) == :: %+ stag %tssg diff --git a/pkg/arvo/sys/vane/eyre.hoon b/pkg/arvo/sys/vane/eyre.hoon index b509e7131..c83dac276 100644 --- a/pkg/arvo/sys/vane/eyre.hoon +++ b/pkg/arvo/sys/vane/eyre.hoon @@ -215,7 +215,7 @@ ?: =('subscribe' u.maybe-key) %. item %+ pe %subscribe - (ot id+ni ship+(su fed:ag) app+so path+(su ;~(pfix fas (more fas urs:ab))) ~) + (ot id+ni ship+(su fed:ag) app+so path+(su stap) ~) ?: =('unsubscribe' u.maybe-key) %. item %+ pe %unsubscribe diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index 14c34390d..9bdff8718 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -3458,7 +3458,7 @@ [(rash a fel) b] :: :: ++pa:dejs:format ++ pa :: string as path - (su ;~(pfix fas (more fas urs:ab))) + (su stap) :: :: ++pe:dejs:format ++ pe :: prefix |* [pre=* wit=fist] From 62d7281156dbe1b16db15551bfc431fa57b824b4 Mon Sep 17 00:00:00 2001 From: fang Date: Fri, 9 Apr 2021 01:49:14 +0200 Subject: [PATCH 14/62] clay: add /~ ford rune, as /= for directories Hoon files may want to import nouns from all files in a given directory. /~ lets you do so, importing as a (map @ta *) (but with typed values). Note the description as "directories" here, instead of "path prefix". The behavior, as implemented, will not include /path/hoon for /~ /path, instead only including /path/more/hoon and more deeply nested files. This seems to be, generally, the behavior you want, for example when importing from /app/myapp/* for /app/myapp/hoon. Actually using the resulting map requires some manual casting, which is not ideal. Some code style improvement work remains to be done as well. --- pkg/arvo/lib/language-server/parser.hoon | 3 + pkg/arvo/sys/lull.hoon | 2 + pkg/arvo/sys/vane/clay.hoon | 133 +++++++++++++++++++---- 3 files changed, 119 insertions(+), 19 deletions(-) diff --git a/pkg/arvo/lib/language-server/parser.hoon b/pkg/arvo/lib/language-server/parser.hoon index 58e4b91b7..d52e87219 100644 --- a/pkg/arvo/lib/language-server/parser.hoon +++ b/pkg/arvo/lib/language-server/parser.hoon @@ -22,6 +22,9 @@ :: %+ rune tis ;~(plug sym ;~(pfix gap stap)) + :: + %+ rune sig + ;~(plug sym ;~(pfix gap stap)) :: %+ rune cen ;~(plug sym ;~(pfix gap ;~(pfix cen sym))) diff --git a/pkg/arvo/sys/lull.hoon b/pkg/arvo/sys/lull.hoon index 23d08ae5b..c6b2eb114 100644 --- a/pkg/arvo/sys/lull.hoon +++ b/pkg/arvo/sys/lull.hoon @@ -928,6 +928,7 @@ :: /- sur-file :: surface imports from /sur :: /+ lib-file :: library imports from /lib :: /= face /path :: imports built hoon file at path + :: /~ face /path :: imports built hoon files from directory :: /% face %mark :: imports mark definition from /mar :: /$ face %from %to :: imports mark converter from /mar :: /* face %mark /path :: unbuilt file imports, as mark @@ -936,6 +937,7 @@ $: sur=(list taut) lib=(list taut) raw=(list [face=term =path]) + raz=(list [face=term =path]) maz=(list [face=term =mark]) caz=(list [face=term =mars]) bar=(list [face=term =mark =path]) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 5458e0026..406c17e21 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -118,11 +118,11 @@ :: Ford cache :: +$ ford-cache - $: files=(map path [res=vase dez=(set path)]) - naves=(map mark [res=vase dez=(set path)]) - marks=(map mark [res=dais dez=(set path)]) - casts=(map mars [res=vase dez=(set path)]) - tubes=(map mars [res=tube dez=(set path)]) + $: files=(map path [res=vase dez=(set [dir=? =path])]) + naves=(map mark [res=vase dez=(set [dir=? =path])]) + marks=(map mark [res=dais dez=(set [dir=? =path])]) + casts=(map mars [res=vase dez=(set [dir=? =path])]) + tubes=(map mars [res=tube dez=(set [dir=? =path])]) == :: $reef-cache: built system files :: @@ -428,18 +428,23 @@ :: ++ an |_ nak=ankh + :: +dug: produce ankh at path + :: + ++ dug + |= =path + ^- (unit ankh) + ?~ path `nak + ?~ kid=(~(get by dir.nak) i.path) + ~ + $(nak u.kid, path t.path) :: +get: produce file at path :: ++ get |= =path ^- (unit cage) - ?~ path - ?~ fil.nak - ~ - `q.u.fil.nak - ?~ kid=(~(get by dir.nak) i.path) - ~ - $(nak u.kid, path t.path) + ?~ nik=(dug path) ~ + ?~ fil.u.nik ~ + `q.u.fil.u.nik -- ++ with-face |=([face=@tas =vase] vase(p [%face face p.vase])) ++ with-faces @@ -472,7 +477,7 @@ +$ state $: baked=(map path cage) cache=ford-cache - stack=(list (set path)) + stack=(list (set [dir=? =path])) cycle=(set build) == +$ args @@ -493,8 +498,8 @@ :: +pop-stack: pop build stack, copying deps downward :: ++ pop-stack - ^- [(set path) _stack.nub] - =^ top=(set path) stack.nub stack.nub + ^- [(set [dir=? =path]) _stack.nub] + =^ top=(set [dir=? =path]) stack.nub stack.nub =? stack.nub ?=(^ stack.nub) stack.nub(i (~(uni in i.stack.nub) top)) [top stack.nub] @@ -524,6 +529,29 @@ ?< (~(has in deletes) path) ~| %file-not-found^path :_(nub (need (~(get an ankh) path))) + :: +list-directory: retrieve directory listing + :: + :: this excludes files directly at /path/mark, + :: instead only including files in the unix-style directory at /path, + :: such as /path/more/mark + :: + ++ list-directory + |= =path + ^- (list ^path) + =/ nuk=(unit _ankh) (~(dug an ankh) path) + ?~ nuk ~ + =| dep=@ud + |- + =; dir=(list ^path) + ?: |((lte dep 1) ?=(~ fil.u.nuk) (~(has in deletes) path)) + dir + [path dir] + %- zing + %+ turn + %+ sort ~(tap by dir.u.nuk) + |=([[a=@ *] [b=@ *]] (aor a b)) + |= [nom=@ta nak=_ankh] + ^$(u.nuk nak, path (snoc path nom), dep +(dep)) :: +build-nave: build a statically typed mark core :: ++ build-nave @@ -816,7 +844,7 @@ ?: (~(has in cycle.nub) file+path) ~|(cycle+file+path^stack.nub !!) =. cycle.nub (~(put in cycle.nub) file+path) - =. stack.nub [(sy path ~) stack.nub] + =. stack.nub [(sy [| path] ~) stack.nub] =^ cag=cage nub (read-file path) ?> =(%hoon p.cag) =/ tex=tape (trip !<(@t q.cag)) @@ -826,11 +854,43 @@ =. files.cache.nub (~(put by files.cache.nub) path [res top]) [res nub] :: + ++ build-directory + |= =path + ^- [(map ^path vase) state] + =/ paz=(list ^path) (list-directory path) + =| rez=(map ^path vase) + |- + ?~ paz + [rez nub] + =* pax i.paz + ?. =(%hoon (rear pax)) + $(paz t.paz) + :: + ::TODO deduplicate with +build-file + ?^ got=(~(get by files.cache.nub) pax) + =? stack.nub ?=(^ stack.nub) + stack.nub(i (~(uni in i.stack.nub) dez.u.got)) + $(paz t.paz, rez (~(put by rez) pax res.u.got)) + ?: (~(has in cycle.nub) file+pax) + ~|(cycle+file+pax^stack.nub !!) + =. cycle.nub (~(put in cycle.nub) file+pax) + =. stack.nub [(sy [& path] ~) stack.nub] + =^ cag=cage nub (read-file pax) + ?> =(%hoon p.cag) + =/ tex=tape (trip !<(@t q.cag)) + =/ =pile (parse-pile pax tex) + =^ res=vase nub (run-pile pile) + =^ top stack.nub pop-stack + =. files.cache.nub (~(put by files.cache.nub) pax [res top]) + :: + $(paz t.paz, rez (~(put by rez) pax res)) + :: ++ run-pile |= =pile =^ sut=vase nub (run-tauts bud %sur sur.pile) =^ sut=vase nub (run-tauts sut %lib lib.pile) =^ sut=vase nub (run-raw sut raw.pile) + =^ sut=vase nub (run-raz sut raz.pile) =^ sut=vase nub (run-maz sut maz.pile) =^ sut=vase nub (run-caz sut caz.pile) =^ sut=vase nub (run-bar sut bar.pile) @@ -870,6 +930,9 @@ :: %+ rune tis ;~(plug sym ;~(pfix gap stap)) + :: + %+ rune sig + ;~(plug sym ;~(pfix gap stap)) :: %+ rune cen ;~(plug sym ;~(pfix gap ;~(pfix cen sym))) @@ -931,6 +994,30 @@ =. p.pin [%face face.i.raw p.pin] $(sut (slop pin sut), raw t.raw) :: + ++ run-raz + |= [sut=vase raz=(list [face=term =path])] + ^- [vase state] + ?~ raz [sut nub] + =^ res=(map path vase) nub + (build-directory path.i.raz) + =; pin=vase + =. p.pin [%face face.i.raz p.pin] + $(sut (slop pin sut), raz t.raz) + :: convert the (map path vase) into a vase of (map @ta *), + :: with paths hyphenated into names and the .hoon cut off + :: + =/ lap=@ud (lent path.i.raz) + |- ^- vase + ?~ res [[%atom %n `0] 0] + %+ slop + %+ slop + :- [%atom %ta ~] + %+ rap 3 + %+ join '-' + (snip (slag lap p.n.res)) + q.n.res + (slop $(res l.res) $(res r.res)) + :: ++ run-maz |= [sut=vase maz=(list [face=term =mark])] ^- [vase state] @@ -1582,12 +1669,20 @@ :: ++ invalidate |* [key=mold value=mold] - |= [cache=(map key [value dez=(set path)]) invalid=(set path)] - =/ builds=(list [key value dez=(set path)]) ~(tap by cache) + |= [cache=(map key [value dez=(set [dir=? =path])]) invalid=(set path)] + =/ builds=(list [key value dez=(set [dir=? =path])]) + ~(tap by cache) |- ^+ cache ?~ builds ~ - ?: ?=(^ (~(int in dez.i.builds) invalid)) + ?: %+ lien ~(tap in dez.i.builds) + |= [dir=? =path] + ?. dir (~(has in invalid) path) + =+ l=(lent path) + %+ lien ~(tap in invalid) + |= i=^path + =+ j=(lent i) + &((gth j +(l)) =(path (scag l i))) $(builds t.builds) (~(put by $(builds t.builds)) i.builds) :: From 1411e08944aec2b505f2bc88459823b8ed71405d Mon Sep 17 00:00:00 2001 From: fang Date: Sat, 10 Apr 2021 01:59:26 +0200 Subject: [PATCH 15/62] clay: specify target type for /~ results Clay will nest-check the results and put a homogenous map into the subject. --- pkg/arvo/lib/language-server/parser.hoon | 2 +- pkg/arvo/sys/lull.hoon | 4 +-- pkg/arvo/sys/vane/clay.hoon | 31 +++++++++++++----------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/pkg/arvo/lib/language-server/parser.hoon b/pkg/arvo/lib/language-server/parser.hoon index d52e87219..cf5779092 100644 --- a/pkg/arvo/lib/language-server/parser.hoon +++ b/pkg/arvo/lib/language-server/parser.hoon @@ -24,7 +24,7 @@ ;~(plug sym ;~(pfix gap stap)) :: %+ rune sig - ;~(plug sym ;~(pfix gap stap)) + ;~((glue gap) sym wyde:vast stap) :: %+ rune cen ;~(plug sym ;~(pfix gap ;~(pfix cen sym))) diff --git a/pkg/arvo/sys/lull.hoon b/pkg/arvo/sys/lull.hoon index c6b2eb114..67854e6b1 100644 --- a/pkg/arvo/sys/lull.hoon +++ b/pkg/arvo/sys/lull.hoon @@ -928,7 +928,7 @@ :: /- sur-file :: surface imports from /sur :: /+ lib-file :: library imports from /lib :: /= face /path :: imports built hoon file at path - :: /~ face /path :: imports built hoon files from directory + :: /~ face type /path :: imports built hoon files from directory :: /% face %mark :: imports mark definition from /mar :: /$ face %from %to :: imports mark converter from /mar :: /* face %mark /path :: unbuilt file imports, as mark @@ -937,7 +937,7 @@ $: sur=(list taut) lib=(list taut) raw=(list [face=term =path]) - raz=(list [face=term =path]) + raz=(list [face=term =spec =path]) maz=(list [face=term =mark]) caz=(list [face=term =mars]) bar=(list [face=term =mark =path]) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 406c17e21..82f3d6fb0 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -932,7 +932,7 @@ ;~(plug sym ;~(pfix gap stap)) :: %+ rune sig - ;~(plug sym ;~(pfix gap stap)) + ;~((glue gap) sym wyde:vast stap) :: %+ rune cen ;~(plug sym ;~(pfix gap ;~(pfix cen sym))) @@ -995,7 +995,7 @@ $(sut (slop pin sut), raw t.raw) :: ++ run-raz - |= [sut=vase raz=(list [face=term =path])] + |= [sut=vase raz=(list [face=term =spec =path])] ^- [vase state] ?~ raz [sut nub] =^ res=(map path vase) nub @@ -1003,20 +1003,23 @@ =; pin=vase =. p.pin [%face face.i.raz p.pin] $(sut (slop pin sut), raz t.raz) - :: convert the (map path vase) into a vase of (map @ta *), - :: with paths hyphenated into names and the .hoon cut off :: =/ lap=@ud (lent path.i.raz) - |- ^- vase - ?~ res [[%atom %n `0] 0] - %+ slop - %+ slop - :- [%atom %ta ~] - %+ rap 3 - %+ join '-' - (snip (slag lap p.n.res)) - q.n.res - (slop $(res l.res) $(res r.res)) + =/ =type (~(play ut p.sut) [%kttr spec.i.raz]) + :: ensure results nest in the specified type, + :: and produce a homogenous map containing that type. + :: + :- %- ~(play ut p.sut) + [%kttr %make [%wing ~[%map]] ~[[%base %atom %ta] spec.i.raz]] + |- + ?~ res ~ + ~| [%nest-fail path.i.raz p.n.res] + ?> (~(nest ut type) | p.q.n.res) + :_ [$(res l.res) $(res r.res)] + :_ q.q.n.res + %+ rap 3 + %+ join '-' + (snip (slag lap p.n.res)) :: ++ run-maz |= [sut=vase maz=(list [face=term =mark])] From a45179412b8c166f07de2840273dd79e5f7ae423 Mon Sep 17 00:00:00 2001 From: fang Date: Sat, 10 Apr 2021 02:26:32 +0200 Subject: [PATCH 16/62] clay: for /~, only build top-level files This is semantically cleaner than arbitrary-depth recursion, and lets us stop worrying about hyphenated path conflicts. --- pkg/arvo/sys/vane/clay.hoon | 63 ++++++++++++++----------------------- 1 file changed, 24 insertions(+), 39 deletions(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 82f3d6fb0..25a906410 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -529,29 +529,6 @@ ?< (~(has in deletes) path) ~| %file-not-found^path :_(nub (need (~(get an ankh) path))) - :: +list-directory: retrieve directory listing - :: - :: this excludes files directly at /path/mark, - :: instead only including files in the unix-style directory at /path, - :: such as /path/more/mark - :: - ++ list-directory - |= =path - ^- (list ^path) - =/ nuk=(unit _ankh) (~(dug an ankh) path) - ?~ nuk ~ - =| dep=@ud - |- - =; dir=(list ^path) - ?: |((lte dep 1) ?=(~ fil.u.nuk) (~(has in deletes) path)) - dir - [path dir] - %- zing - %+ turn - %+ sort ~(tap by dir.u.nuk) - |=([[a=@ *] [b=@ *]] (aor a b)) - |= [nom=@ta nak=_ankh] - ^$(u.nuk nak, path (snoc path nom), dep +(dep)) :: +build-nave: build a statically typed mark core :: ++ build-nave @@ -853,24 +830,36 @@ =^ top stack.nub pop-stack =. files.cache.nub (~(put by files.cache.nub) path [res top]) [res nub] + :: +build-directory: builds files in top level of a directory + :: + :: this excludes files directly at /path/hoon, + :: instead only including files in the unix-style directory at /path, + :: such as /path/file/hoon, but not /path/more/file/hoon. :: ++ build-directory |= =path - ^- [(map ^path vase) state] - =/ paz=(list ^path) (list-directory path) - =| rez=(map ^path vase) + ^- [(map @ta vase) state] + =/ fiz=(list @ta) + =/ nuk=(unit _ankh) (~(dug an ankh) path) + ?~ nuk ~ + %+ murn + ~(tap by dir.u.nuk) + |= [nom=@ta nak=_ankh] + ?. ?=([~ [~ *] *] (~(get by dir.nak) %hoon)) ~ + `nom + :: + =| rez=(map @ta vase) |- - ?~ paz + ?~ fiz [rez nub] - =* pax i.paz - ?. =(%hoon (rear pax)) - $(paz t.paz) + =* nom=@ta i.fiz + =/ pax=^path (weld path nom %hoon ~) :: ::TODO deduplicate with +build-file ?^ got=(~(get by files.cache.nub) pax) =? stack.nub ?=(^ stack.nub) stack.nub(i (~(uni in i.stack.nub) dez.u.got)) - $(paz t.paz, rez (~(put by rez) pax res.u.got)) + $(fiz t.fiz, rez (~(put by rez) nom res.u.got)) ?: (~(has in cycle.nub) file+pax) ~|(cycle+file+pax^stack.nub !!) =. cycle.nub (~(put in cycle.nub) file+pax) @@ -883,7 +872,7 @@ =^ top stack.nub pop-stack =. files.cache.nub (~(put by files.cache.nub) pax [res top]) :: - $(paz t.paz, rez (~(put by rez) pax res)) + $(fiz t.fiz, rez (~(put by rez) nom res)) :: ++ run-pile |= =pile @@ -998,13 +987,12 @@ |= [sut=vase raz=(list [face=term =spec =path])] ^- [vase state] ?~ raz [sut nub] - =^ res=(map path vase) nub + =^ res=(map @ta vase) nub (build-directory path.i.raz) =; pin=vase =. p.pin [%face face.i.raz p.pin] $(sut (slop pin sut), raz t.raz) :: - =/ lap=@ud (lent path.i.raz) =/ =type (~(play ut p.sut) [%kttr spec.i.raz]) :: ensure results nest in the specified type, :: and produce a homogenous map containing that type. @@ -1015,11 +1003,8 @@ ?~ res ~ ~| [%nest-fail path.i.raz p.n.res] ?> (~(nest ut type) | p.q.n.res) - :_ [$(res l.res) $(res r.res)] - :_ q.q.n.res - %+ rap 3 - %+ join '-' - (snip (slag lap p.n.res)) + :- [p.n.res q.q.n.res] + [$(res l.res) $(res r.res)] :: ++ run-maz |= [sut=vase maz=(list [face=term =mark])] From 8b4dba28fae87067b54f6db63d099d056d89ba73 Mon Sep 17 00:00:00 2001 From: fang Date: Sat, 10 Apr 2021 16:22:52 +0200 Subject: [PATCH 17/62] clay: update dependency logic for /~ imports To match recent changes to the build logic, where it only includes top-level hoon files. --- pkg/arvo/sys/vane/clay.hoon | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 25a906410..a0493f758 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -1669,8 +1669,7 @@ =+ l=(lent path) %+ lien ~(tap in invalid) |= i=^path - =+ j=(lent i) - &((gth j +(l)) =(path (scag l i))) + &(=(path (scag l i)) ?=([@ %hoon ~] (slag l i))) $(builds t.builds) (~(put by $(builds t.builds)) i.builds) :: From 0570fb5b768057ad19f664e24fe0b7ad5eb85e6d Mon Sep 17 00:00:00 2001 From: fang Date: Mon, 12 Apr 2021 13:10:36 +0200 Subject: [PATCH 18/62] clay: share logic between build-file and directory By factoring their shared logic out into +build-dependency, which gets passed the relevant details about how to track the file being built in the dependency stack. --- pkg/arvo/sys/vane/clay.hoon | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index a0493f758..3ca9057d0 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -810,9 +810,11 @@ =^ res=vase nub (run-pile pile) res :: - ++ build-file - |= =path + ++ build-dependency + |= dep=(each [dir=path fil=path] path) ^- [vase state] + =/ =path + ?:(?=(%| -.dep) p.dep fil.p.dep) ~| %error-building^path ?^ got=(~(get by files.cache.nub) path) =? stack.nub ?=(^ stack.nub) @@ -821,7 +823,9 @@ ?: (~(has in cycle.nub) file+path) ~|(cycle+file+path^stack.nub !!) =. cycle.nub (~(put in cycle.nub) file+path) - =. stack.nub [(sy [| path] ~) stack.nub] + =. stack.nub + =- [(sy - ~) stack.nub] + ?:(?=(%| -.dep) dep [& dir.p.dep]) =^ cag=cage nub (read-file path) ?> =(%hoon p.cag) =/ tex=tape (trip !<(@t q.cag)) @@ -830,6 +834,10 @@ =^ top stack.nub pop-stack =. files.cache.nub (~(put by files.cache.nub) path [res top]) [res nub] + :: + ++ build-file + |= =path + (build-dependency |+path) :: +build-directory: builds files in top level of a directory :: :: this excludes files directly at /path/hoon, @@ -854,24 +862,7 @@ [rez nub] =* nom=@ta i.fiz =/ pax=^path (weld path nom %hoon ~) - :: - ::TODO deduplicate with +build-file - ?^ got=(~(get by files.cache.nub) pax) - =? stack.nub ?=(^ stack.nub) - stack.nub(i (~(uni in i.stack.nub) dez.u.got)) - $(fiz t.fiz, rez (~(put by rez) nom res.u.got)) - ?: (~(has in cycle.nub) file+pax) - ~|(cycle+file+pax^stack.nub !!) - =. cycle.nub (~(put in cycle.nub) file+pax) - =. stack.nub [(sy [& path] ~) stack.nub] - =^ cag=cage nub (read-file pax) - ?> =(%hoon p.cag) - =/ tex=tape (trip !<(@t q.cag)) - =/ =pile (parse-pile pax tex) - =^ res=vase nub (run-pile pile) - =^ top stack.nub pop-stack - =. files.cache.nub (~(put by files.cache.nub) pax [res top]) - :: + =^ res nub (build-dependency &+[path pax]) $(fiz t.fiz, rez (~(put by rez) nom res)) :: ++ run-pile From 2f0ed36101f9e89714f1adc59e6a34b83b65fefa Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Mon, 19 Apr 2021 15:09:52 -0500 Subject: [PATCH 19/62] zuse: add +all and +run to ++ordered-map --- pkg/arvo/sys/zuse.hoon | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index 9bdff8718..f826cc1e7 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5296,6 +5296,23 @@ ?~ a b :: $(a r.a, b [n.a $(a l.a)]) + :: +run: apply gate to transform all values in place + :: without modifying their type + :: + ++ run + |= [a=(tree item) b=$-(val val)] + |- ^+ a + ?~ a a + [n=[key.n.a (b val.n.a)] l=$(a l.a) r=$(a r.a)] + :: +all: apply logical AND boolean test on all values + :: + ++ all + |= [a=(tree item) b=$-(item ?)] + ^- ? + |- + ?~ a + & + ?&((b n.a) $(a l.a) $(a r.a)) :: +gas: put a list of items :: ++ gas From b2e1008d9add7e5c2b263e247c9814469ca96351 Mon Sep 17 00:00:00 2001 From: raghu <{ID}+{username}@users.noreply.github.com> Date: Mon, 19 Apr 2021 23:46:46 -0400 Subject: [PATCH 20/62] clay: add %fuse --- .gitignore | 7 +- Makefile | 3 + bin/brass.pill | 4 +- bin/ivory.pill | 4 +- bin/solid.pill | 4 +- pkg/arvo/gen/hood/fuse.hoon | 12 ++ pkg/arvo/gen/hood/fuse/help.txt | 8 + pkg/arvo/lib/hood/kiln.hoon | 9 + pkg/arvo/sys/lull.hoon | 4 + pkg/arvo/sys/vane/clay.hoon | 311 +++++++++++++++++++++++++++----- 10 files changed, 315 insertions(+), 51 deletions(-) create mode 100644 pkg/arvo/gen/hood/fuse.hoon create mode 100644 pkg/arvo/gen/hood/fuse/help.txt diff --git a/.gitignore b/.gitignore index e79759dc6..d2c66c945 100644 --- a/.gitignore +++ b/.gitignore @@ -76,4 +76,9 @@ pkg/interface/link-webext/web-ext-artifacts *.xz # Logs -*.log \ No newline at end of file +*.log + +backup* +notes +bel +wex diff --git a/Makefile b/Makefile index a06eac1c8..fd3eaf12b 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,9 @@ pills: sh/update-brass-pill sh/update-ivory-pill +solid: + sh/update-solid-pill + ropsten-pills: sh/create-ropsten-pills diff --git a/bin/brass.pill b/bin/brass.pill index f549dac58..4f5af448a 100644 --- a/bin/brass.pill +++ b/bin/brass.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:61e583dd7db795dac4a7c31bfd3ee8b240e679bb882e35d4e7d1acb5f9f2f3d6 -size 8270131 +oid sha256:2d45514e6ebb8345911137a03980e709c8ea0c28b14b770a24a51190db7c8ed2 +size 8215365 diff --git a/bin/ivory.pill b/bin/ivory.pill index 7c2e8e474..ae03a26b9 100644 --- a/bin/ivory.pill +++ b/bin/ivory.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:185ea5e76dc48695e55efc543377e0682e485f81b16e3b443f9be881d026d4f2 -size 2616564 +oid sha256:b9807f664c9b4f6d6ce92c10f2959f28ad6e48a24a880556f828d3cf0cad2ee9 +size 4537425 diff --git a/bin/solid.pill b/bin/solid.pill index 92802fcdd..aaeb0a4d2 100644 --- a/bin/solid.pill +++ b/bin/solid.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bb221ce7316346bfaf1ddd953927c0f2afe7eaf5b160bed545f67ec7e5ccb005 -size 9410487 +oid sha256:1ddeef9bf39394ff9c19a0d66c9fc45d218e4891dbd152f8f7696f8c0fa9747e +size 9877817 diff --git a/pkg/arvo/gen/hood/fuse.hoon b/pkg/arvo/gen/hood/fuse.hoon new file mode 100644 index 000000000..39bf9f74c --- /dev/null +++ b/pkg/arvo/gen/hood/fuse.hoon @@ -0,0 +1,12 @@ +:: Kiln: Fuse local desk from (optionally-)foreign sources +:: +:::: /hoon/fuse/hood/gen + :: +/* help-text %txt /gen/hood/fuse/help/txt +=, clay +:: +:::: + :: +:- %say +|= [[now=@da eny=@uvJ bec=beak] [des=desk srcs=(list [beak germ]) ~] ~] +[%kiln-fuse des srcs] diff --git a/pkg/arvo/gen/hood/fuse/help.txt b/pkg/arvo/gen/hood/fuse/help.txt new file mode 100644 index 000000000..32431f5cd --- /dev/null +++ b/pkg/arvo/gen/hood/fuse/help.txt @@ -0,0 +1,8 @@ +Usage: + + |fuse %destination-desk ~[[source-beak %some-germ] [another-beak %another-germ]] + +A fuse replaces the contents of %destination-desk with the merge of the +specified beaks according to their merge strategies. This has no dependence +on the previous state of %destination-desk so any commits/work there will +be overwritten. diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index 0e7f719eb..167750360 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -55,6 +55,10 @@ cas=case :: gim=?(%auto germ) :: == ++$ kiln-fuse + $: syd=desk + srcs=(list [beak germ]) + == -- |= [bowl:gall state] ?> =(src our) @@ -381,6 +385,10 @@ ?~ +< abet abet:abet:(merge:(work syd) ali sud cas gim) :: +++ poke-fuse + |= k=kiln-fuse + abet:(emit [%pass /kiln/fuse/[syd.k] %arvo %c [%fuse syd.k srcs.k]]) +:: ++ poke-cancel |= a=@tas abet:(emit %pass /cancel %arvo %c [%drop a]) @@ -430,6 +438,7 @@ %kiln-info =;(f (f !<(_+<.f vase)) poke-info) %kiln-label =;(f (f !<(_+<.f vase)) poke-label) %kiln-merge =;(f (f !<(_+<.f vase)) poke-merge) + %kiln-fuse =;(f (f !<(_+<.f vase)) poke-fuse) %kiln-mount =;(f (f !<(_+<.f vase)) poke-mount) %kiln-ota =;(f (f !<(_+<.f vase)) poke:update) %kiln-ota-info =;(f (f !<(_+<.f vase)) poke-ota-info) diff --git a/pkg/arvo/sys/lull.hoon b/pkg/arvo/sys/lull.hoon index 23d08ae5b..e91d88935 100644 --- a/pkg/arvo/sys/lull.hoon +++ b/pkg/arvo/sys/lull.hoon @@ -762,6 +762,10 @@ her=@p dem=desk cas=case :: source how=germ :: method == :: + $: %fuse :: mega merge + des=desk :: target desk + srcs=(list [beak germ]) :: sources + == [%mont pot=term bem=beam] :: mount to unix [%dirk des=desk] :: mark mount dirty [%ogre pot=$@(desk beam)] :: delete mount point diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index af2f65303..09130e815 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -58,6 +58,9 @@ :: when the request is filled/updated. :: +$ cult (jug wove duct) +:: State for ongoing %fuse merges - the list maintains the ordering +:: and the map stores the data needed to merge ++$ melt [(list [beak germ]) (map [beak germ] (unit dome:clay))] :: :: Domestic desk state. :: @@ -69,6 +72,7 @@ dom=dome :: desk state per=regs :: read perms per path pew=regs :: write perms per path + fiz=melt :: state for mega merges == :: :: Desk state. @@ -212,6 +216,7 @@ dom=dome :: revision state per=regs :: read perms per path pew=regs :: write perms per path + fiz=melt :: domestic mega merges == :: :: :: Foreign request manager. @@ -303,6 +308,7 @@ $: %c :: to %clay $> $? %info :: internal edit %merg :: merge desks + %fuse :: mega merge %pork :: %warp :: %werp :: @@ -1043,12 +1049,12 @@ ~ =/ rus rus:(~(gut by hoy.ruf) her *rung) %+ ~(gut by rus) syd - [lim=~2000.1.1 ref=`*rind qyx=~ dom=*dome per=~ pew=~] + [lim=~2000.1.1 ref=`*rind qyx=~ dom=*dome per=~ pew=~ fiz=[~ ~]] :: administrative duct, domestic +rede :: :+ ~ `hun.rom.ruf =/ jod (~(gut by dos.rom.ruf) syd *dojo) - [lim=now ref=~ [qyx dom per pew]:jod] + [lim=now ref=~ [qyx dom per pew fiz]:jod] :: =* red=rede ->+ |% @@ -1065,7 +1071,7 @@ :: %= ruf hun.rom (need hun) - dos.rom (~(put by dos.rom.ruf) syd [qyx dom per pew]:red) + dos.rom (~(put by dos.rom.ruf) syd [qyx dom per pew fiz]:red) == :: :: Handle `%sing` requests @@ -1962,32 +1968,167 @@ =/ =wire /merge/[syd]/(scot %p ali-ship)/[ali-desk]/[germ] (emit hen %pass wire %c %warp ali-ship ali-desk `[%sing %v case /]) :: + ++ make-melt + |= srcs=(list [beak germ]) + ^- melt + :- srcs + %- ~(gas by *(map [beak germ] (unit dome:clay))) + (turn srcs |=(a=[beak germ] [a *(unit dome:clay)])) + :: + ++ start-fuse + |= [srcs=(list [beak germ])] + ^+ ..start-fuse + :: use emil here to queue a list of moves + :: syd is current desk (target desk) + :: what is hen? it's the current duct... can this be reused? + =/ moves=(list move) + %+ turn + srcs + |= [bec=beak g=germ] + ^- move + =/ wir=wire /fuse/[syd]/(scot %p p.bec)/[q.bec]/(scot r.bec)/[g] + [hen %pass wir %c %warp p.bec q.bec `[%sing %v r.bec /]] + :: we also want to clear the state (fiz) associated with this + :: merge and print a warning if it's non trivial i.e. we're + :: starting a new fuse before the previous one terminated. + ~& ?~ -.fiz + [%starting-fuse srcs] + :^ %starting-fuse srcs %discarding-state + :: we don't want to ~& an entire dome + %- ~(run by +.fiz) + |=(v=(unit dome:clay) ?~(v %not-received %recieved)) + =. fiz (make-melt srcs) + (emil moves) + :: + ++ take-fuse + |= [[bec=beak g=germ] =riot] + ^+ ..take-fuse + ?~ riot + ~& [%fuse-for syd %missing bec] + :: by setting fiz to *melt the merge is aborted - any further + :: responses we get for the merge will cause take-fuse to crash + =. fiz *melt + ..take-fuse + ?> (~(has by +.fiz) [bec g]) + =. fiz + :- -.fiz + (~(put by +.fiz) [bec g] `!<(dome:clay q.r.u.riot)) + =/ all-done=flag + %- ~(all by +.fiz) + |= res=(unit dome:clay) + ^- flag + !=(res ~) + ?. all-done + ..take-fuse + :: do the merge + =/ merges=(list [beak germ]) -.fiz + :: there's no point to an empty fuse and a single element fuse + :: should just be an %only-that merge. + ?> (gte (lent merges) 2) + =| rag=rang + =/ clean-hut-ran hut.ran + =/ initial-dome=dome:clay (need (~(got by +.fiz) (snag 0 merges))) + =/ continuation-yaki=yaki + (~(got by hut.ran) (~(got by hit.initial-dome) let.initial-dome)) + =/ parents=(list tako) ~[(~(got by hit.initial-dome) let.initial-dome)] + =. merges (slag 1 merges) + |- + ^+ ..take-fuse + ?~ merges + :: reset fiz before potentially parking - we hope to + :: succeed so we don't need this state anymore. + =. fiz *melt + =. hut.ran clean-hut-ran + (park | [%| continuation-yaki(p (flop parents))] rag) + =/ [bec=beak g=germ] i.merges + =/ ali-dom=dome:clay (need (~(got by +.fiz) bec g)) + =/ result (merge-helper p.bec q.bec g ali-dom `continuation-yaki) + ?- -.result + %| + :: merge failed + (mean %fuse-merge-failed p.result) + :: + %& + :: now we have a unit merge-result + =/ merge-result=(unit merge-result) +.result + ?~ merge-result + :: this merge was a no-op, just continue + $(merges t.merges) + ?~ conflicts.u.merge-result + :: no merge conflicts + =/ merged-yaki=yaki + ?- -.new.u.merge-result + %| + +.new.u.merge-result + :: + %& + :: convert the yuki to yaki + =/ yuk=yuki +.new.u.merge-result + =/ lobes=(map path lobe) + %- ~(run by q.yuk) + |= val=(each page lobe) + ^- lobe + ?- -.val + %& (page-to-lobe +.val) + %| +.val + == + (make-yaki p.yuk lobes now) + == + %= $ + continuation-yaki merged-yaki + merges t.merges + hut.ran (~(put by hut.ran) r.merged-yaki merged-yaki) + lat.rag (~(uni by lat.rag) lat.u.merge-result) + parents [(~(got by hit.ali-dom) let.ali-dom) parents] + == + :: if there are merge conflicts send the error and abort the merge + =. fiz *melt + (done %& conflicts.u.merge-result) + == + :: + ++ done + |= result=(each (set path) (pair term tang)) + ^+ ..merge + (emit hen %give %mere result) + :: ++ merge |= [=ali=ship =ali=desk =germ =riot] ^+ ..merge - |^ ?~ riot - (done %| %ali-unavailable >[ali-ship ali-desk germ]< ~) + (done %| %ali-unavailable ~[>[ali-ship ali-desk germ]<]) =/ ali-dome=dome:clay !<(dome:clay q.r.u.riot) + =/ result=(each (unit merge-result) (pair term tang)) + (merge-helper ali-ship ali-desk germ ali-dome ~) + ?- -.result + %| + (done %| +.result) + :: + %& + =/ mr=(unit merge-result) +.result + ?~ mr + (done %& ~) + =. ..merge (done %& conflicts.u.mr) + (park | new.u.mr ~ lat.u.mr) + == + :: + +$ merge-result [conflicts=(set path) new=yoki lat=(map lobe blob)] + :: + ++ merge-helper + |= [=ali=ship =ali=desk =germ ali-dome=dome:clay continuation-yaki=(unit yaki)] + ^- (each (unit merge-result) [term tang]) + |^ + :: term tang is the error, merge result being ~ means the merge was + :: a no-op + :: (each a b) is [| b] or [& a] + ^- (each (unit merge-result) [term tang]) =/ ali-yaki=yaki (~(got by hut.ran) (~(got by hit.ali-dome) let.ali-dome)) =/ bob-yaki=(unit yaki) - ?~ let.dom - ~ - (~(get by hut.ran) (~(got by hit.dom) let.dom)) - =/ merge-result (merge-by-germ ali-yaki bob-yaki) - ?: ?=(%| -.merge-result) - (done %| p.merge-result) - ?~ p.merge-result - (done %& ~) - =. ..merge (done %& conflicts.u.p.merge-result) - (park | new.u.p.merge-result ~ lat.u.p.merge-result) - :: - ++ done - |= result=(each (set path) (pair term tang)) - ^+ ..merge - (emit hen %give %mere result) - :: - +$ merge-result [conflicts=(set path) new=yoki lat=(map lobe blob)] + ?~ continuation-yaki + ?~ let.dom + ~ + (~(get by hut.ran) (~(got by hit.dom) let.dom)) + continuation-yaki + (merge-by-germ ali-yaki bob-yaki) ++ merge-by-germ |= [=ali=yaki bob-yaki=(unit yaki)] ^- (each (unit merge-result) [term tang]) @@ -2005,16 +2146,13 @@ ?- germ :: :: If this is a %only-this merge, we check to see if ali's and bob's - :: commits are the same, in which case we're done. Otherwise, we - :: check to see if ali's commit is in the ancestry of bob's, in - :: which case we're done. Otherwise, we create a new commit with - :: bob's data plus ali and bob as parents. + :: commits are the same, in which case we're done. + :: Otherwise, we create a new commit with bob's data plus ali and + :: bob as parents. :: %only-this ?: =(r.ali-yaki r.bob-yaki) &+~ - ?: (~(has in (reachable-takos:ze r.bob-yaki)) r.ali-yaki) - &+~ :* %& ~ conflicts=~ new=&+[[r.bob-yaki r.ali-yaki ~] (to-yuki q.bob-yaki)] @@ -2042,8 +2180,6 @@ %take-this ?: =(r.ali-yaki r.bob-yaki) &+~ - ?: (~(has in (reachable-takos:ze r.bob-yaki)) r.ali-yaki) - &+~ =/ new-data (~(uni by q.ali-yaki) q.bob-yaki) :* %& ~ conflicts=~ @@ -3384,6 +3520,7 @@ :: :: Creates a nako of all the changes between a and b. :: + :: ++ make-nako |= [ver=@ud a=aeon b=aeon] ^- nako @@ -3391,12 +3528,29 @@ |- ?: =(b let.dom) hit.dom + :: del everything after b $(hit.dom (~(del by hit.dom) let.dom), let.dom (dec let.dom)) b ?: =(0 b) [~ ~] - (data-twixt-takos =(0 ver) (~(get by hit.dom) a) (aeon-to-tako b)) - :: + =/ excludes=(set tako) + =| acc=(set tako) + =/ lower=@ud 1 + |- + :: a should be excluded, so wait until we're past it + ?: =(lower +(a)) + acc + =/ res=(set tako) (reachable-takos (~(got by hit.dom) lower)) + $(acc (~(uni in acc) res), lower +(lower)) + =/ includes=(set tako) + =| acc=(set tako) + =/ upper=@ud b + |- + ?: =(upper a) + acc + =/ res=(set tako) (reachable-takos (~(got by hit.dom) upper)) + $(acc (~(uni in acc) res), upper (dec upper)) + [(~(run in (~(dif in includes) excludes)) tako-to-yaki) ~] :: Traverse parentage and find all ancestor hashes :: ++ reachable-takos :: reachable @@ -3429,15 +3583,9 @@ |= [plops=? a=(unit tako) b=tako] ^- [(set yaki) (set plop)] =+ old=?~(a ~ (reachable-takos u.a)) - =/ yal=(set tako) - %- silt - %+ skip - ~(tap in (reachable-takos b)) - |=(tak=tako (~(has in old) tak)) + =/ yal=(set tako) (~(dif in (reachable-takos b)) old) :- (silt (turn ~(tap in yal) tako-to-yaki)) - ?. plops - ~ - (silt (turn ~(tap in (new-lobes (new-lobes ~ old) yal)) lobe-to-blob)) + ~ :: :: Get all the lobes that are referenced in `a` except those that are :: already in `b`. @@ -4074,6 +4222,14 @@ =/ den ((de now rof hen ruf) our des.req) abet:(start-merge:den her.req dem.req cas.req how.req) [mos ..^$] + :: + %fuse + ?: =(%$ des.req) + ~&(%fuse-no-desk !!) + =^ mos ruf + =/ den ((de now rof hen ruf) our des.req) + abet:(start-fuse:den srcs.req) + [mos ..^$] :: %mont =. hez.ruf ?^(hez.ruf hez.ruf `[[%$ %sync ~] ~]) @@ -4202,11 +4358,43 @@ ++ load => |% +$ raft-any - $% [%7 raft-7] + $% [%8 raft-8] + [%7 raft-7] [%6 raft-6] == - +$ raft-7 raft - +$ dojo-7 dojo + +$ raft-8 raft + +$ raft-7 + $: rom=room-7 + hoy=(map ship rung-7) + ran=rang + mon=(map term beam) + hez=(unit duct) + cez=(map @ta crew) + pud=(unit [=desk =yoki]) + == + +$ room-7 + $: hun=duct + dos=(map desk dojo-7) + == + + +$ rung-7 + $: rus=(map desk rede-7) + == + +$ dojo-7 + $: qyx=cult + dom=dome + per=regs + pew=regs + == + +$ rede-7 + $: lim=@da + ref=(unit rind) + qyx=cult + dom=dome + per=regs + pew=regs + == + +$ ford-cache-7 ford-cache +$ raft-6 $: rom=room-6 :: domestic @@ -4250,7 +4438,7 @@ |^ =? old ?=(%6 -.old) 7+(raft-6-to-7 +.old) ?> ?=(%7 -.old) - ..^^$(ruf +.old) + ..^^$(ruf (raft-7-to-8 +.old)) :: +raft-6-to-7: delete stale ford caches (they could all be invalid) :: ++ raft-6-to-7 @@ -4270,6 +4458,26 @@ |= =rede-6 rede-6(dom dom.rede-6(fod *ford-cache-7)) == + :: +raft-7-to-8: create bunted melts in each dojo/rede + :: + ++ raft-7-to-8 + |= raf=raft-7 + ^- raft-8 + %= raf + dos.rom + %- ~(run by dos.rom.raf) + |= doj=dojo-7 + ^- dojo + [qyx.doj dom.doj per.doj pew.doj *melt] + :: + hoy + %- ~(run by hoy.raf) + |= =rung-7 + %- ~(run by rus.rung-7) + |= r=rede-7 + ^- rede + [lim.r ref.r qyx.r dom.r per.r pew.r *melt] + == -- :: ++ scry :: inspect @@ -4320,6 +4528,7 @@ dos.rom %- ~(run by dos.rom.ruf) |= =dojo + ::dojo dojo(fod.dom [~ ~ ~ ~ ~]) :: hoy @@ -4329,6 +4538,7 @@ rus %- ~(run by rus.rung) |= =rede + ::rede rede(fod.dom [~ ~ ~ ~ ~]) == == @@ -4350,6 +4560,19 @@ abet:(merge:den ali-ship ali-desk germ p.hin) [mos ..^$] :: + ?: ?=([%fuse @ @ @ @ @ ~] tea) + ?> ?=(%writ +<.hin) + =* syd i.t.tea + =/ ali-ship=@p (slav %p i.t.t.tea) + =* ali-desk=desk i.t.t.t.tea + =/ ali-case (rash i.t.t.t.t.tea nuck:so) + ?> ?=([%$ *] ali-case) + =/ germ (germ i.t.t.t.t.t.tea) + =^ mos ruf + =/ den ((de now rof hen ruf) our i.t.tea) + abet:(take-fuse:den [[ali-ship ali-desk (case +.ali-case)] germ] p.hin) + [mos ..^$] + :: ?: ?=([%foreign-warp *] tea) ?> ?=(%writ +<.hin) :_ ..^$ From fd6f6b3bd04e5469574e00eb73d6ab0ffa470871 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Tue, 20 Apr 2021 12:04:59 -0500 Subject: [PATCH 21/62] zuse: added jet hints to all +ordered-map arms, reordered them alphabetically as is done in +in and +by --- pkg/arvo/sys/zuse.hoon | 344 ++++++++++++----------- pkg/arvo/tests/sys/zuse/ordered-map.hoon | 2 +- 2 files changed, 180 insertions(+), 166 deletions(-) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index f826cc1e7..d6f4cae0e 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5070,7 +5070,7 @@ |= ord=$-([key key] ?) |= a=* =/ b ;;((tree [key=key val=value]) a) - ?> (check-balance:((ordered-map key value) ord) b) + ?> (apt:((ordered-map key value) ord) b) b :: :: $mk-item: constructor for +ordered-map item type @@ -5094,9 +5094,20 @@ :: |= compare=$-([key key] ?) |% - :: +check-balance: verify horizontal and vertical orderings + :: +all: apply logical AND boolean test on all values :: - ++ check-balance + ++ all + ~/ %all + |= [a=(tree item) b=$-(item ?)] + ^- ? + |- + ?~ a + & + ?&((b n.a) $(a l.a) $(a r.a)) + :: +apt: verify horizontal and vertical orderings + :: + ++ apt + ~/ %apt =| [l=(unit key) r=(unit key)] |= a=(tree item) ^- ? @@ -5122,9 +5133,107 @@ :: ?~(r.a %.y &((mor key.n.a key.n.r.a) $(a r.a, r `key.n.a))) == + :: +bap: convert to list, largest to smallest + :: + ++ bap + ~/ %bap + |= a=(tree item) + ^- (list item) + :: + =| b=(list item) + |- ^+ b + ?~ a b + :: + $(a r.a, b [n.a $(a l.a)]) + :: +del: delete .key from .a if it exists, producing value iff deleted + :: + ++ del + ~/ %del + |= [a=(tree item) =key] + ^- [(unit val) (tree item)] + :: + ?~ a [~ ~] + :: we found .key at the root; delete and rebalance + :: + ?: =(key key.n.a) + [`val.n.a (nip a)] + :: recurse left or right to find .key + :: + ?: (compare key key.n.a) + =+ [found lef]=$(a l.a) + [found a(l lef)] + =+ [found rig]=$(a r.a) + [found a(r rig)] + :: +gas: put a list of items + :: + ++ gas + ~/ %gas + |= [a=(tree item) b=(list item)] + ^- (tree item) + :: + ?~ b a + $(b t.b, a (put a i.b)) + :: + :: +get: get val at key or return ~ + :: + ++ get + ~/ %get + |= [a=(tree item) b=key] + ^- (unit val) + ?~ a ~ + ?: =(b key.n.a) + `val.n.a + ?: (compare b key.n.a) + $(a l.a) + $(a r.a) + :: +nip: remove root; for internal use + :: + ++ nip + ~/ %nip + |= a=(tree item) + ^- (tree item) + :: + ?> ?=(^ a) + :: delete .n.a; merge and balance .l.a and .r.a + :: + |- ^- (tree item) + ?~ l.a r.a + ?~ r.a l.a + ?: (mor key.n.l.a key.n.r.a) + l.a(r $(l.a r.l.a)) + r.a(l $(r.a l.r.a)) + :: +peek: produce head (smallest item) or null + :: + ++ peek + ~/ %peek + |= a=(tree item) + ^- (unit item) + :: + ?~ a ~ + ?~ l.a `n.a + $(a l.a) + :: + :: +pop: produce .head (smallest item) and .rest or crash if empty + :: + ++ pop + ~/ %pop + |= a=(tree item) + ^- [head=item rest=(tree item)] + :: + ?~ a !! + ?~ l.a [n.a r.a] + :: + =/ l $(a l.a) + :- head.l + :: load .rest.l back into .a and rebalance + :: + ?: |(?=(~ rest.l) (mor key.n.a key.n.rest.l)) + a(l rest.l) + rest.l(r a(r r.rest.l)) :: +put: ordered item insert :: ++ put + ~/ %put |= [a=(tree item) =key =val] ^- (tree item) :: base case: replace null with single-item tree @@ -5148,65 +5257,77 @@ ?: (mor key.n.a key.n.r) a(r r) r(l a(r l.r)) - :: +peek: produce head (smallest item) or null + :: +run: apply gate to transform all values in place :: - ++ peek - |= a=(tree item) - ^- (unit item) - :: - ?~ a ~ - ?~ l.a `n.a - $(a l.a) + ++ run + ~/ %run + |= [a=(tree item) b=$-(val val)] + |- + ?~ a a + [n=[key.n.a (b val.n.a)] l=$(a l.a) r=$(a r.a)] :: - :: +pop: produce .head (smallest item) and .rest or crash if empty + :: +subset: take a range excluding start and/or end and all elements + :: outside the range :: - ++ pop - |= a=(tree item) - ^- [head=item rest=(tree item)] - :: - ?~ a !! - ?~ l.a [n.a r.a] - :: - =/ l $(a l.a) - :- head.l - :: load .rest.l back into .a and rebalance - :: - ?: |(?=(~ rest.l) (mor key.n.a key.n.rest.l)) - a(l rest.l) - rest.l(r a(r r.rest.l)) - :: +del: delete .key from .a if it exists, producing value iff deleted - :: - ++ del - |= [a=(tree item) =key] - ^- [(unit val) (tree item)] - :: - ?~ a [~ ~] - :: we found .key at the root; delete and rebalance - :: - ?: =(key key.n.a) - [`val.n.a (nip a)] - :: recurse left or right to find .key - :: - ?: (compare key key.n.a) - =+ [found lef]=$(a l.a) - [found a(l lef)] - =+ [found rig]=$(a r.a) - [found a(r rig)] - :: +nip: remove root; for internal use - :: - ++ nip - |= a=(tree item) + ++ subset + ~/ %subset + |= $: tre=(tree item) + start=(unit key) + end=(unit key) + == ^- (tree item) + |^ + ?: ?&(?=(~ start) ?=(~ end)) + tre + ?~ start + (del-span tre %end end) + ?~ end + (del-span tre %start start) + ?> (compare u.start u.end) + =. tre (del-span tre %start start) + (del-span tre %end end) :: - ?> ?=(^ a) - :: delete .n.a; merge and balance .l.a and .r.a + ++ del-span + |= [a=(tree item) b=?(%start %end) c=(unit key)] + ^- (tree item) + ?~ a a + ?~ c a + ?- b + %start + :: found key + ?: =(key.n.a u.c) + (nip a(l ~)) + :: traverse to find key + ?: (compare key.n.a u.c) + :: found key to the left of start + $(a (nip a(l ~))) + :: found key to the right of start + a(l $(a l.a)) + :: + %end + :: found key + ?: =(u.c key.n.a) + (nip a(r ~)) + :: traverse to find key + ?: (compare key.n.a u.c) + :: found key to the left of end + a(r $(a r.a)) + :: found key to the right of end + $(a (nip a(r ~))) + == + -- + :: +tap: convert to list, smallest to largest + :: + ++ tap + ~/ %tap + |= a=(tree item) + ^- (list item) :: - |- ^- (tree item) - ?~ l.a r.a - ?~ r.a l.a - ?: (mor key.n.l.a key.n.r.a) - l.a(r $(l.a r.l.a)) - r.a(l $(r.a l.r.a)) + =| b=(list item) + |- ^+ b + ?~ a b + :: + $(a l.a, b [n.a $(a r.a)]) :: +traverse: stateful partial inorder traversal :: :: Mutates .state on each run of .f. Starts at .start key, or if @@ -5216,6 +5337,7 @@ :: item. :: ++ traverse + ~/ %traverse |* state=mold |= $: a=(tree item) =state @@ -5274,58 +5396,12 @@ =/ rig main(a r.a) rig(a a(r a.rig)) -- - :: +tap: convert to list, smallest to largest - :: - ++ tap - |= a=(tree item) - ^- (list item) - :: - =| b=(list item) - |- ^+ b - ?~ a b - :: - $(a l.a, b [n.a $(a r.a)]) - :: +bap: convert to list, largest to smallest - :: - ++ bap - |= a=(tree item) - ^- (list item) - :: - =| b=(list item) - |- ^+ b - ?~ a b - :: - $(a r.a, b [n.a $(a l.a)]) - :: +run: apply gate to transform all values in place - :: without modifying their type - :: - ++ run - |= [a=(tree item) b=$-(val val)] - |- ^+ a - ?~ a a - [n=[key.n.a (b val.n.a)] l=$(a l.a) r=$(a r.a)] - :: +all: apply logical AND boolean test on all values - :: - ++ all - |= [a=(tree item) b=$-(item ?)] - ^- ? - |- - ?~ a - & - ?&((b n.a) $(a l.a) $(a r.a)) - :: +gas: put a list of items - :: - ++ gas - |= [a=(tree item) b=(list item)] - ^- (tree item) - :: - ?~ b a - $(b t.b, a (put a i.b)) :: +uni: unify two ordered maps :: :: .b takes precedence over .a if keys overlap. :: ++ uni + ~/ %uni |= [a=(tree item) b=(tree item)] ^- (tree item) :: @@ -5344,68 +5420,6 @@ ?: (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) - :: - :: +get: get val at key or return ~ - :: - ++ get - |= [a=(tree item) b=key] - ^- (unit val) - ?~ a ~ - ?: =(b key.n.a) - `val.n.a - ?: (compare b key.n.a) - $(a l.a) - $(a r.a) - :: - :: +subset: take a range excluding start and/or end and all elements - :: outside the range - :: - ++ subset - |= $: tre=(tree item) - start=(unit key) - end=(unit key) - == - ^- (tree item) - |^ - ?: ?&(?=(~ start) ?=(~ end)) - tre - ?~ start - (del-span tre %end end) - ?~ end - (del-span tre %start start) - ?> (compare u.start u.end) - =. tre (del-span tre %start start) - (del-span tre %end end) - :: - ++ del-span - |= [a=(tree item) b=?(%start %end) c=(unit key)] - ^- (tree item) - ?~ a a - ?~ c a - ?- b - %start - :: found key - ?: =(key.n.a u.c) - (nip a(l ~)) - :: traverse to find key - ?: (compare key.n.a u.c) - :: found key to the left of start - $(a (nip a(l ~))) - :: found key to the right of start - a(l $(a l.a)) - :: - %end - :: found key - ?: =(u.c key.n.a) - (nip a(r ~)) - :: traverse to find key - ?: (compare key.n.a u.c) - :: found key to the left of end - a(r $(a r.a)) - :: found key to the right of end - $(a (nip a(r ~))) - == - -- -- :: :: :::: ++userlib :: (2u) non-vane utils diff --git a/pkg/arvo/tests/sys/zuse/ordered-map.hoon b/pkg/arvo/tests/sys/zuse/ordered-map.hoon index 261b8f085..bc5943a4f 100644 --- a/pkg/arvo/tests/sys/zuse/ordered-map.hoon +++ b/pkg/arvo/tests/sys/zuse/ordered-map.hoon @@ -17,7 +17,7 @@ :: %+ expect-eq !> %.y - !> (check-balance:atom-map a) + !> (apt:atom-map a) :: ++ test-ordered-map-tap ^- tang :: From 2e302818d3976e8f26c10fc87c04e56141913cf5 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Tue, 20 Apr 2021 12:05:24 -0500 Subject: [PATCH 22/62] zuse: added +any to +ordered-map --- pkg/arvo/sys/zuse.hoon | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index d6f4cae0e..7160a150a 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5104,6 +5104,15 @@ ?~ a & ?&((b n.a) $(a l.a) $(a r.a)) + :: +any: apply logical OR boolean test on all values + :: + ++ any + ~/ %any + |= [a=(tree item) b=$-(item ?)] + |- ^- ? + ?~ a + | + ?|((b n.a) $(a l.a) $(a r.a)) :: +apt: verify horizontal and vertical orderings :: ++ apt From ae2aefed2a22dc5937bc770bf45f3d34a2f8428a Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Tue, 20 Apr 2021 12:06:03 -0500 Subject: [PATCH 23/62] zuse: made +run allow type transform to match +by and +in --- pkg/arvo/sys/zuse.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index 7160a150a..2e5d1158b 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5270,7 +5270,7 @@ :: ++ run ~/ %run - |= [a=(tree item) b=$-(val val)] + |= [a=(tree item) b=$-(val *)] |- ?~ a a [n=[key.n.a (b val.n.a)] l=$(a l.a) r=$(a r.a)] From 9247fc247c4f980e4ea151b3fe60a024f53a4a38 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Tue, 20 Apr 2021 12:09:18 -0500 Subject: [PATCH 24/62] zuse: add +got and +has arms to +ordered-map --- pkg/arvo/sys/zuse.hoon | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index 2e5d1158b..89fae22c1 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5182,7 +5182,6 @@ :: ?~ b a $(b t.b, a (put a i.b)) - :: :: +get: get val at key or return ~ :: ++ get @@ -5195,6 +5194,19 @@ ?: (compare b key.n.a) $(a l.a) $(a r.a) + :: +got: need value at key + :: + ++ got + |= [a=(tree item) b=key] + ^- val + (need (get a b)) + :: +has: check for key existence + :: + ++ has + ~/ %has + |= [a=(tree item) b=key] + ^- ? + !=(~ (get a b)) :: +nip: remove root; for internal use :: ++ nip From f0ba5afe1cbaaf869e14080fa36a20c8cb51c61f Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Tue, 20 Apr 2021 12:56:24 -0500 Subject: [PATCH 25/62] zuse: respond to joe's requests to remove mk-item and add fast hint for ordered-map --- pkg/arvo/sys/zuse.hoon | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index 89fae22c1..8bc9d3000 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5072,10 +5072,6 @@ =/ b ;;((tree [key=key val=value]) a) ?> (apt:((ordered-map key value) ord) b) b -:: -:: $mk-item: constructor for +ordered-map item type -:: -++ mk-item |$ [key val] [key=key val=val] :: +ordered-map: treap with user-specified horizontal order :: :: Conceptually smaller items go on the left, so the item with the @@ -5088,11 +5084,12 @@ ++ ordered-map |* [key=mold val=mold] => |% - +$ item (mk-item key val) + +$ item [key=key val=val] -- :: +compare: item comparator for horizontal order :: |= compare=$-([key key] ?) + ~% %ordered-map ..part ~ |% :: +all: apply logical AND boolean test on all values :: @@ -5286,7 +5283,6 @@ |- ?~ a a [n=[key.n.a (b val.n.a)] l=$(a l.a) r=$(a r.a)] - :: :: +subset: take a range excluding start and/or end and all elements :: outside the range :: From b5a8e7a40b44daa4c21b991ab2946056f42cc372 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Tue, 20 Apr 2021 15:03:57 -0500 Subject: [PATCH 26/62] zuse: change name of +ordered-map to +on and add alias, change name of +traverse to +dip as per talk with ted --- pkg/arvo/sys/zuse.hoon | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index 8bc9d3000..163da7094 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5072,7 +5072,8 @@ =/ b ;;((tree [key=key val=value]) a) ?> (apt:((ordered-map key value) ord) b) b -:: +ordered-map: treap with user-specified horizontal order +++ ordered-map on +:: +on: treap with user-specified horizontal order, ordered-map :: :: Conceptually smaller items go on the left, so the item with the :: smallest key can be popped off the head. If $key is `@` and @@ -5081,15 +5082,17 @@ :: WARNING: ordered-map will not work properly if two keys can be :: unequal under noun equality but equal via the compare gate :: -++ ordered-map +++ on + ~/ %on |* [key=mold val=mold] => |% +$ item [key=key val=val] -- :: +compare: item comparator for horizontal order :: + ~% %comp +>+ ~ |= compare=$-([key key] ?) - ~% %ordered-map ..part ~ + ~% %core + ~ |% :: +all: apply logical AND boolean test on all values :: @@ -5345,7 +5348,7 @@ ?~ a b :: $(a l.a, b [n.a $(a r.a)]) - :: +traverse: stateful partial inorder traversal + :: +dip: stateful partial inorder traversal :: :: Mutates .state on each run of .f. Starts at .start key, or if :: .start is ~, starts at the head (item with smallest key). Stops @@ -5353,8 +5356,8 @@ :: keys. Each run of .f can replace an item's value or delete the :: item. :: - ++ traverse - ~/ %traverse + ++ dip + ~/ %dip |* state=mold |= $: a=(tree item) =state From 6b0dc989529bd6f9da1f3bb89c985f7716db2378 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Tue, 20 Apr 2021 15:04:28 -0500 Subject: [PATCH 27/62] ames: reflect update of name +traverse -> +dip --- pkg/arvo/sys/vane/ames.hoon | 8 ++++---- pkg/arvo/tests/sys/zuse/ordered-map.hoon | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/arvo/sys/vane/ames.hoon b/pkg/arvo/sys/vane/ames.hoon index ccf31d062..79d84446f 100644 --- a/pkg/arvo/sys/vane/ames.hoon +++ b/pkg/arvo/sys/vane/ames.hoon @@ -2603,7 +2603,7 @@ =| acc=(unit static-fragment) ^+ [static-fragment=acc live=live.state] :: - %^ (traverse:packet-queue _acc) live.state acc + %^ (dip:packet-queue _acc) live.state acc |= $: acc=_acc key=live-packet-key val=live-packet-val @@ -2681,7 +2681,7 @@ =/ acc resends=*(list static-fragment) :: - %^ (traverse:packet-queue _acc) live.state acc + %^ (dip:packet-queue _acc) live.state acc |= $: acc=_acc key=live-packet-key val=live-packet-val @@ -2734,7 +2734,7 @@ :: ^+ [acc live=live.state] :: - %^ (traverse:packet-queue _acc) live.state acc + %^ (dip:packet-queue _acc) live.state acc |= $: acc=_acc key=live-packet-key val=live-packet-val @@ -2781,7 +2781,7 @@ :: ^+ [metrics=metrics.state live=live.state] :: - %^ (traverse:packet-queue pump-metrics) live.state acc=metrics.state + %^ (dip:packet-queue pump-metrics) live.state acc=metrics.state |= $: metrics=pump-metrics key=live-packet-key val=live-packet-val diff --git a/pkg/arvo/tests/sys/zuse/ordered-map.hoon b/pkg/arvo/tests/sys/zuse/ordered-map.hoon index bc5943a4f..94b4628b3 100644 --- a/pkg/arvo/tests/sys/zuse/ordered-map.hoon +++ b/pkg/arvo/tests/sys/zuse/ordered-map.hoon @@ -103,11 +103,11 @@ !> (gas:atom-map ~ ~[[1^%b]]) !> b :: -++ test-ordered-map-traverse ^- tang +++ test-ordered-map-dip ^- tang :: =/ a=(tree [@ud @tas]) (gas:atom-map ~ test-items) :: - =/ b %- (traverse:atom-map ,(list [@ud @tas])) + =/ b %- (dip:atom-map ,(list [@ud @tas])) :* a state=~ :: @@ -129,11 +129,11 @@ !> -.b == :: -++ test-ordered-map-traverse-delete-all ^- tang +++ test-ordered-map-dip-delete-all ^- tang ;: weld =/ q ((ordered-map ,@ ,~) lte) =/ o (gas:q ~ ~[1/~ 2/~ 3/~]) - =/ b ((traverse:q ,~) o ~ |=([~ key=@ ~] [~ %| ~])) + =/ b ((dip:q ,~) o ~ |=([~ key=@ ~] [~ %| ~])) %+ expect-eq !> [~ ~] !> b @@ -147,7 +147,7 @@ ?:((lth aa ba) %.y ?:((gth aa ba) %.n (lte ab bb))) =/ q ((ordered-map ,[@ @] ,~) compare) =/ o (gas:q ~ c) - =/ b ((traverse:q ,~) o ~ |=([~ key=[@ @] ~] [~ %| ~])) + =/ b ((dip:q ,~) o ~ |=([~ key=[@ @] ~] [~ %| ~])) %+ expect-eq !> [~ ~] !> b From 5b7b7e6cb76030a1345a6c298842a7c2d97807c2 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Tue, 20 Apr 2021 15:21:07 -0500 Subject: [PATCH 28/62] zuse: reorder dip alphabetically --- pkg/arvo/sys/zuse.hoon | 139 ++++++++++++++++++++--------------------- 1 file changed, 69 insertions(+), 70 deletions(-) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index 163da7094..57cd2bac1 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5070,7 +5070,7 @@ |= ord=$-([key key] ?) |= a=* =/ b ;;((tree [key=key val=value]) a) - ?> (apt:((ordered-map key value) ord) b) + ?> (apt:((on key value) ord) b) b ++ ordered-map on :: +on: treap with user-specified horizontal order, ordered-map @@ -5173,13 +5173,80 @@ [found a(l lef)] =+ [found rig]=$(a r.a) [found a(r rig)] + :: +dip: stateful partial inorder traversal + :: + :: Mutates .state on each run of .f. Starts at .start key, or if + :: .start is ~, starts at the head (item with smallest key). Stops + :: when .f produces .stop=%.y. Traverses from smaller to larger + :: keys. Each run of .f can replace an item's value or delete the + :: item. + :: + ++ dip + ~/ %dip + |* state=mold + |= $: a=(tree item) + =state + f=$-([state item] [(unit val) ? state]) + == + ^+ [state a] + :: acc: accumulator + :: + :: .stop: set to %.y by .f when done traversing + :: .state: threaded through each run of .f and produced by +abet + :: + =/ acc [stop=`?`%.n state=state] + =< abet =< main + |% + ++ this . + ++ abet [state.acc a] + :: +main: main recursive loop; performs a partial inorder traversal + :: + ++ main + ^+ this + :: stop if empty or we've been told to stop + :: + ?: =(~ a) this + ?: stop.acc this + :: inorder traversal: left -> node -> right, until .f sets .stop + :: + =. this left + ?: stop.acc this + =^ del this node + =? this !stop.acc right + =? a del (nip a) + this + :: +node: run .f on .n.a, updating .a, .state, and .stop + :: + ++ node + ^+ [del=*? this] + :: run .f on node, updating .stop.acc and .state.acc + :: + ?> ?=(^ a) + =^ res acc (f state.acc n.a) + ?~ res + [del=& this] + [del=| this(val.n.a u.res)] + :: +left: recurse on left subtree, copying mutant back into .l.a + :: + ++ left + ^+ this + ?~ a this + =/ lef main(a l.a) + lef(a a(l a.lef)) + :: +right: recurse on right subtree, copying mutant back into .r.a + :: + ++ right + ^+ this + ?~ a this + =/ rig main(a r.a) + rig(a a(r a.rig)) + -- :: +gas: put a list of items :: ++ gas ~/ %gas |= [a=(tree item) b=(list item)] ^- (tree item) - :: ?~ b a $(b t.b, a (put a i.b)) :: +get: get val at key or return ~ @@ -5348,74 +5415,6 @@ ?~ a b :: $(a l.a, b [n.a $(a r.a)]) - :: +dip: stateful partial inorder traversal - :: - :: Mutates .state on each run of .f. Starts at .start key, or if - :: .start is ~, starts at the head (item with smallest key). Stops - :: when .f produces .stop=%.y. Traverses from smaller to larger - :: keys. Each run of .f can replace an item's value or delete the - :: item. - :: - ++ dip - ~/ %dip - |* state=mold - |= $: a=(tree item) - =state - f=$-([state item] [(unit val) ? state]) - == - ^+ [state a] - :: acc: accumulator - :: - :: .stop: set to %.y by .f when done traversing - :: .state: threaded through each run of .f and produced by +abet - :: - =/ acc [stop=`?`%.n state=state] - =< abet =< main - |% - ++ this . - ++ abet [state.acc a] - :: +main: main recursive loop; performs a partial inorder traversal - :: - ++ main - ^+ this - :: stop if empty or we've been told to stop - :: - ?: =(~ a) this - ?: stop.acc this - :: inorder traversal: left -> node -> right, until .f sets .stop - :: - =. this left - ?: stop.acc this - =^ del this node - =? this !stop.acc right - =? a del (nip a) - this - :: +node: run .f on .n.a, updating .a, .state, and .stop - :: - ++ node - ^+ [del=*? this] - :: run .f on node, updating .stop.acc and .state.acc - :: - ?> ?=(^ a) - =^ res acc (f state.acc n.a) - ?~ res - [del=& this] - [del=| this(val.n.a u.res)] - :: +left: recurse on left subtree, copying mutant back into .l.a - :: - ++ left - ^+ this - ?~ a this - =/ lef main(a l.a) - lef(a a(l a.lef)) - :: +right: recurse on right subtree, copying mutant back into .r.a - :: - ++ right - ^+ this - ?~ a this - =/ rig main(a r.a) - rig(a a(r a.rig)) - -- :: +uni: unify two ordered maps :: :: .b takes precedence over .a if keys overlap. From cef4e6a7261bc30d1ebd52c484d306e8797483e3 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Tue, 20 Apr 2021 16:04:48 -0500 Subject: [PATCH 29/62] zuse: fix +apt jet parent not found --- pkg/arvo/sys/zuse.hoon | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index 57cd2bac1..c92594183 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5072,6 +5072,8 @@ =/ b ;;((tree [key=key val=value]) a) ?> (apt:((on key value) ord) b) b +:: +:: ++ ordered-map on :: +on: treap with user-specified horizontal order, ordered-map :: @@ -5117,9 +5119,9 @@ :: ++ apt ~/ %apt - =| [l=(unit key) r=(unit key)] |= a=(tree item) - ^- ? + =| [l=(unit key) r=(unit key)] + |- ^- ? :: empty tree is valid :: ?~ a %.y From 6917aabde57493d7d7d5b9d2b409736c247a48e8 Mon Sep 17 00:00:00 2001 From: raghu <{ID}+{username}@users.noreply.github.com> Date: Tue, 20 Apr 2021 21:20:39 -0400 Subject: [PATCH 30/62] repo: fix gitignore/makefile --- .gitignore | 7 +------ Makefile | 3 --- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index d2c66c945..e79759dc6 100644 --- a/.gitignore +++ b/.gitignore @@ -76,9 +76,4 @@ pkg/interface/link-webext/web-ext-artifacts *.xz # Logs -*.log - -backup* -notes -bel -wex +*.log \ No newline at end of file diff --git a/Makefile b/Makefile index fd3eaf12b..a06eac1c8 100644 --- a/Makefile +++ b/Makefile @@ -17,9 +17,6 @@ pills: sh/update-brass-pill sh/update-ivory-pill -solid: - sh/update-solid-pill - ropsten-pills: sh/create-ropsten-pills From ca9f6180d8199a66760eb712176852618f089cb5 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Thu, 22 Apr 2021 10:46:48 -0500 Subject: [PATCH 31/62] zuse: make ordered-map's +run wet --- pkg/arvo/sys/zuse.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index c92594183..2e5f4b98e 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5351,7 +5351,7 @@ :: ++ run ~/ %run - |= [a=(tree item) b=$-(val *)] + |* [a=(tree item) b=$-(val *)] |- ?~ a a [n=[key.n.a (b val.n.a)] l=$(a l.a) r=$(a r.a)] From dcdf695991bc6cdccdc42186874da8fbc6d92af5 Mon Sep 17 00:00:00 2001 From: fang Date: Fri, 23 Apr 2021 22:56:24 +0200 Subject: [PATCH 32/62] clay: insert %nest-fail into trace conditionally Previously, we would stack on the ~| for every file we had previously processed, even though we only want it in the trace for actual failures. --- pkg/arvo/sys/vane/clay.hoon | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 3ca9057d0..d11fdedfa 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -992,8 +992,9 @@ [%kttr %make [%wing ~[%map]] ~[[%base %atom %ta] spec.i.raz]] |- ?~ res ~ - ~| [%nest-fail path.i.raz p.n.res] - ?> (~(nest ut type) | p.q.n.res) + ?. (~(nest ut type) | p.q.n.res) + ~| [%nest-fail path.i.raz p.n.res] + !! :- [p.n.res q.q.n.res] [$(res l.res) $(res r.res)] :: From 550dee32dab0a898d46702d908804dd6ee931ec7 Mon Sep 17 00:00:00 2001 From: fang Date: Fri, 23 Apr 2021 23:05:11 +0200 Subject: [PATCH 33/62] clay: +any:in in place of +lien over +tap:in --- 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 d11fdedfa..3ed87130f 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -1655,11 +1655,11 @@ |- ^+ cache ?~ builds ~ - ?: %+ lien ~(tap in dez.i.builds) + ?: %- ~(any in dez.i.builds) |= [dir=? =path] ?. dir (~(has in invalid) path) =+ l=(lent path) - %+ lien ~(tap in invalid) + %- ~(any in invalid) |= i=^path &(=(path (scag l i)) ?=([@ %hoon ~] (slag l i))) $(builds t.builds) From 9d7afd10ee1aaddf9f58341b1a8efc294204e8d3 Mon Sep 17 00:00:00 2001 From: raghu <{ID}+{username}@users.noreply.github.com> Date: Fri, 23 Apr 2021 17:33:49 -0400 Subject: [PATCH 34/62] clay: change fuse request --- pkg/arvo/sys/lull.hoon | 3 +- pkg/arvo/sys/vane/clay.hoon | 81 ++++++++++++++++++++----------------- 2 files changed, 47 insertions(+), 37 deletions(-) diff --git a/pkg/arvo/sys/lull.hoon b/pkg/arvo/sys/lull.hoon index e91d88935..bc8c55287 100644 --- a/pkg/arvo/sys/lull.hoon +++ b/pkg/arvo/sys/lull.hoon @@ -764,7 +764,8 @@ == :: $: %fuse :: mega merge des=desk :: target desk - srcs=(list [beak germ]) :: sources + ful=(list beak) :: source desks + gim=(list germ) :: strategies == [%mont pot=term bem=beam] :: mount to unix [%dirk des=desk] :: mark mount dirty diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 09130e815..5aff31999 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -60,7 +60,7 @@ +$ cult (jug wove duct) :: State for ongoing %fuse merges - the list maintains the ordering :: and the map stores the data needed to merge -+$ melt [(list [beak germ]) (map [beak germ] (unit dome:clay))] ++$ melt [bas=beak con=(list [beak germ]) sto=(map beak (unit dome:clay))] :: :: Domestic desk state. :: @@ -1049,7 +1049,7 @@ ~ =/ rus rus:(~(gut by hoy.ruf) her *rung) %+ ~(gut by rus) syd - [lim=~2000.1.1 ref=`*rind qyx=~ dom=*dome per=~ pew=~ fiz=[~ ~]] + [lim=~2000.1.1 ref=`*rind qyx=~ dom=*dome per=~ pew=~ fiz=*melt] :: administrative duct, domestic +rede :: :+ ~ `hun.rom.ruf @@ -1969,39 +1969,54 @@ (emit hen %pass wire %c %warp ali-ship ali-desk `[%sing %v case /]) :: ++ make-melt - |= srcs=(list [beak germ]) + |= [bas=beak con=(list [beak germ])] ^- melt - :- srcs - %- ~(gas by *(map [beak germ] (unit dome:clay))) - (turn srcs |=(a=[beak germ] [a *(unit dome:clay)])) + :+ bas con + %- ~(gas by (~(put by *(map beak (unit dome:clay))) bas *(unit dome:clay))) + (turn con |=(a=[beak germ] [-.a *(unit dome:clay)])) :: ++ start-fuse - |= [srcs=(list [beak germ])] + |= [ful=(list beak) gim=(list germ)] ^+ ..start-fuse - :: use emil here to queue a list of moves - :: syd is current desk (target desk) - :: what is hen? it's the current duct... can this be reused? + :: must have n sources and n-1 gems + ?> =((lent ful) +((lent gim))) =/ moves=(list move) %+ turn - srcs - |= [bec=beak g=germ] + ful + |= bec=beak ^- move - =/ wir=wire /fuse/[syd]/(scot %p p.bec)/[q.bec]/(scot r.bec)/[g] + =/ wir=wire /fuse/[syd]/(scot %p p.bec)/[q.bec]/(scot r.bec) [hen %pass wir %c %warp p.bec q.bec `[%sing %v r.bec /]] + ?~ ful + !! + =/ base=beak i.ful + =/ ful=(list beak) t.ful + =/ con=(list [beak germ]) + =| acc=(list [beak germ]) + |- + ?~ ful + acc + ?~ gim + !! + $(acc [[i.ful i.gim] acc], ful t.ful, gim t.gim) :: we also want to clear the state (fiz) associated with this :: merge and print a warning if it's non trivial i.e. we're :: starting a new fuse before the previous one terminated. - ~& ?~ -.fiz - [%starting-fuse srcs] - :^ %starting-fuse srcs %discarding-state - :: we don't want to ~& an entire dome - %- ~(run by +.fiz) - |=(v=(unit dome:clay) ?~(v %not-received %recieved)) - =. fiz (make-melt srcs) + ~& ?~ con.fiz + [%starting-fuse base con] + :* %starting-fuse + base + con + %discarding-state + :: we don't want to ~& an entire dome + %- ~(run by sto.fiz) + |=(v=(unit dome:clay) ?~(v %not-received %recieved)) + == + =. fiz (make-melt base con) (emil moves) :: ++ take-fuse - |= [[bec=beak g=germ] =riot] + |= [bec=beak =riot] ^+ ..take-fuse ?~ riot ~& [%fuse-for syd %missing bec] @@ -2009,29 +2024,24 @@ :: responses we get for the merge will cause take-fuse to crash =. fiz *melt ..take-fuse - ?> (~(has by +.fiz) [bec g]) + ?> (~(has by sto.fiz) bec) =. fiz - :- -.fiz - (~(put by +.fiz) [bec g] `!<(dome:clay q.r.u.riot)) + :+ bas.fiz con.fiz + (~(put by sto.fiz) bec `!<(dome:clay q.r.u.riot)) =/ all-done=flag - %- ~(all by +.fiz) + %- ~(all by sto.fiz) |= res=(unit dome:clay) ^- flag !=(res ~) ?. all-done ..take-fuse - :: do the merge - =/ merges=(list [beak germ]) -.fiz - :: there's no point to an empty fuse and a single element fuse - :: should just be an %only-that merge. - ?> (gte (lent merges) 2) =| rag=rang =/ clean-hut-ran hut.ran - =/ initial-dome=dome:clay (need (~(got by +.fiz) (snag 0 merges))) + =/ initial-dome=dome:clay (need (~(got by sto.fiz) bas.fiz)) =/ continuation-yaki=yaki (~(got by hut.ran) (~(got by hit.initial-dome) let.initial-dome)) =/ parents=(list tako) ~[(~(got by hit.initial-dome) let.initial-dome)] - =. merges (slag 1 merges) + =/ merges con.fiz |- ^+ ..take-fuse ?~ merges @@ -2041,7 +2051,7 @@ =. hut.ran clean-hut-ran (park | [%| continuation-yaki(p (flop parents))] rag) =/ [bec=beak g=germ] i.merges - =/ ali-dom=dome:clay (need (~(got by +.fiz) bec g)) + =/ ali-dom=dome:clay (need (~(got by sto.fiz) bec)) =/ result (merge-helper p.bec q.bec g ali-dom `continuation-yaki) ?- -.result %| @@ -4228,7 +4238,7 @@ ~&(%fuse-no-desk !!) =^ mos ruf =/ den ((de now rof hen ruf) our des.req) - abet:(start-fuse:den srcs.req) + abet:(start-fuse:den ful.req gim.req) [mos ..^$] :: %mont @@ -4567,10 +4577,9 @@ =* ali-desk=desk i.t.t.t.tea =/ ali-case (rash i.t.t.t.t.tea nuck:so) ?> ?=([%$ *] ali-case) - =/ germ (germ i.t.t.t.t.t.tea) =^ mos ruf =/ den ((de now rof hen ruf) our i.t.tea) - abet:(take-fuse:den [[ali-ship ali-desk (case +.ali-case)] germ] p.hin) + abet:(take-fuse:den [ali-ship ali-desk (case +.ali-case)] p.hin) [mos ..^$] :: ?: ?=([%foreign-warp *] tea) From 201c3db19300255e481e3a846b0e4c70554094b9 Mon Sep 17 00:00:00 2001 From: raghu <{ID}+{username}@users.noreply.github.com> Date: Sat, 24 Apr 2021 20:50:50 -0400 Subject: [PATCH 35/62] clay: finalize fuse request - update |fuse --- pkg/arvo/gen/hood/fuse.hoon | 4 ++-- pkg/arvo/lib/hood/kiln.hoon | 5 +++-- pkg/arvo/sys/lull.hoon | 4 ++-- pkg/arvo/sys/vane/clay.hoon | 30 ++++++++---------------------- 4 files changed, 15 insertions(+), 28 deletions(-) diff --git a/pkg/arvo/gen/hood/fuse.hoon b/pkg/arvo/gen/hood/fuse.hoon index 39bf9f74c..03effe5c8 100644 --- a/pkg/arvo/gen/hood/fuse.hoon +++ b/pkg/arvo/gen/hood/fuse.hoon @@ -8,5 +8,5 @@ :::: :: :- %say -|= [[now=@da eny=@uvJ bec=beak] [des=desk srcs=(list [beak germ]) ~] ~] -[%kiln-fuse des srcs] +|= [[now=@da eny=@uvJ bec=beak] [des=desk bas=beak con=(list [beak germ]) ~] ~] +[%kiln-fuse des bas con] diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index 167750360..8700670bc 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -57,7 +57,8 @@ == +$ kiln-fuse $: syd=desk - srcs=(list [beak germ]) + bas=beak + con=(list [beak germ]) == -- |= [bowl:gall state] @@ -387,7 +388,7 @@ :: ++ poke-fuse |= k=kiln-fuse - abet:(emit [%pass /kiln/fuse/[syd.k] %arvo %c [%fuse syd.k srcs.k]]) + abet:(emit [%pass /kiln/fuse/[syd.k] %arvo %c [%fuse syd.k bas.k con.k]]) :: ++ poke-cancel |= a=@tas diff --git a/pkg/arvo/sys/lull.hoon b/pkg/arvo/sys/lull.hoon index bc8c55287..1cac3043b 100644 --- a/pkg/arvo/sys/lull.hoon +++ b/pkg/arvo/sys/lull.hoon @@ -764,8 +764,8 @@ == :: $: %fuse :: mega merge des=desk :: target desk - ful=(list beak) :: source desks - gim=(list germ) :: strategies + bas=beak :: base desk + con=(list [beak germ]) :: merges == [%mont pot=term bem=beam] :: mount to unix [%dirk des=desk] :: mark mount dirty diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 5aff31999..086ed0249 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -1976,43 +1976,29 @@ (turn con |=(a=[beak germ] [-.a *(unit dome:clay)])) :: ++ start-fuse - |= [ful=(list beak) gim=(list germ)] + |= [bas=beak con=(list [beak germ])] ^+ ..start-fuse - :: must have n sources and n-1 gems - ?> =((lent ful) +((lent gim))) =/ moves=(list move) %+ turn - ful - |= bec=beak + [[bas *germ] con] + |= [bec=beak germ] ^- move =/ wir=wire /fuse/[syd]/(scot %p p.bec)/[q.bec]/(scot r.bec) [hen %pass wir %c %warp p.bec q.bec `[%sing %v r.bec /]] - ?~ ful - !! - =/ base=beak i.ful - =/ ful=(list beak) t.ful - =/ con=(list [beak germ]) - =| acc=(list [beak germ]) - |- - ?~ ful - acc - ?~ gim - !! - $(acc [[i.ful i.gim] acc], ful t.ful, gim t.gim) :: we also want to clear the state (fiz) associated with this :: merge and print a warning if it's non trivial i.e. we're :: starting a new fuse before the previous one terminated. ~& ?~ con.fiz - [%starting-fuse base con] + [%starting-fuse bas con] :* %starting-fuse - base + bas con %discarding-state :: we don't want to ~& an entire dome %- ~(run by sto.fiz) |=(v=(unit dome:clay) ?~(v %not-received %recieved)) == - =. fiz (make-melt base con) + =. fiz (make-melt bas con) (emil moves) :: ++ take-fuse @@ -4238,7 +4224,7 @@ ~&(%fuse-no-desk !!) =^ mos ruf =/ den ((de now rof hen ruf) our des.req) - abet:(start-fuse:den ful.req gim.req) + abet:(start-fuse:den bas.req con.req) [mos ..^$] :: %mont @@ -4570,7 +4556,7 @@ abet:(merge:den ali-ship ali-desk germ p.hin) [mos ..^$] :: - ?: ?=([%fuse @ @ @ @ @ ~] tea) + ?: ?=([%fuse @ @ @ @ ~] tea) ?> ?=(%writ +<.hin) =* syd i.t.tea =/ ali-ship=@p (slav %p i.t.t.tea) From 8cbacb2545b1126b3d55797537364f71d764a4af Mon Sep 17 00:00:00 2001 From: raghu <{ID}+{username}@users.noreply.github.com> Date: Sun, 25 Apr 2021 10:49:30 -0400 Subject: [PATCH 36/62] clay: allow successive upgrades --- pkg/arvo/sys/vane/clay.hoon | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 086ed0249..eb36d55e5 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -4102,7 +4102,7 @@ :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: =| :: instrument state - $: ver=%7 :: vane version + $: ver=%8 :: vane version ruf=raft :: revision tree == :: |= [now=@da eny=@uvJ rof=roof] :: current invocation @@ -4433,8 +4433,9 @@ |= old=raft-any |^ =? old ?=(%6 -.old) 7+(raft-6-to-7 +.old) - ?> ?=(%7 -.old) - ..^^$(ruf (raft-7-to-8 +.old)) + =? old ?=(%7 -.old) 8+(raft-7-to-8 +.old) + ?> ?=(%8 -.old) + ..^^$(ruf +.old) :: +raft-6-to-7: delete stale ford caches (they could all be invalid) :: ++ raft-6-to-7 From 919450b0c62fa140cea2f2067b25144915bb1f6d Mon Sep 17 00:00:00 2001 From: raghu <{ID}+{username}@users.noreply.github.com> Date: Sun, 25 Apr 2021 14:23:06 -0400 Subject: [PATCH 37/62] fuse: update help text --- pkg/arvo/gen/hood/fuse/help.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/arvo/gen/hood/fuse/help.txt b/pkg/arvo/gen/hood/fuse/help.txt index 32431f5cd..9e18eb80e 100644 --- a/pkg/arvo/gen/hood/fuse/help.txt +++ b/pkg/arvo/gen/hood/fuse/help.txt @@ -1,6 +1,6 @@ Usage: - |fuse %destination-desk ~[[source-beak %some-germ] [another-beak %another-germ]] + |fuse %destination-desk base-beak ~[[source-beak %some-germ] [another-beak %another-germ]] A fuse replaces the contents of %destination-desk with the merge of the specified beaks according to their merge strategies. This has no dependence From 0a71b75550aae8309cab8e56f5dc82d3e7a67b2d Mon Sep 17 00:00:00 2001 From: fang Date: Mon, 26 Apr 2021 19:36:43 +0200 Subject: [PATCH 38/62] tests: update clay tests to account for #4745 It had changed the shape of some data structures, but hadn't updated the tests to reflect that. --- pkg/arvo/tests/sys/vane/clay.hoon | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pkg/arvo/tests/sys/vane/clay.hoon b/pkg/arvo/tests/sys/vane/clay.hoon index 636efd3a3..7f0e96542 100644 --- a/pkg/arvo/tests/sys/vane/clay.hoon +++ b/pkg/arvo/tests/sys/vane/clay.hoon @@ -23,7 +23,7 @@ =/ src "." %+ expect-eq !> ^- pile:fusion - :* ~ ~ ~ ~ ~ ~ + :* ~ ~ ~ ~ ~ ~ ~ tssg+[%dbug [/sur/foo/hoon [[1 1] [1 2]]] [%cnts ~[[%.y 1]] ~]]~ == !> (parse-pile:(ford):fusion /sur/foo/hoon src) @@ -32,7 +32,7 @@ =/ src "/% moo %mime\0a." %+ expect-eq !> ^- pile:fusion - :* sur=~ lib=~ raw=~ + :* sur=~ lib=~ raw=~ raz=~ maz=[face=%moo mark=%mime]~ caz=~ bar=~ tssg+[%dbug [/sur/foo/hoon [[2 1] [2 2]]] [%cnts ~[[%.y 1]] ~]]~ @@ -43,7 +43,7 @@ =/ src "/$ goo %mime %txt\0a." %+ expect-eq !> ^- pile:fusion - :* sur=~ lib=~ raw=~ maz=~ + :* sur=~ lib=~ raw=~ raz=~ maz=~ caz=[face=%goo from=%mime to=%txt]~ bar=~ tssg+[%dbug [/sur/foo/hoon [[2 1] [2 2]]] [%cnts ~[[%.y 1]] ~]]~ @@ -74,7 +74,7 @@ [`%hood-drum %hood-drum] [`%hood-write %hood-write] == - raw=~ maz=~ caz=~ bar=~ + raw=~ raz=~ maz=~ caz=~ bar=~ tssg+[%dbug [/sur/foo/hoon [[10 1] [10 2]]] [%cnts ~[[%.y 1]] ~]]~ == !> (parse-pile:(ford):fusion /sur/foo/hoon src) @@ -115,7 +115,7 @@ (slap res limb/%bunt) :: %+ expect-eq - !> (~(gas in *(set path)) /mar/mime/hoon ~) + !> (~(gas in *(set [? path])) |^/mar/mime/hoon ~) !> dez:(~(got by files.cache.nub) /mar/mime/hoon) == :: @@ -142,7 +142,7 @@ (slap res limb/%bunt) :: %+ expect-eq - !> (~(gas in *(set path)) /mar/udon/hoon /lib/cram/hoon ~) + !> (~(gas in *(set [? path])) |^/mar/udon/hoon |^/lib/cram/hoon ~) !> dez:(~(got by files.cache.nub) /mar/udon/hoon) == :: @@ -224,7 +224,7 @@ (slap res (ream '(+ [*^ [%bob ~] ~])')) :: %+ expect-eq - !> (~(gas in *(set path)) /gen/hello/hoon ~) + !> (~(gas in *(set [? path])) |^/gen/hello/hoon ~) !> dez:(~(got by files.cache.nub) /gen/hello/hoon) == :: @@ -249,10 +249,10 @@ !>((slab %read %get-our -.res)) :: %+ expect-eq - !> %- ~(gas in *(set path)) - :~ /lib/strandio/hoon - /lib/strand/hoon - /sur/spider/hoon + !> %- ~(gas in *(set [? path])) + :~ [| /lib/strandio/hoon] + [| /lib/strand/hoon] + [| /sur/spider/hoon] == !> dez:(~(got by files.cache.nub) /lib/strandio/hoon) == From d95696f29cd4927e2ccdb028810d468950823600 Mon Sep 17 00:00:00 2001 From: fang Date: Mon, 26 Apr 2021 19:40:26 +0200 Subject: [PATCH 39/62] tests: update format tests to account for #4677 It had changed ship encoding to fit into a json %n, but hadn't updated the tests to reflect this. --- pkg/arvo/tests/sys/zuse/format.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/arvo/tests/sys/zuse/format.hoon b/pkg/arvo/tests/sys/zuse/format.hoon index a8ee826a4..dddc9ef2e 100644 --- a/pkg/arvo/tests/sys/zuse/format.hoon +++ b/pkg/arvo/tests/sys/zuse/format.hoon @@ -187,7 +187,7 @@ :: ship - store ship identity as a string :: %+ expect-eq - !> [%s 'zod'] + !> [%n '"zod"'] !> (ship ~zod) == :: dejs - recursive processing of `json` values From dd6eeccdae2ff96bc3f81bfa051e662fe56156b7 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Wed, 28 Apr 2021 16:12:46 -0500 Subject: [PATCH 40/62] zuse: update names of +subset to +lot, +peek to +pry, remove unnecessary comments --- pkg/arvo/app/graph-store.hoon | 10 +- pkg/arvo/app/hark-graph-hook.hoon | 2 +- pkg/arvo/gen/tally.hoon | 6 +- pkg/arvo/sys/vane/ames.hoon | 6 +- pkg/arvo/sys/vane/behn.hoon | 4 +- pkg/arvo/sys/zuse.hoon | 170 +++++++++++------------ pkg/arvo/tests/sys/zuse/ordered-map.hoon | 24 ++-- 7 files changed, 104 insertions(+), 118 deletions(-) diff --git a/pkg/arvo/app/graph-store.hoon b/pkg/arvo/app/graph-store.hoon index 87f464480..961df6660 100644 --- a/pkg/arvo/app/graph-store.hoon +++ b/pkg/arvo/app/graph-store.hoon @@ -918,7 +918,7 @@ :+ %add-nodes [ship term] %- ~(gas by *(map index:store node:store)) - %+ turn (tap:orm `graph:store`(subset:orm p.u.graph start end)) + %+ turn (tap:orm `graph:store`(lot:orm p.u.graph start end)) |= [=atom =node:store] ^- [index:store node:store] [~[atom] node] @@ -971,7 +971,7 @@ %+ turn =- ?.(older (slag (safe-sub (lent -) count) -) (scag count -)) %- tap:orm - %+ subset:orm u.graph + %+ lot:orm u.graph =/ idx (snag (dec (lent index)) index) ?:(older [`idx ~] [~ `idx]) @@ -1024,7 +1024,7 @@ :+ %add-nodes [ship term] %- ~(gas by *(map index:store node:store)) - %+ turn (tap:orm `graph:store`(subset:orm p.children.u.node end start)) + %+ turn (tap:orm `graph:store`(lot:orm p.children.u.node end start)) |= [=atom =node:store] ^- [index:store node:store] [(snoc index atom) node] @@ -1038,7 +1038,7 @@ =/ update-log=(unit update-log:store) (~(get by update-logs) [ship term]) ?~ update-log [~ ~] :: orm-log is ordered backwards, so swap start and end - ``noun+!>((subset:orm-log u.update-log end start)) + ``noun+!>((lot:orm-log u.update-log end start)) :: [%x %update-log @ @ ~] =/ =ship (slav %p i.t.t.path) @@ -1056,7 +1056,7 @@ %+ biff m-update-log |= =update-log:store =/ result=(unit [=time =update:store]) - (peek:orm-log:store update-log) + (pry:orm-log:store update-log) (bind result |=([=time update:store] time)) == :: diff --git a/pkg/arvo/app/hark-graph-hook.hoon b/pkg/arvo/app/hark-graph-hook.hoon index 3e779a8bc..379633908 100644 --- a/pkg/arvo/app/hark-graph-hook.hoon +++ b/pkg/arvo/app/hark-graph-hook.hoon @@ -256,7 +256,7 @@ =/ graph=graph:graph-store :: graph in subscription is bunted (get-graph-mop:gra rid) =/ node=(unit node:graph-store) - (bind (peek:orm:graph-store graph) |=([@ =node:graph-store] node)) + (bind (pry:orm:graph-store graph) |=([@ =node:graph-store] node)) =^ cards state (check-nodes (drop node) rid) ?. (should-watch:ha rid) diff --git a/pkg/arvo/gen/tally.hoon b/pkg/arvo/gen/tally.hoon index fbaf04e0a..b7289c2c1 100644 --- a/pkg/arvo/gen/tally.hoon +++ b/pkg/arvo/gen/tally.hoon @@ -1,5 +1,5 @@ /- gr=group, md=metadata-store, ga=graph-store -/+ re=resource +/+ re=resource, graph=graph-store !: :- %say |= $: [now=@da eny=@uvJ =beak] @@ -85,9 +85,9 @@ %+ scry update:ga [%x %graph-store /graph/(scot %p entity.r)/[name.r]/noun] ?> ?=(%add-graph -.q.upd) - =/ mo ((ordered-map atom node:ga) gth) + =* mo orm:graph =/ week=(list [@da node:ga]) - (tap:mo (subset:mo graph.q.upd ~ `(sub now ~d7))) + (tap:mo (lot:mo graph.q.upd ~ `(sub now ~d7))) :- (lent week) %~ wyt in %+ roll week diff --git a/pkg/arvo/sys/vane/ames.hoon b/pkg/arvo/sys/vane/ames.hoon index 79d84446f..b8b12f091 100644 --- a/pkg/arvo/sys/vane/ames.hoon +++ b/pkg/arvo/sys/vane/ames.hoon @@ -2535,7 +2535,7 @@ ++ assert ^+ message-pump =/ top-live - (peek:packet-queue:*make-packet-pump live.packet-pump-state.state) + (pry:packet-queue:*make-packet-pump live.packet-pump-state.state) ?. |(?=(~ top-live) (lte current.state message-num.key.u.top-live)) ~| [%strange-current current=current.state key.u.top-live] !! @@ -2804,10 +2804,10 @@ :: ++ set-wake ^+ packet-pump - :: if nonempty .live, peek at head to get next wake time + :: if nonempty .live, pry at head to get next wake time :: =/ new-wake=(unit @da) - ?~ head=(peek:packet-queue live.state) + ?~ head=(pry:packet-queue live.state) ~ `(next-expiry:gauge u.head) :: no-op if no change diff --git a/pkg/arvo/sys/vane/behn.hoon b/pkg/arvo/sys/vane/behn.hoon index 3933c22e6..afff958ea 100644 --- a/pkg/arvo/sys/vane/behn.hoon +++ b/pkg/arvo/sys/vane/behn.hoon @@ -186,7 +186,7 @@ =* timers timers.state :: if no timers, cancel existing wakeup timer or no-op :: - =/ first=(unit [date=@da *]) (peek:timer-map timers.state) + =/ first=(unit [date=@da *]) (pry:timer-map timers.state) ?~ first ?~ next-wake event-core @@ -351,7 +351,7 @@ [%timers %next ~] :^ ~ ~ %noun !> ^- (unit @da) - (bind (peek:timer-map timers) head) + (bind (pry:timer-map timers) head) :: [%timers @ ~] ?~ til=(slaw %da i.t.tyl) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index 2e5f4b98e..a843d4ed0 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5150,11 +5150,9 @@ ~/ %bap |= a=(tree item) ^- (list item) - :: =| b=(list item) |- ^+ b ?~ a b - :: $(a r.a, b [n.a $(a l.a)]) :: +del: delete .key from .a if it exists, producing value iff deleted :: @@ -5162,7 +5160,6 @@ ~/ %del |= [a=(tree item) =key] ^- [(unit val) (tree item)] - :: ?~ a [~ ~] :: we found .key at the root; delete and rebalance :: @@ -5276,90 +5273,11 @@ |= [a=(tree item) b=key] ^- ? !=(~ (get a b)) - :: +nip: remove root; for internal use - :: - ++ nip - ~/ %nip - |= a=(tree item) - ^- (tree item) - :: - ?> ?=(^ a) - :: delete .n.a; merge and balance .l.a and .r.a - :: - |- ^- (tree item) - ?~ l.a r.a - ?~ r.a l.a - ?: (mor key.n.l.a key.n.r.a) - l.a(r $(l.a r.l.a)) - r.a(l $(r.a l.r.a)) - :: +peek: produce head (smallest item) or null - :: - ++ peek - ~/ %peek - |= a=(tree item) - ^- (unit item) - :: - ?~ a ~ - ?~ l.a `n.a - $(a l.a) - :: - :: +pop: produce .head (smallest item) and .rest or crash if empty - :: - ++ pop - ~/ %pop - |= a=(tree item) - ^- [head=item rest=(tree item)] - :: - ?~ a !! - ?~ l.a [n.a r.a] - :: - =/ l $(a l.a) - :- head.l - :: load .rest.l back into .a and rebalance - :: - ?: |(?=(~ rest.l) (mor key.n.a key.n.rest.l)) - a(l rest.l) - rest.l(r a(r r.rest.l)) - :: +put: ordered item insert - :: - ++ put - ~/ %put - |= [a=(tree item) =key =val] - ^- (tree item) - :: base case: replace null with single-item tree - :: - ?~ a [n=[key val] l=~ r=~] - :: base case: overwrite existing .key with new .val - :: - ?: =(key.n.a key) a(val.n val) - :: if item goes on left, recurse left then rebalance vertical order - :: - ?: (compare key key.n.a) - =/ l $(a l.a) - ?> ?=(^ l) - ?: (mor key.n.a key.n.l) - a(l l) - l(r a(l r.l)) - :: item goes on right; recurse right then rebalance vertical order - :: - =/ r $(a r.a) - ?> ?=(^ r) - ?: (mor key.n.a key.n.r) - a(r r) - r(l a(r l.r)) - :: +run: apply gate to transform all values in place - :: - ++ run - ~/ %run - |* [a=(tree item) b=$-(val *)] - |- - ?~ a a - [n=[key.n.a (b val.n.a)] l=$(a l.a) r=$(a r.a)] - :: +subset: take a range excluding start and/or end and all elements + :: +lot: take a subset range excluding start and/or end and all elements :: outside the range :: - ++ subset - ~/ %subset + ++ lot + ~/ %lot |= $: tre=(tree item) start=(unit key) end=(unit key) @@ -5405,17 +5323,90 @@ $(a (nip a(r ~))) == -- + :: +nip: remove root; for internal use + :: + ++ nip + ~/ %nip + |= a=(tree item) + ^- (tree item) + ?> ?=(^ a) + :: delete .n.a; merge and balance .l.a and .r.a + :: + |- ^- (tree item) + ?~ l.a r.a + ?~ r.a l.a + ?: (mor key.n.l.a key.n.r.a) + l.a(r $(l.a r.l.a)) + r.a(l $(r.a l.r.a)) + :: + :: +pop: produce .head (smallest item) and .rest or crash if empty + :: + ++ pop + ~/ %pop + |= a=(tree item) + ^- [head=item rest=(tree item)] + ?~ a !! + ?~ l.a [n.a r.a] + =/ l $(a l.a) + :- head.l + :: load .rest.l back into .a and rebalance + :: + ?: |(?=(~ rest.l) (mor key.n.a key.n.rest.l)) + a(l rest.l) + rest.l(r a(r r.rest.l)) + :: +pry: produce head (smallest item) or null + :: + ++ pry + ~/ %pry + |= a=(tree item) + ^- (unit item) + ?~ a ~ + ?~ l.a `n.a + $(a l.a) + :: +put: ordered item insert + :: + ++ put + ~/ %put + |= [a=(tree item) =key =val] + ^- (tree item) + :: base case: replace null with single-item tree + :: + ?~ a [n=[key val] l=~ r=~] + :: base case: overwrite existing .key with new .val + :: + ?: =(key.n.a key) a(val.n val) + :: if item goes on left, recurse left then rebalance vertical order + :: + ?: (compare key key.n.a) + =/ l $(a l.a) + ?> ?=(^ l) + ?: (mor key.n.a key.n.l) + a(l l) + l(r a(l r.l)) + :: item goes on right; recurse right then rebalance vertical order + :: + =/ r $(a r.a) + ?> ?=(^ r) + ?: (mor key.n.a key.n.r) + a(r r) + r(l a(r l.r)) + :: +run: apply gate to transform all values in place + :: + ++ run + ~/ %run + |* [a=(tree item) b=$-(val *)] + |- + ?~ a a + [n=[key.n.a (b val.n.a)] l=$(a l.a) r=$(a r.a)] :: +tap: convert to list, smallest to largest :: ++ tap ~/ %tap |= a=(tree item) ^- (list item) - :: =| b=(list item) |- ^+ b ?~ a b - :: $(a l.a, b [n.a $(a r.a)]) :: +uni: unify two ordered maps :: @@ -5425,19 +5416,14 @@ ~/ %uni |= [a=(tree item) b=(tree item)] ^- (tree item) - :: ?~ b a ?~ a b ?: =(key.n.a key.n.b) - :: [n=n.b l=$(a l.a, b l.b) r=$(a r.a, b r.b)] - :: ?: (mor key.n.a key.n.b) - :: ?: (compare key.n.b key.n.a) $(l.a $(a l.a, r.b ~), b r.b) $(r.a $(a r.a, l.b ~), b l.b) - :: ?: (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) diff --git a/pkg/arvo/tests/sys/zuse/ordered-map.hoon b/pkg/arvo/tests/sys/zuse/ordered-map.hoon index 94b4628b3..4191d3e7e 100644 --- a/pkg/arvo/tests/sys/zuse/ordered-map.hoon +++ b/pkg/arvo/tests/sys/zuse/ordered-map.hoon @@ -35,13 +35,13 @@ !> [[0 %a] (gas:atom-map ~ (items-from-keys (gulf 1 6)))] !> (pop:atom-map a) :: -++ test-ordered-map-peek ^- tang +++ test-ordered-map-pry ^- tang :: =/ a=(tree [@ud @tas]) (gas:atom-map ~ test-items) :: %+ expect-eq !> `[0 %a] - !> (peek:atom-map a) + !> (pry:atom-map a) :: ++ test-ordered-map-nip ^- tang :: @@ -53,51 +53,51 @@ !> (gas:atom-map ~ ~[[0^%a] [1^%b] [2^%c] [3^%d] [4^%e] [5^%f]]) !> b :: -++ test-ordered-map-subset ^- tang +++ test-ordered-map-lot ^- tang :: =/ a=(tree [@ud @tas]) (gas:atom-map ~ test-items) :: - =/ b (subset:atom-map a `0 `4) + =/ b (lot:atom-map a `0 `4) :: %+ expect-eq !> (gas:atom-map ~ ~[[1^%b] [2^%c] [3^%d]]) !> b :: -++ test-ordered-map-null-start-subset ^- tang +++ test-ordered-map-null-start-lot ^- tang :: =/ a=(tree [@ud @tas]) (gas:atom-map ~ test-items) :: - =/ b (subset:atom-map a ~ `5) + =/ b (lot:atom-map a ~ `5) :: %+ expect-eq !> (gas:atom-map ~ ~[[0^%a] [1^%b] [2^%c] [3^%d] [4^%e]]) !> b :: -++ test-ordered-map-null-end-subset ^- tang +++ test-ordered-map-null-end-lot ^- tang :: =/ a=(tree [@ud @tas]) (gas:atom-map ~ test-items) :: - =/ b (subset:atom-map a `1 ~) + =/ b (lot:atom-map a `1 ~) :: %+ expect-eq !> (gas:atom-map ~ ~[[2^%c] [3^%d] [4^%e] [5^%f] [6^%g]]) !> b :: -++ test-ordered-map-double-null-subset ^- tang +++ test-ordered-map-double-null-lot ^- tang :: =/ a=(tree [@ud @tas]) (gas:atom-map ~ test-items) :: - =/ b (subset:atom-map a ~ ~) + =/ b (lot:atom-map a ~ ~) :: %+ expect-eq !> (gas:atom-map ~ ~[[0^%a] [1^%b] [2^%c] [3^%d] [4^%e] [5^%f] [6^%g]]) !> b :: -++ test-ordered-map-not-found-start-subset ^- tang +++ test-ordered-map-not-found-start-lot ^- tang :: =/ a=(tree [@ud @tas]) (gas:atom-map ~ ~[[1^%b]]) :: - =/ b (subset:atom-map a `0 ~) + =/ b (lot:atom-map a `0 ~) :: %+ expect-eq !> (gas:atom-map ~ ~[[1^%b]]) From 7b7e9e310491508d2f601af0836b7ee2b9264174 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Wed, 28 Apr 2021 23:12:57 -0700 Subject: [PATCH 41/62] clay: fix requests for strange cares over ames Four changes: - implement +validate-u to allow %u requests over the network - make +validate-x use our local marks to make %x requests generally work over the network - in +start-request, if a foreign ship is making a request that we shouldn't send over the network, ignore it. This closes a DOS vector. - in +duce, if we're about to make a request to a foreign ship which they won't be able to answer, crash the event. Combined, these fix many of the common cases of weirdness around foreign clay requests. Notably absent is a fix for reading `%a` across the network, which I still maintain should happen against the foreign hoon/zuse. fixes #4834 see also #4307 --- pkg/arvo/sys/vane/clay.hoon | 46 +++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index af2f65303..355b504d9 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -1256,6 +1256,24 @@ =/ =path [%question desk (scot %ud index) ~] (emit duct %pass wire %a %plea ship %c path `riff-any`[%1 riff]) :: + ++ foreign-capable + |= =rave + |^ + ?- -.rave + %many & + %sing (good-care care.mood.rave) + %next (good-care care.mood.rave) + %mult + %- ~(all in paths.mool.rave) + |= [=care =path] + (good-care care) + == + :: + ++ good-care + |= =care + (~(has in ^~((silt `(list ^care)`~[%u %w %x %y %z]))) care) + -- + :: :: Create a request that cannot be filled immediately. :: :: If it's a local request, we just put in in `qyx`, setting a timer if it's @@ -1275,6 +1293,10 @@ =. rave ?. ?=([%sing %v *] rave) rave [%many %| [%ud let.dom] case.mood.rave path.mood.rave] + :: + ?. (foreign-capable rave) + ~|([%clay-bad-foreign-request-care rave] !!) + :: =+ inx=nix.u.ref =. +>+.$ =< ?>(?=(^ ref) .) @@ -2665,6 +2687,9 @@ ++ start-request |= [for=(unit [ship @ud]) rav=rave] ^+ ..start-request + ?: &(?=(^ for) !(foreign-capable rav)) + ~& [%bad-foreign-request-care from=for rav] + ..start-request =^ [new-sub=(unit rove) sub-results=(list sub-result)] fod.dom (try-fill-sub for (rave-to-rove rav)) =. ..start-request (send-sub-results sub-results [hen ~ ~]) @@ -2721,14 +2746,23 @@ %r ~| %no-cages-please-they-are-just-way-too-big !! %s ~| %please-dont-get-your-takos-over-a-network !! %t ~| %requesting-foreign-directory-is-vaporware !! - %u ~| %prolly-poor-idea-to-get-rang-over-network !! %v ~| %weird-shouldnt-get-v-request-from-network !! - %z `(validate-z r.rand) + %u `(validate-u r.rand) %w `(validate-w r.rand) %x (validate-x [p.p q.p q r]:rand) %y `[p.r.rand !>(;;(arch q.r.rand))] + %z `(validate-z r.rand) == :: + :: Make sure the incoming data is a %u response + :: + ++ validate-u + |= =page + ^- cage + ?> ?=(%flag p.page) + :- p.page + !> ;;(? q.page) + :: :: Make sure the incoming data is a %w response :: ++ validate-w @@ -2749,7 +2783,11 @@ =/ vale-result %- mule |. %- wrap:fusion - (page-to-cage:(ford:fusion static-ford-args) peg) + :: Use %home's marks to validate, so we don't have to build the + :: foreign hoon/zuse + :: + =/ args %*(static-ford-args . dom dom:(~(got by dos.rom) %home)) + (page-to-cage:(ford:fusion args) peg) ?: ?=(%| -.vale-result) %- (slog >%validate-x-failed< p.vale-result) ~ @@ -2762,7 +2800,7 @@ ^- cage ?> ?=(%uvi p.page) :- p.page - !>(;;(@uvI q.page)) + !> ;;(@uvI q.page) -- :: :: Respond to backfill request From baa06904f69a1c8e22048f47f38ad68e9b7d556e Mon Sep 17 00:00:00 2001 From: raghu <{ID}+{username}@users.noreply.github.com> Date: Sat, 1 May 2021 23:04:19 -0400 Subject: [PATCH 42/62] fuse: print help text in generator --- pkg/arvo/gen/hood/fuse.hoon | 7 +++++-- pkg/arvo/lib/hood/kiln.hoon | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/gen/hood/fuse.hoon b/pkg/arvo/gen/hood/fuse.hoon index 03effe5c8..870b38d2a 100644 --- a/pkg/arvo/gen/hood/fuse.hoon +++ b/pkg/arvo/gen/hood/fuse.hoon @@ -8,5 +8,8 @@ :::: :: :- %say -|= [[now=@da eny=@uvJ bec=beak] [des=desk bas=beak con=(list [beak germ]) ~] ~] -[%kiln-fuse des bas con] +|= [[now=@da eny=@uvJ bec=beak] [arg=[?(~ [des=desk bas=beak con=(list [beak germ]) ~])]] ~] +:- %kiln-fuse +?~ arg + ((slog (turn `wain`help-text |=(=@t leaf+(trip t)))) ~) +[des bas con]:arg diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index 8700670bc..9f541bacd 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -56,6 +56,7 @@ gim=?(%auto germ) :: == +$ kiln-fuse + $@ ~ $: syd=desk bas=beak con=(list [beak germ]) @@ -388,6 +389,7 @@ :: ++ poke-fuse |= k=kiln-fuse + ?~ k abet abet:(emit [%pass /kiln/fuse/[syd.k] %arvo %c [%fuse syd.k bas.k con.k]]) :: ++ poke-cancel From 75ed2cc0af8612747174feff32b5a610bb75c107 Mon Sep 17 00:00:00 2001 From: raghu <{ID}+{username}@users.noreply.github.com> Date: Sun, 2 May 2021 13:44:18 -0400 Subject: [PATCH 43/62] fuse: c/r --- pkg/arvo/sys/lull.hoon | 2 +- pkg/arvo/sys/vane/clay.hoon | 151 +++++++++++++++++------------------- 2 files changed, 73 insertions(+), 80 deletions(-) diff --git a/pkg/arvo/sys/lull.hoon b/pkg/arvo/sys/lull.hoon index 1cac3043b..806eadbc4 100644 --- a/pkg/arvo/sys/lull.hoon +++ b/pkg/arvo/sys/lull.hoon @@ -762,7 +762,7 @@ her=@p dem=desk cas=case :: source how=germ :: method == :: - $: %fuse :: mega merge + $: %fuse :: merge many des=desk :: target desk bas=beak :: base desk con=(list [beak germ]) :: merges diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index eb36d55e5..35e94c657 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -1972,104 +1972,116 @@ |= [bas=beak con=(list [beak germ])] ^- melt :+ bas con - %- ~(gas by (~(put by *(map beak (unit dome:clay))) bas *(unit dome:clay))) + %- ~(gas by *(map beak (unit dome:clay))) + :- [bas *(unit dome:clay)] (turn con |=(a=[beak germ] [-.a *(unit dome:clay)])) :: ++ start-fuse |= [bas=beak con=(list [beak germ])] ^+ ..start-fuse =/ moves=(list move) - %+ turn - [[bas *germ] con] - |= [bec=beak germ] - ^- move - =/ wir=wire /fuse/[syd]/(scot %p p.bec)/[q.bec]/(scot r.bec) - [hen %pass wir %c %warp p.bec q.bec `[%sing %v r.bec /]] + %+ turn + [[bas *germ] con] + |= [bec=beak germ] + ^- move + =/ wir=wire /fuse/[syd]/(scot %p p.bec)/[q.bec]/(scot r.bec) + [hen %pass wir %c %warp p.bec q.bec `[%sing %v r.bec /]] + :: :: we also want to clear the state (fiz) associated with this :: merge and print a warning if it's non trivial i.e. we're :: starting a new fuse before the previous one terminated. - ~& ?~ con.fiz - [%starting-fuse bas con] - :* %starting-fuse - bas - con - %discarding-state - :: we don't want to ~& an entire dome - %- ~(run by sto.fiz) - |=(v=(unit dome:clay) ?~(v %not-received %recieved)) - == + :: + =/ err=tang + ?~ con.fiz + ~ + =/ discarded=tang + %+ turn + ~(tap in sto.fiz) + |= [k=beak v=(unit dome:clay)] + ^- tank + =/ received=tape ?~(v "missing" "received") + leaf+"{} {received}" + :- leaf+"fusing into {} from {} {} - overwriting prior fuse" + discarded =. fiz (make-melt bas con) - (emil moves) + ((slog err) (emil moves)) :: ++ take-fuse |= [bec=beak =riot] ^+ ..take-fuse ?~ riot - ~& [%fuse-for syd %missing bec] + :: :: by setting fiz to *melt the merge is aborted - any further :: responses we get for the merge will cause take-fuse to crash + :: =. fiz *melt - ..take-fuse + ((slog [leaf+"clay: fuse failed, missing {}"]~) ..take-fuse) ?> (~(has by sto.fiz) bec) =. fiz :+ bas.fiz con.fiz (~(put by sto.fiz) bec `!<(dome:clay q.r.u.riot)) =/ all-done=flag - %- ~(all by sto.fiz) - |= res=(unit dome:clay) - ^- flag - !=(res ~) + %- ~(all by sto.fiz) + |= res=(unit dome:clay) + ^- flag + !=(res ~) ?. all-done ..take-fuse =| rag=rang =/ clean-hut-ran hut.ran =/ initial-dome=dome:clay (need (~(got by sto.fiz) bas.fiz)) =/ continuation-yaki=yaki - (~(got by hut.ran) (~(got by hit.initial-dome) let.initial-dome)) + (~(got by hut.ran) (~(got by hit.initial-dome) let.initial-dome)) =/ parents=(list tako) ~[(~(got by hit.initial-dome) let.initial-dome)] =/ merges con.fiz + :: + :: We must ensure that we don't leave garbage around. + :: In all cases we want to clear fiz and restore hut.ran + :: to clean-hut-ran. + :: |- ^+ ..take-fuse ?~ merges - :: reset fiz before potentially parking - we hope to - :: succeed so we don't need this state anymore. + =/ t=tang [leaf+"{} fused from {} {}" ~] =. fiz *melt =. hut.ran clean-hut-ran - (park | [%| continuation-yaki(p (flop parents))] rag) + =. ..take-fuse (park | [%| continuation-yaki(p (flop parents))] rag) + (done %| %fuse-succeded t) =/ [bec=beak g=germ] i.merges =/ ali-dom=dome:clay (need (~(got by sto.fiz) bec)) =/ result (merge-helper p.bec q.bec g ali-dom `continuation-yaki) - ?- -.result + ?- -.result %| - :: merge failed - (mean %fuse-merge-failed p.result) + =. fiz *melt + =. hut.ran clean-hut-ran + (done %| %fuse-merge-failed p.result) :: %& - :: now we have a unit merge-result =/ merge-result=(unit merge-result) +.result ?~ merge-result :: this merge was a no-op, just continue $(merges t.merges) ?~ conflicts.u.merge-result - :: no merge conflicts =/ merged-yaki=yaki - ?- -.new.u.merge-result - %| - +.new.u.merge-result - :: - %& - :: convert the yuki to yaki - =/ yuk=yuki +.new.u.merge-result - =/ lobes=(map path lobe) - %- ~(run by q.yuk) - |= val=(each page lobe) - ^- lobe - ?- -.val - %& (page-to-lobe +.val) - %| +.val - == - (make-yaki p.yuk lobes now) - == + ?- -.new.u.merge-result + %| + +.new.u.merge-result + :: + %& + :: + :: convert the yuki to yaki + :: + =/ yuk=yuki +.new.u.merge-result + =/ lobes=(map path lobe) + %- ~(run by q.yuk) + |= val=(each page lobe) + ^- lobe + ?- -.val + %& (page-to-lobe +.val) + %| +.val + == + (make-yaki p.yuk lobes now) + == %= $ continuation-yaki merged-yaki merges t.merges @@ -2077,8 +2089,11 @@ lat.rag (~(uni by lat.rag) lat.u.merge-result) parents [(~(got by hit.ali-dom) let.ali-dom) parents] == + :: :: if there are merge conflicts send the error and abort the merge + :: =. fiz *melt + =. hut.ran clean-hut-ran (done %& conflicts.u.merge-result) == :: @@ -2094,8 +2109,8 @@ (done %| %ali-unavailable ~[>[ali-ship ali-desk germ]<]) =/ ali-dome=dome:clay !<(dome:clay q.r.u.riot) =/ result=(each (unit merge-result) (pair term tang)) - (merge-helper ali-ship ali-desk germ ali-dome ~) - ?- -.result + (merge-helper ali-ship ali-desk germ ali-dome ~) + ?- -.result %| (done %| +.result) :: @@ -2119,11 +2134,11 @@ ^- (each (unit merge-result) [term tang]) =/ ali-yaki=yaki (~(got by hut.ran) (~(got by hit.ali-dome) let.ali-dome)) =/ bob-yaki=(unit yaki) - ?~ continuation-yaki - ?~ let.dom - ~ - (~(get by hut.ran) (~(got by hit.dom) let.dom)) - continuation-yaki + ?~ continuation-yaki + ?~ let.dom + ~ + (~(get by hut.ran) (~(got by hit.dom) let.dom)) + continuation-yaki (merge-by-germ ali-yaki bob-yaki) ++ merge-by-germ |= [=ali=yaki bob-yaki=(unit yaki)] @@ -3516,7 +3531,6 @@ :: :: Creates a nako of all the changes between a and b. :: - :: ++ make-nako |= [ver=@ud a=aeon b=aeon] ^- nako @@ -3565,24 +3579,6 @@ =. s ^$(p i.p.y) $(p.y t.p.y) :: - :: Gets the data between two commit hashes, assuming the first is an - :: ancestor of the second. - :: - :: Get all the takos before `a`, then get all takos before `b` except the - :: ones we found before `a`. Then convert the takos to yakis and also get - :: all the data in all the yakis. - :: - :: What happens if you run an %init merge on a desk that already - :: had a commit? - :: - ++ data-twixt-takos - |= [plops=? a=(unit tako) b=tako] - ^- [(set yaki) (set plop)] - =+ old=?~(a ~ (reachable-takos u.a)) - =/ yal=(set tako) (~(dif in (reachable-takos b)) old) - :- (silt (turn ~(tap in yal) tako-to-yaki)) - ~ - :: :: Get all the lobes that are referenced in `a` except those that are :: already in `b`. :: @@ -4372,7 +4368,6 @@ $: hun=duct dos=(map desk dojo-7) == - +$ rung-7 $: rus=(map desk rede-7) == @@ -4525,7 +4520,6 @@ dos.rom %- ~(run by dos.rom.ruf) |= =dojo - ::dojo dojo(fod.dom [~ ~ ~ ~ ~]) :: hoy @@ -4535,7 +4529,6 @@ rus %- ~(run by rus.rung) |= =rede - ::rede rede(fod.dom [~ ~ ~ ~ ~]) == == From 08d3aa24856830e90c300d2f5cb6cf1c9212e45c Mon Sep 17 00:00:00 2001 From: raghu <{ID}+{username}@users.noreply.github.com> Date: Sun, 2 May 2021 14:04:03 -0400 Subject: [PATCH 44/62] fuse: c/r --- pkg/arvo/sys/vane/clay.hoon | 70 +++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 35e94c657..01df53470 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -2059,42 +2059,44 @@ %& =/ merge-result=(unit merge-result) +.result ?~ merge-result - :: this merge was a no-op, just continue - $(merges t.merges) - ?~ conflicts.u.merge-result - =/ merged-yaki=yaki - ?- -.new.u.merge-result - %| - +.new.u.merge-result :: - %& - :: - :: convert the yuki to yaki - :: - =/ yuk=yuki +.new.u.merge-result - =/ lobes=(map path lobe) - %- ~(run by q.yuk) - |= val=(each page lobe) - ^- lobe - ?- -.val - %& (page-to-lobe +.val) - %| +.val - == - (make-yaki p.yuk lobes now) - == - %= $ - continuation-yaki merged-yaki - merges t.merges - hut.ran (~(put by hut.ran) r.merged-yaki merged-yaki) - lat.rag (~(uni by lat.rag) lat.u.merge-result) - parents [(~(got by hit.ali-dom) let.ali-dom) parents] - == + :: this merge was a no-op, just continue + :: + $(merges t.merges) + ?^ conflicts.u.merge-result + :: + :: if there are merge conflicts send the error and abort the merge + :: + =. fiz *melt + =. hut.ran clean-hut-ran + (done %& conflicts.u.merge-result) + =/ merged-yaki=yaki + ?- -.new.u.merge-result + %| + +.new.u.merge-result :: - :: if there are merge conflicts send the error and abort the merge - :: - =. fiz *melt - =. hut.ran clean-hut-ran - (done %& conflicts.u.merge-result) + %& + :: + :: convert the yuki to yaki + :: + =/ yuk=yuki +.new.u.merge-result + =/ lobes=(map path lobe) + %- ~(run by q.yuk) + |= val=(each page lobe) + ^- lobe + ?- -.val + %& (page-to-lobe +.val) + %| +.val + == + (make-yaki p.yuk lobes now) + == + %= $ + continuation-yaki merged-yaki + merges t.merges + hut.ran (~(put by hut.ran) r.merged-yaki merged-yaki) + lat.rag (~(uni by lat.rag) lat.u.merge-result) + parents [(~(got by hit.ali-dom) let.ali-dom) parents] + == == :: ++ done From 20fb39bba72fb92d567079f8d03c3abb02d975da Mon Sep 17 00:00:00 2001 From: raghu <{ID}+{username}@users.noreply.github.com> Date: Sun, 2 May 2021 14:15:03 -0400 Subject: [PATCH 45/62] fuse: fix comments --- pkg/arvo/sys/vane/clay.hoon | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 01df53470..75205eeb3 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -58,8 +58,11 @@ :: when the request is filled/updated. :: +$ cult (jug wove duct) -:: State for ongoing %fuse merges - the list maintains the ordering -:: and the map stores the data needed to merge +:: +:: State for ongoing %fuse merges. `con` maintains the ordering, +:: `sto` stores the data needed to merge, and `bas` is the base +:: beak for the merge. +:: +$ melt [bas=beak con=(list [beak germ]) sto=(map beak (unit dome:clay))] :: :: Domestic desk state. @@ -308,7 +311,7 @@ $: %c :: to %clay $> $? %info :: internal edit %merg :: merge desks - %fuse :: mega merge + %fuse :: merge many %pork :: %warp :: %werp :: @@ -1987,7 +1990,7 @@ =/ wir=wire /fuse/[syd]/(scot %p p.bec)/[q.bec]/(scot r.bec) [hen %pass wir %c %warp p.bec q.bec `[%sing %v r.bec /]] :: - :: we also want to clear the state (fiz) associated with this + :: We also want to clear the state (fiz) associated with this :: merge and print a warning if it's non trivial i.e. we're :: starting a new fuse before the previous one terminated. :: @@ -2011,7 +2014,7 @@ ^+ ..take-fuse ?~ riot :: - :: by setting fiz to *melt the merge is aborted - any further + :: By setting fiz to *melt the merge is aborted - any further :: responses we get for the merge will cause take-fuse to crash :: =. fiz *melt @@ -2060,12 +2063,12 @@ =/ merge-result=(unit merge-result) +.result ?~ merge-result :: - :: this merge was a no-op, just continue + :: This merge was a no-op, just continue :: $(merges t.merges) ?^ conflicts.u.merge-result :: - :: if there are merge conflicts send the error and abort the merge + :: If there are merge conflicts send the error and abort the merge :: =. fiz *melt =. hut.ran clean-hut-ran @@ -2077,7 +2080,7 @@ :: %& :: - :: convert the yuki to yaki + :: Convert the yuki to yaki :: =/ yuk=yuki +.new.u.merge-result =/ lobes=(map path lobe) @@ -2130,9 +2133,6 @@ |= [=ali=ship =ali=desk =germ ali-dome=dome:clay continuation-yaki=(unit yaki)] ^- (each (unit merge-result) [term tang]) |^ - :: term tang is the error, merge result being ~ means the merge was - :: a no-op - :: (each a b) is [| b] or [& a] ^- (each (unit merge-result) [term tang]) =/ ali-yaki=yaki (~(got by hut.ran) (~(got by hit.ali-dome) let.ali-dome)) =/ bob-yaki=(unit yaki) From 4c94c7edd4bb311195e47454638f678992b759a8 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Mon, 3 May 2021 17:33:56 -0400 Subject: [PATCH 46/62] ames: expire direct lanes faster after inactivity --- pkg/arvo/sys/vane/ames.hoon | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/pkg/arvo/sys/vane/ames.hoon b/pkg/arvo/sys/vane/ames.hoon index ccf31d062..b591024b5 100644 --- a/pkg/arvo/sys/vane/ames.hoon +++ b/pkg/arvo/sys/vane/ames.hoon @@ -1967,20 +1967,12 @@ ++ on-memo |= [=bone payload=* valence=?(%plea %boon)] ^+ peer-core - :: if we haven't been trying to talk to %live, reset timer - :: - =? last-contact.qos.peer-state - ?& ?=(%live -.qos.peer-state) - %- ~(all by snd.peer-state) - |= =message-pump-state - =(~ live.packet-pump-state.message-pump-state) - == - now - :: =/ =message-blob (dedup-message (jim payload)) =. peer-core (run-message-pump bone %memo message-blob) :: - ?: &(=(%boon valence) ?=(?(%dead %unborn) -.qos.peer-state)) + ?: ?& =(%boon valence) + (gte now (add ~s30 last-contact.qos.peer-state)) + == check-clog peer-core :: +dedup-message: replace with any existing copy of this message From 2fd8e729e19982b82a1e4e11ecf1f3ec474f5b04 Mon Sep 17 00:00:00 2001 From: raghu <{ID}+{username}@users.noreply.github.com> Date: Mon, 3 May 2021 19:29:28 -0400 Subject: [PATCH 47/62] fuse: fix indents --- pkg/arvo/sys/vane/clay.hoon | 56 ++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 75205eeb3..2556df922 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -1983,29 +1983,29 @@ |= [bas=beak con=(list [beak germ])] ^+ ..start-fuse =/ moves=(list move) - %+ turn - [[bas *germ] con] - |= [bec=beak germ] - ^- move - =/ wir=wire /fuse/[syd]/(scot %p p.bec)/[q.bec]/(scot r.bec) - [hen %pass wir %c %warp p.bec q.bec `[%sing %v r.bec /]] + %+ turn + [[bas *germ] con] + |= [bec=beak germ] + ^- move + =/ wir=wire /fuse/[syd]/(scot %p p.bec)/[q.bec]/(scot r.bec) + [hen %pass wir %c %warp p.bec q.bec `[%sing %v r.bec /]] :: :: We also want to clear the state (fiz) associated with this :: merge and print a warning if it's non trivial i.e. we're :: starting a new fuse before the previous one terminated. :: =/ err=tang - ?~ con.fiz - ~ - =/ discarded=tang - %+ turn - ~(tap in sto.fiz) - |= [k=beak v=(unit dome:clay)] - ^- tank - =/ received=tape ?~(v "missing" "received") - leaf+"{} {received}" - :- leaf+"fusing into {} from {} {} - overwriting prior fuse" - discarded + ?~ con.fiz + ~ + =/ discarded=tang + %+ turn + ~(tap in sto.fiz) + |= [k=beak v=(unit dome:clay)] + ^- tank + =/ received=tape ?~(v "missing" "received") + leaf+"{} {received}" + :_ discarded + leaf+"fusing into {} from {} {} - overwriting prior fuse" =. fiz (make-melt bas con) ((slog err) (emil moves)) :: @@ -2024,10 +2024,10 @@ :+ bas.fiz con.fiz (~(put by sto.fiz) bec `!<(dome:clay q.r.u.riot)) =/ all-done=flag - %- ~(all by sto.fiz) - |= res=(unit dome:clay) - ^- flag - !=(res ~) + %- ~(all by sto.fiz) + |= res=(unit dome:clay) + ^- flag + !=(res ~) ?. all-done ..take-fuse =| rag=rang @@ -2084,13 +2084,13 @@ :: =/ yuk=yuki +.new.u.merge-result =/ lobes=(map path lobe) - %- ~(run by q.yuk) - |= val=(each page lobe) - ^- lobe - ?- -.val - %& (page-to-lobe +.val) - %| +.val - == + %- ~(run by q.yuk) + |= val=(each page lobe) + ^- lobe + ?- -.val + %& (page-to-lobe +.val) + %| +.val + == (make-yaki p.yuk lobes now) == %= $ From 424d167905ddba5db33091290f1a85319b411d19 Mon Sep 17 00:00:00 2001 From: raghu <{ID}+{username}@users.noreply.github.com> Date: Mon, 3 May 2021 22:26:14 -0400 Subject: [PATCH 48/62] fuse: reset pills --- bin/brass.pill | 4 ++-- bin/ivory.pill | 4 ++-- bin/solid.pill | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/brass.pill b/bin/brass.pill index 4f5af448a..f549dac58 100644 --- a/bin/brass.pill +++ b/bin/brass.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2d45514e6ebb8345911137a03980e709c8ea0c28b14b770a24a51190db7c8ed2 -size 8215365 +oid sha256:61e583dd7db795dac4a7c31bfd3ee8b240e679bb882e35d4e7d1acb5f9f2f3d6 +size 8270131 diff --git a/bin/ivory.pill b/bin/ivory.pill index ae03a26b9..7c2e8e474 100644 --- a/bin/ivory.pill +++ b/bin/ivory.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b9807f664c9b4f6d6ce92c10f2959f28ad6e48a24a880556f828d3cf0cad2ee9 -size 4537425 +oid sha256:185ea5e76dc48695e55efc543377e0682e485f81b16e3b443f9be881d026d4f2 +size 2616564 diff --git a/bin/solid.pill b/bin/solid.pill index aaeb0a4d2..92802fcdd 100644 --- a/bin/solid.pill +++ b/bin/solid.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1ddeef9bf39394ff9c19a0d66c9fc45d218e4891dbd152f8f7696f8c0fa9747e -size 9877817 +oid sha256:bb221ce7316346bfaf1ddd953927c0f2afe7eaf5b160bed545f67ec7e5ccb005 +size 9410487 From 9db61a1566d32b1862a06ccf01ec136f8ee8a6ef Mon Sep 17 00:00:00 2001 From: raghu <{ID}+{username}@users.noreply.github.com> Date: Mon, 3 May 2021 22:26:49 -0400 Subject: [PATCH 49/62] fuse: simplify state restoration logic --- pkg/arvo/sys/vane/clay.hoon | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 2556df922..3d504a139 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -2010,6 +2010,8 @@ ((slog err) (emil moves)) :: ++ take-fuse + |^ + :: |= [bec=beak =riot] ^+ ..take-fuse ?~ riot @@ -2031,33 +2033,24 @@ ?. all-done ..take-fuse =| rag=rang - =/ clean-hut-ran hut.ran + =/ clean-state ..take-fuse =/ initial-dome=dome:clay (need (~(got by sto.fiz) bas.fiz)) =/ continuation-yaki=yaki - (~(got by hut.ran) (~(got by hit.initial-dome) let.initial-dome)) + (~(got by hut.ran) (~(got by hit.initial-dome) let.initial-dome)) =/ parents=(list tako) ~[(~(got by hit.initial-dome) let.initial-dome)] =/ merges con.fiz - :: - :: We must ensure that we don't leave garbage around. - :: In all cases we want to clear fiz and restore hut.ran - :: to clean-hut-ran. - :: |- ^+ ..take-fuse ?~ merges =/ t=tang [leaf+"{} fused from {} {}" ~] - =. fiz *melt - =. hut.ran clean-hut-ran - =. ..take-fuse (park | [%| continuation-yaki(p (flop parents))] rag) - (done %| %fuse-succeded t) + =. ..take-fuse (done-fuse clean-state %| %fuse-succeded t) + (park | [%| continuation-yaki(p (flop parents))] rag) =/ [bec=beak g=germ] i.merges =/ ali-dom=dome:clay (need (~(got by sto.fiz) bec)) =/ result (merge-helper p.bec q.bec g ali-dom `continuation-yaki) ?- -.result %| - =. fiz *melt - =. hut.ran clean-hut-ran - (done %| %fuse-merge-failed p.result) + (done-fuse clean-state %| %fuse-merge-failed p.result) :: %& =/ merge-result=(unit merge-result) +.result @@ -2070,9 +2063,7 @@ :: :: If there are merge conflicts send the error and abort the merge :: - =. fiz *melt - =. hut.ran clean-hut-ran - (done %& conflicts.u.merge-result) + (done-fuse clean-state %& conflicts.u.merge-result) =/ merged-yaki=yaki ?- -.new.u.merge-result %| @@ -2101,6 +2092,15 @@ parents [(~(got by hit.ali-dom) let.ali-dom) parents] == == + :: +done-fuse: restore state after a fuse is attempted, whether it + :: succeeds or fails. + :: + ++ done-fuse + |= [to-restore=_..take-fuse result=(each (set path) (pair term tang))] + ^+ ..take-fuse + =. fiz.to-restore *melt + (done:to-restore result) + -- :: ++ done |= result=(each (set path) (pair term tang)) From c86559071fe387dfb34a5b6aad9fe1d14ad05c55 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Tue, 4 May 2021 14:55:41 -0500 Subject: [PATCH 50/62] zuse: add +tab arm to +on, which allows one to take a subset excluding the start element with a max count --- pkg/arvo/sys/zuse.hoon | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index a843d4ed0..308df0b0d 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5398,6 +5398,44 @@ |- ?~ a a [n=[key.n.a (b val.n.a)] l=$(a l.a) r=$(a r.a)] + :: +tab: tabulate a subset excluding start element with a max count + :: + ++ tab + ~/ %tab + |= [a=(tree item) b=(unit key) c=@] + ^- (list item) + |^ + -:(tabulate (del-span a b) b c) + :: + ++ tabulate + |= [a=(tree item) b=(unit key) c=@] + ^- [(list item) @] + ?: ?&(?=(~ b) =(c 0)) + [~ 0] + =| f=[d=(list item) e=@] + |- ^- [(list item) @] + ?: ?|(?=(~ a) =(e.f c)) f + =. f $(a l.a) + ?: =(e.f c) f + =. f [[n.a d.f] +(e.f)] + ?: =(e.f c) f + $(a r.a) + :: + ++ del-span + |= [a=(tree item) b=(unit key)] + ^- (tree item) + ?~ a a + ?~ b a + :: found key + ?: =(u.b key.n.a) + (nip a(r ~)) + :: traverse to find key + ?: (compare key.n.a u.b) + :: found key to the left of end + a(r $(a r.a)) + :: found key to the right of end + $(a (nip a(r ~))) + -- :: +tap: convert to list, smallest to largest :: ++ tap From 59227f86968350abfb5b4d9a3d6cd36bc6f1d1ee Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Tue, 4 May 2021 15:58:47 -0500 Subject: [PATCH 51/62] tests: added tests for +tab --- pkg/arvo/tests/sys/zuse/ordered-map.hoon | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/pkg/arvo/tests/sys/zuse/ordered-map.hoon b/pkg/arvo/tests/sys/zuse/ordered-map.hoon index 4191d3e7e..d0c7a8155 100644 --- a/pkg/arvo/tests/sys/zuse/ordered-map.hoon +++ b/pkg/arvo/tests/sys/zuse/ordered-map.hoon @@ -9,6 +9,7 @@ (items-from-keys (gulf 0 6)) :: =/ atom-map ((ordered-map @ud @tas) lte) +=/ gte-atom-map ((ordered-map @ud @tas) gte) :: |% ++ test-ordered-map-gas ^- tang @@ -27,6 +28,34 @@ !> test-items !> (tap:atom-map a) :: +++ test-ordered-map-tab ^- tang + :: + =/ a=(tree [@ud @tas]) (gas:gte-atom-map ~ test-items) + :: + %+ expect-eq + !> test-items + !> (tab:gte-atom-map a ~ 7) +:: +++ test-ordered-map-tab-starting-from ^- tang + :: + =/ a=(tree [@ud @tas]) (gas:gte-atom-map ~ test-items) + =/ small-test-items=(list [@ud @tas]) + (items-from-keys (gulf 3 6)) + :: + %+ expect-eq + !> small-test-items + !> (tab:gte-atom-map a [~ 2] 4) +:: +++ test-ordered-map-tab-starting-from-and-count ^- tang + :: + =/ a=(tree [@ud @tas]) (gas:gte-atom-map ~ test-items) + =/ small-test-items=(list [@ud @tas]) + (items-from-keys (gulf 4 6)) + :: + %+ expect-eq + !> small-test-items + !> (tab:gte-atom-map a [~ 2] 3) +:: ++ test-ordered-map-pop ^- tang :: =/ a=(tree [@ud @tas]) (gas:atom-map ~ test-items) From 947b9ec75cb7239ac329a17072f73808a8c8ea77 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Wed, 5 May 2021 11:56:04 -0500 Subject: [PATCH 52/62] zuse: +tab should paginate into the ordered-map starting from the highest element, not from the lowest --- pkg/arvo/sys/zuse.hoon | 14 ++++---- pkg/arvo/tests/sys/zuse/ordered-map.hoon | 44 +++++++++++++++++++----- 2 files changed, 43 insertions(+), 15 deletions(-) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index 308df0b0d..424411939 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5405,7 +5405,7 @@ |= [a=(tree item) b=(unit key) c=@] ^- (list item) |^ - -:(tabulate (del-span a b) b c) + (flop -:(tabulate (del-span a b) b c)) :: ++ tabulate |= [a=(tree item) b=(unit key) c=@] @@ -5427,14 +5427,14 @@ ?~ a a ?~ b a :: found key - ?: =(u.b key.n.a) - (nip a(r ~)) + ?: =(key.n.a u.b) + (nip a(l ~)) :: traverse to find key ?: (compare key.n.a u.b) - :: found key to the left of end - a(r $(a r.a)) - :: found key to the right of end - $(a (nip a(r ~))) + :: found key to the left of start + $(a (nip a(l ~))) + :: found key to the right of start + a(l $(a l.a)) -- :: +tap: convert to list, smallest to largest :: diff --git a/pkg/arvo/tests/sys/zuse/ordered-map.hoon b/pkg/arvo/tests/sys/zuse/ordered-map.hoon index d0c7a8155..90987664f 100644 --- a/pkg/arvo/tests/sys/zuse/ordered-map.hoon +++ b/pkg/arvo/tests/sys/zuse/ordered-map.hoon @@ -28,33 +28,61 @@ !> test-items !> (tap:atom-map a) :: -++ test-ordered-map-tab ^- tang +++ test-ordered-map-tab-gte ^- tang :: =/ a=(tree [@ud @tas]) (gas:gte-atom-map ~ test-items) :: %+ expect-eq - !> test-items + !> (flop test-items) !> (tab:gte-atom-map a ~ 7) :: -++ test-ordered-map-tab-starting-from ^- tang +++ test-ordered-map-tab-gte-starting-from ^- tang :: =/ a=(tree [@ud @tas]) (gas:gte-atom-map ~ test-items) =/ small-test-items=(list [@ud @tas]) - (items-from-keys (gulf 3 6)) + (items-from-keys (gulf 2 5)) :: %+ expect-eq - !> small-test-items - !> (tab:gte-atom-map a [~ 2] 4) + !> (flop small-test-items) + !> (tab:gte-atom-map a [~ 6] 4) :: -++ test-ordered-map-tab-starting-from-and-count ^- tang +++ test-ordered-map-tab-gte-count ^- tang :: =/ a=(tree [@ud @tas]) (gas:gte-atom-map ~ test-items) =/ small-test-items=(list [@ud @tas]) (items-from-keys (gulf 4 6)) :: + %+ expect-eq + !> (flop small-test-items) + !> (tab:gte-atom-map a ~ 3) +:: +++ test-ordered-map-tab ^- tang + :: + =/ a=(tree [@ud @tas]) (gas:atom-map ~ test-items) + :: + %+ expect-eq + !> test-items + !> (tab:atom-map a ~ 7) +:: +++ test-ordered-map-tab-starting-from ^- tang + :: + =/ a=(tree [@ud @tas]) (gas:atom-map ~ test-items) + =/ small-test-items=(list [@ud @tas]) + (items-from-keys (gulf 1 4)) + :: %+ expect-eq !> small-test-items - !> (tab:gte-atom-map a [~ 2] 3) + !> (tab:atom-map a [~ 0] 4) +:: +++ test-ordered-map-tab-count ^- tang + :: + =/ a=(tree [@ud @tas]) (gas:atom-map ~ test-items) + =/ small-test-items=(list [@ud @tas]) + (items-from-keys (gulf 0 2)) + :: + %+ expect-eq + !> small-test-items + !> (tab:atom-map a ~ 3) :: ++ test-ordered-map-pop ^- tang :: From 4073cf9d76e44f832c1380ce00a28bed62595df8 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Wed, 5 May 2021 12:59:40 -0500 Subject: [PATCH 53/62] zuse: +tab marginal code cleanup to reduce use of lark --- pkg/arvo/sys/zuse.hoon | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index 424411939..7df956b2e 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5405,20 +5405,20 @@ |= [a=(tree item) b=(unit key) c=@] ^- (list item) |^ - (flop -:(tabulate (del-span a b) b c)) + (flop e:(tabulate (del-span a b) b c)) :: ++ tabulate |= [a=(tree item) b=(unit key) c=@] - ^- [(list item) @] + ^- [d=@ e=(list item)] ?: ?&(?=(~ b) =(c 0)) - [~ 0] - =| f=[d=(list item) e=@] - |- ^- [(list item) @] - ?: ?|(?=(~ a) =(e.f c)) f + [0 ~] + =| f=[d=@ e=(list item)] + |- ^- [d=@ e=(list item)] + ?: ?|(?=(~ a) =(d.f c)) f =. f $(a l.a) - ?: =(e.f c) f - =. f [[n.a d.f] +(e.f)] - ?: =(e.f c) f + ?: =(d.f c) f + =. f [+(d.f) [n.a e.f]] + ?: =(d.f c) f $(a r.a) :: ++ del-span @@ -5426,14 +5426,10 @@ ^- (tree item) ?~ a a ?~ b a - :: found key ?: =(key.n.a u.b) (nip a(l ~)) - :: traverse to find key ?: (compare key.n.a u.b) - :: found key to the left of start $(a (nip a(l ~))) - :: found key to the right of start a(l $(a l.a)) -- :: +tap: convert to list, smallest to largest From 36ae091cff1b37ce0deb5a76c23a0adc2418e203 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Wed, 5 May 2021 13:09:43 -0500 Subject: [PATCH 54/62] zuse: +tab in ordered-map is more succinct and no longer nips --- pkg/arvo/sys/zuse.hoon | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index 7df956b2e..b1fc36113 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5418,8 +5418,7 @@ =. f $(a l.a) ?: =(d.f c) f =. f [+(d.f) [n.a e.f]] - ?: =(d.f c) f - $(a r.a) + ?:(=(d.f c) f $(a r.a)) :: ++ del-span |= [a=(tree item) b=(unit key)] @@ -5427,9 +5426,9 @@ ?~ a a ?~ b a ?: =(key.n.a u.b) - (nip a(l ~)) + a(l r.a) ?: (compare key.n.a u.b) - $(a (nip a(l ~))) + $(a a(l r.a)) a(l $(a l.a)) -- :: +tap: convert to list, smallest to largest From 915c548037a6395759c77efaf7e4fc04a2e85e4b Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Wed, 5 May 2021 14:41:13 -0500 Subject: [PATCH 55/62] zuse: fix +del-span in +tab --- pkg/arvo/sys/zuse.hoon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index b1fc36113..ff4109b49 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5426,9 +5426,9 @@ ?~ a a ?~ b a ?: =(key.n.a u.b) - a(l r.a) + r.a ?: (compare key.n.a u.b) - $(a a(l r.a)) + $(a r.a) a(l $(a l.a)) -- :: +tap: convert to list, smallest to largest From a25f8028f4d57e37849dbd6d9430e026a6489d85 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Wed, 5 May 2021 16:07:08 -0500 Subject: [PATCH 56/62] tests: add test to make sure subtree is being modified properly in +del-span --- pkg/arvo/sys/zuse.hoon | 2 +- pkg/arvo/tests/sys/zuse/ordered-map.hoon | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index ff4109b49..1ed24031c 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5413,7 +5413,7 @@ ?: ?&(?=(~ b) =(c 0)) [0 ~] =| f=[d=@ e=(list item)] - |- ^- [d=@ e=(list item)] + |- ^+ f ?: ?|(?=(~ a) =(d.f c)) f =. f $(a l.a) ?: =(d.f c) f diff --git a/pkg/arvo/tests/sys/zuse/ordered-map.hoon b/pkg/arvo/tests/sys/zuse/ordered-map.hoon index 90987664f..961882ac6 100644 --- a/pkg/arvo/tests/sys/zuse/ordered-map.hoon +++ b/pkg/arvo/tests/sys/zuse/ordered-map.hoon @@ -84,6 +84,14 @@ !> small-test-items !> (tab:atom-map a ~ 3) :: +++ test-ordered-map-tab-more-than-exist ^- tang + :: + =/ a=(tree [@ud @tas]) (gas:atom-map ~ test-items) + :: + %+ expect-eq + !> test-items + !> (tab:atom-map a [~ 0] 8) +:: ++ test-ordered-map-pop ^- tang :: =/ a=(tree [@ud @tas]) (gas:atom-map ~ test-items) From 0ed09b7a290c961cf09e7dc21fe31d52e84ddef6 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Wed, 5 May 2021 16:53:24 -0500 Subject: [PATCH 57/62] tests: fix wrong expected result with ordered-map test --- pkg/arvo/tests/sys/zuse/ordered-map.hoon | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/tests/sys/zuse/ordered-map.hoon b/pkg/arvo/tests/sys/zuse/ordered-map.hoon index 961882ac6..247b85c91 100644 --- a/pkg/arvo/tests/sys/zuse/ordered-map.hoon +++ b/pkg/arvo/tests/sys/zuse/ordered-map.hoon @@ -86,10 +86,12 @@ :: ++ test-ordered-map-tab-more-than-exist ^- tang :: - =/ a=(tree [@ud @tas]) (gas:atom-map ~ test-items) + =/ specific-test-items=(list [@ud @tas]) + (items-from-keys (gulf 1 6)) + =/ a=(tree [@ud @tas]) (gas:atom-map ~ specific-test-items) :: %+ expect-eq - !> test-items + !> specific-test-items !> (tab:atom-map a [~ 0] 8) :: ++ test-ordered-map-pop ^- tang From 44722f3a092344c2afc7d8724b9bb5f50b638cde Mon Sep 17 00:00:00 2001 From: raghu <{ID}+{username}@users.noreply.github.com> Date: Tue, 11 May 2021 21:30:44 -0400 Subject: [PATCH 58/62] fuse: properly report success --- pkg/arvo/sys/vane/clay.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 3d504a139..83b6c4802 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -2043,7 +2043,7 @@ ^+ ..take-fuse ?~ merges =/ t=tang [leaf+"{} fused from {} {}" ~] - =. ..take-fuse (done-fuse clean-state %| %fuse-succeded t) + =. ..take-fuse (done-fuse clean-state %& ~) (park | [%| continuation-yaki(p (flop parents))] rag) =/ [bec=beak g=germ] i.merges =/ ali-dom=dome:clay (need (~(got by sto.fiz) bec)) From 2c754ff08f381dde79693e75d2961ba191047d61 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Tue, 18 May 2021 12:29:16 -0500 Subject: [PATCH 59/62] zuse: added +ram method to ordered map and made comments on methods accurate --- pkg/arvo/sys/zuse.hoon | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index 9fda52f56..168c15863 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5077,10 +5077,6 @@ ++ ordered-map on :: +on: treap with user-specified horizontal order, ordered-map :: -:: Conceptually smaller items go on the left, so the item with the -:: smallest key can be popped off the head. If $key is `@` and -:: .compare is +lte, then the numerically smallest item is the head. -:: :: WARNING: ordered-map will not work properly if two keys can be :: unequal under noun equality but equal via the compare gate :: @@ -5144,7 +5140,7 @@ :: ?~(r.a %.y &((mor key.n.a key.n.r.a) $(a r.a, r `key.n.a))) == - :: +bap: convert to list, largest to smallest + :: +bap: convert to list, right to left :: ++ bap ~/ %bap @@ -5175,10 +5171,9 @@ :: +dip: stateful partial inorder traversal :: :: Mutates .state on each run of .f. Starts at .start key, or if - :: .start is ~, starts at the head (item with smallest key). Stops - :: when .f produces .stop=%.y. Traverses from smaller to larger - :: keys. Each run of .f can replace an item's value or delete the - :: item. + :: .start is ~, starts at the head. Stops when .f produces .stop=%.y. + :: Traverses from left to right keys. + :: Each run of .f can replace an item's value or delete the item. :: ++ dip ~/ %dip @@ -5339,7 +5334,7 @@ l.a(r $(l.a r.l.a)) r.a(l $(r.a l.r.a)) :: - :: +pop: produce .head (smallest item) and .rest or crash if empty + :: +pop: produce .head (leftmost item) and .rest or crash if empty :: ++ pop ~/ %pop @@ -5354,13 +5349,14 @@ ?: |(?=(~ rest.l) (mor key.n.a key.n.rest.l)) a(l rest.l) rest.l(r a(r r.rest.l)) - :: +pry: produce head (smallest item) or null + :: +pry: produce head (leftmost item) or null :: ++ pry ~/ %pry |= a=(tree item) ^- (unit item) ?~ a ~ + |- ?~ l.a `n.a $(a l.a) :: +put: ordered item insert @@ -5390,6 +5386,16 @@ ?: (mor key.n.a key.n.r) a(r r) r(l a(r l.r)) + :: +ram: produce tail (rightmost item) or null + :: + ++ ram + ~/ %ram + |= a=(tree item) + ^- (unit item) + ?~ a ~ + |- + ?~ r.a `n.a + $(a r.a) :: +run: apply gate to transform all values in place :: ++ run @@ -5431,7 +5437,7 @@ $(a r.a) a(l $(a l.a)) -- - :: +tap: convert to list, smallest to largest + :: +tap: convert to list, left to right :: ++ tap ~/ %tap From eb130136f0e42313eb2c6cc238a9fafc5853e3a1 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Tue, 18 May 2021 07:53:44 -1000 Subject: [PATCH 60/62] pill: update --- bin/solid.pill | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/solid.pill b/bin/solid.pill index 034ca3427..7bac0f38e 100644 --- a/bin/solid.pill +++ b/bin/solid.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d7b7cf24e56ab078cf1dcb82e4e7744f188c5221c08772d6cfb15f59ce81aaa5 -size 11198219 +oid sha256:88acd8aa1aae3d11579ada954b6e0b06c940de7856d22017cc1a1442de97fcf3 +size 13650762 From bbe3cbe8ee2904d5f9472763bb9d1689b14da3a8 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Tue, 18 May 2021 08:32:30 -1000 Subject: [PATCH 61/62] clay: formatting --- pkg/arvo/sys/vane/clay.hoon | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index edc25ba1e..993ac2703 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -2229,12 +2229,13 @@ ^- (each (unit merge-result) [term tang]) =/ ali-yaki=yaki (~(got by hut.ran) (~(got by hit.ali-dome) let.ali-dome)) =/ bob-yaki=(unit yaki) - ?~ continuation-yaki - ?~ let.dom - ~ - (~(get by hut.ran) (~(got by hit.dom) let.dom)) - continuation-yaki + ?~ continuation-yaki + ?~ let.dom + ~ + (~(get by hut.ran) (~(got by hit.dom) let.dom)) + continuation-yaki (merge-by-germ ali-yaki bob-yaki) + :: ++ merge-by-germ |= [=ali=yaki bob-yaki=(unit yaki)] ^- (each (unit merge-result) [term tang]) @@ -4498,7 +4499,6 @@ per=regs pew=regs == - +$ ford-cache-7 ford-cache +$ raft-6 $: rom=room-6 :: domestic From 804e2578ed9800568e28e225b604610d2653892a Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Tue, 18 May 2021 09:09:22 -1000 Subject: [PATCH 62/62] kiln: don't crash on fuse --- pkg/arvo/lib/hood/kiln.hoon | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index 9f541bacd..79b07a668 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -501,6 +501,8 @@ ++ take |=(way=wire ?>(?=([@ ~] way) (work i.way))) :: general handler ++ take-mere :: |= [way=wire are=(each (set path) (pair term tang))] + ?. ?=([@ ~] way) + abet abet:abet:(mere:(take way) are) :: ++ take-coup-fancy ::