From 2376192da7537d243943a13b5f99b74307acf477 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Wed, 12 Jun 2024 11:18:52 -0400 Subject: [PATCH] neo: fix synchronisation --- pkg/arvo/app/neo.hoon | 41 ++++++++---- pkg/arvo/lib/neo-three.hoon | 54 +++++++++++++++ pkg/arvo/lib/neo-two.hoon | 67 +++++++++++++++++-- pkg/arvo/neo/cod/std/src/imp/accel.hoon | 4 +- pkg/arvo/neo/cod/std/src/imp/home.hoon | 1 + pkg/arvo/neo/cod/std/src/imp/message-sub.hoon | 4 +- tests/lib/neo-two.hoon | 26 +++++++ 7 files changed, 174 insertions(+), 23 deletions(-) create mode 100644 pkg/arvo/lib/neo-three.hoon create mode 100644 tests/lib/neo-two.hoon diff --git a/pkg/arvo/app/neo.hoon b/pkg/arvo/app/neo.hoon index 1802828df5..d1a398afc1 100644 --- a/pkg/arvo/app/neo.hoon +++ b/pkg/arvo/app/neo.hoon @@ -865,6 +865,7 @@ ++ free |= =hunt:neo ^+ run + ~& resolved/hunt :: XX: weird shadowing, be careful =/ =rave:neo (~(gut of:neo riot) pith.hunt *rave:neo) =. rave @@ -1811,28 +1812,40 @@ work :: ++ jazz + =| bad=(set term) |= [=conf:neo =deps:neo] - ^- [bad=(set term) block=(set tour:neo)] - %+ roll ~(tap by deps) - |= [[=term required=? =quay:neo] bad=(set term) block=(set hunt:neo)] + ^+ [bad arvo] + =/ deps ~(tap by deps) + |- ^+ [bad arvo] + ?~ deps + [bad arvo] + =/ [=term required=? =quay:neo] i.deps =/ =care:neo (get-care:quay:neo quay) ?: &(required !(~(has by conf) term)) - :_(block (~(put in bad) term)) + =. bad (~(put in bad) term) + $(deps t.deps) ?: &(!required !(~(has by conf) term)) - [bad block] + $(deps t.deps) =/ pit=pith:neo (~(got by conf) term) =/ res (look care pit) =/ nam=name:neo (de-pith:name:neo pit) ?~ res ?: =(our.bowl ship.nam) ?. required - [bad block] - :_(block (~(put in bad) term)) - [bad (~(put in block) care pit)] - ?~ u.res - :_(block (~(put in bad) term)) - [bad block] :: - :: + $(deps t.deps) + =. bad (~(put in bad) term) + $(deps t.deps) + =? get.block required + (~(put in get.block) care pit) + =. run abet:(~(start sale pit) [p/our.bowl here] care) + =? run !required + (stalk:rage care^pit %rely term here) + $(deps t.deps) + ?^ u.res + $(deps t.deps) + =. bad (~(put in bad) term) + $(deps t.deps) + :: ++ dance |= [=crew:neo =band:neo] ^+ arvo @@ -1875,7 +1888,7 @@ |= [src=stud:neo init=(unit pail:neo) =crew:neo] =/ =wave:neo [src ~(dock husk src) crew] =. tide (~(put of:neo tide) here wave) - =^ bad=(set term) get.block + =^ bad=(set term) arvo (jazz crew deps:~(kook husk src)) ?. =(~ get.block) arvo @@ -2000,6 +2013,8 @@ ?~ ack same (slog (print-quit:neo u.ack)) + ?: ?=(%rely p.pail) + ((slog leaf/"no support for %rely" ~) su-core) (mean leaf/"no support for {}" ~) =/ [caz=(list card:neo) new=pail:neo] (poke:su-form pail) diff --git a/pkg/arvo/lib/neo-three.hoon b/pkg/arvo/lib/neo-three.hoon new file mode 100644 index 0000000000..d0941c943f --- /dev/null +++ b/pkg/arvo/lib/neo-three.hoon @@ -0,0 +1,54 @@ +/- neo +|% +:: ++ dyad (pair @ @) +++ scam + =< scam + |% + ++ on ((^on case:neo case:neo) lte) + +$ scam ((mop case:neo case:neo) lte) + -- +:: ++ push +++ scum + =< scum + |% + ++ on ((^on case:neo (map pith:neo case:neo)) lte) + +$ scum ((mop case:neo (map pith:neo case:neo)) lte) + -- ++$ muck + $: =soil + =scum + why=scam + zed=scam + == +++ soil + =< a + ^~ + |% + ++ on ((^on case:neo muck:neo) lte) + +$ a ((mop case:neo muck:neo) lte) + -- +++ plot + +:: $dirt: Layer 1 of the namespace +++ dirt + |% + +$ card (pair pith note) + +$ note + $% [%grow =pail case=(unit case) =oath] + [%cull ~] + == + +$ loam (axal soil) + +$ gift dust + -- +++ frog + [=pail = + +++ till + |_ =loam + ++ plow + |= + ++ grew + |= [=pail:neo case=@ud] + ++ grow + |= [=pail:neo + diff --git a/pkg/arvo/lib/neo-two.hoon b/pkg/arvo/lib/neo-two.hoon index 85a0c5b43d..6eb3b76607 100644 --- a/pkg/arvo/lib/neo-two.hoon +++ b/pkg/arvo/lib/neo-two.hoon @@ -453,11 +453,64 @@ ~ `[pit %dif] == + + ++ fallback-peek-kids + |= [=care:neo =pith:neo fam=farm:neo] + ^- (list pith:neo) + ?: ?=(%x care) ~ + ?^ fil.fam + =/ [=land:neo =plot:neo] u.fil.fam + ?~ kid=(ram:on:plan:neo ?:(?=(%y care) by-kids-mut.plot by-desc-mut.plot)) + ~ + ~(tap in val.u.kid) + %- zing + %+ turn ~(tap by kid.fam) + |= [=iota f=farm:neo] + ^- (list pith:neo) + (fallback-peek-kids care (snoc pith iota) f) + ++ fallback-peek-x + |= =pith:neo + ^- (unit saga:neo) + =/ sol (~(gut of:neo loam) pith *soil:neo) + ?~ val=(ram:on:soil:neo sol) + ~ + ?~ q.val.u.val + ~ + `[*aeon:neo u.q.val.u.val] + :: + ++ fallback-peek + |= [=care:neo =pith:neo] + ^- (axal:neo saga:neo) + %- gas + %+ welp + ?~ rot=(fallback-peek-x pith) + ~ + [pith u.rot]^~ + %+ murn (fallback-peek-kids care pith (~(dip of:neo farm) pith)) + |= p=pith:neo + ^- (unit [pith:neo saga:neo]) + =/ kid (welp pith p) + ?~ sag=(fallback-peek-x kid) + ~ + `[kid u.sag] + ++ piek + |= [=care:neo =pith:neo] + ^- (unit (unit (axal:neo saga:neo))) + ~& peek-no-once/[care pith] + ``(fallback-peek care pith) + + :: ++ peek |= [=care:neo =pith:neo] ^- (unit (unit (axal:neo saga:neo))) ?~ nce=(now-once care pith) + ~& peek-no-once/[care pith] ~ +:: =/ res +:: (fallback-peek care pith) +:: ~? !=(res [~ ~]) +:: res/res +:: ``(fallback-peek care pith) (look care u.nce pith) ++ look-x |= [=case:neo =pith:neo] @@ -467,6 +520,14 @@ ?: ?=($@(~ [~ ~]) res) res `(~(get of:neo u.u.res) ~) + ++ gas + =| axe=(axal:neo saga:neo) + |= res=(list (pair pith:neo saga:neo)) + ^+ axe + ?~ res + axe + $(axe (~(put of:neo axe) p.i.res q.i.res), res t.res) + :: ++ look |= [=care:neo =once:neo =pith:neo] @@ -485,12 +546,6 @@ %y read-y %z read-z == - ++ gas - |= res=(list (pair pith:neo saga:neo)) - ^+ axe - ?~ res - axe - $(axe (~(put of:neo axe) p.i.res q.i.res), res t.res) ++ read-x (gas read-x-raw) ++ read-x-raw ^- (list (pair pith:neo saga:neo)) diff --git a/pkg/arvo/neo/cod/std/src/imp/accel.hoon b/pkg/arvo/neo/cod/std/src/imp/accel.hoon index 56ffbb347f..c5f2fa7e4d 100644 --- a/pkg/arvo/neo/cod/std/src/imp/accel.hoon +++ b/pkg/arvo/neo/cod/std/src/imp/accel.hoon @@ -57,8 +57,8 @@ ++ init |= old=(unit pail:neo) ^- (quip card:neo pail:neo) - =/ width 10 - =/ height 10 + =/ width 3 + =/ height 3 :_ accel/!>([width height]) (make-cells bowl 1 width 1 height %in) :: diff --git a/pkg/arvo/neo/cod/std/src/imp/home.hoon b/pkg/arvo/neo/cod/std/src/imp/home.hoon index 9a4ae3165b..ee65f3cc8b 100644 --- a/pkg/arvo/neo/cod/std/src/imp/home.hoon +++ b/pkg/arvo/neo/cod/std/src/imp/home.hoon @@ -19,6 +19,7 @@ [#/[p/our.bowl]/home/circle %make %circle ~ ~] [#/[p/our.bowl]/home/files %make %folder ~ ~] [#/[p/our.bowl]/home/planner %make %planner ~ ~] + [#/[p/our.bowl]/home/messenger %make %messenger ~ ~] == ++ poke |= =pail:neo diff --git a/pkg/arvo/neo/cod/std/src/imp/message-sub.hoon b/pkg/arvo/neo/cod/std/src/imp/message-sub.hoon index 93eaa5fb7d..11f6e43eb4 100644 --- a/pkg/arvo/neo/cod/std/src/imp/message-sub.hoon +++ b/pkg/arvo/neo/cod/std/src/imp/message-sub.hoon @@ -12,7 +12,7 @@ ++ deps %- ~(gas by *deps:neo) :~ :- %pub - :+ req=& [pro/%sig (sy %sig ~)] + :+ req=| [pro/%sig (sy %sig ~)] :+ ~ %y %- ~(gas by *lads:neo) :~ :- [|/%da |] @@ -48,4 +48,4 @@ [%make [%message `pai ~]] == -- --- \ No newline at end of file +-- diff --git a/tests/lib/neo-two.hoon b/tests/lib/neo-two.hoon new file mode 100644 index 0000000000..bf2f6166b8 --- /dev/null +++ b/tests/lib/neo-two.hoon @@ -0,0 +1,26 @@ +/- neo +/+ aux=neo-two +/+ *test +=| [=farm:neo =loam:dirt:neo] +=* sta - +|% +++ take-dirt-card + |= =card:dirt:neo + ^+ sta + =^ gifts=(list gift:dirt:neo) loam + (~(call plow:aux loam) card) + =. farm (~(take till:aux [loam farm]) gifts) + sta +++ oat *oath:neo +:: ++ reset +++ test-grow + =. sta (take-dirt-card #/foo %grow atom/!>(1) ~ *oath:neo) + =. sta (take-dirt-card #/foo/bar %grow atom/!>(1) ~ *oath:neo) + =. sta (take-dirt-card #/foo/bar/baz %grow atom/!>(1) ~ *oath:neo) + =. sta (take-dirt-card #/foo/bar %grow atom/!>(1) ~ *oath:neo) + =. sta (take-dirt-card #/foo %grow atom/!>(2) ~ *oath:neo) + =/ want (~(piek till:aux [loam farm]) %z #/foo) + =/ have (~(peek till:aux [loam farm]) %z #/foo) + ~& sta + (expect-eq !>(want) !>(have)) +--