From b0dedeecfefa14ae1ba485a266537a8286a62ef8 Mon Sep 17 00:00:00 2001 From: dachus Date: Wed, 26 Oct 2022 11:26:23 -0600 Subject: [PATCH 1/3] fix --- pkg/arvo/sys/hoon.hoon | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index 43fee2f55c..c62f8ffbce 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -1247,10 +1247,10 @@ =| [l=(unit) r=(unit)] |. ^- ? ?~ a & - ?& ?~(l & (gor n.a u.l)) - ?~(r & (gor u.r n.a)) - ?~(l.a & ?&((mor n.a n.l.a) $(a l.a, l `n.a))) - ?~(r.a & ?&((mor n.a n.r.a) $(a r.a, r `n.a))) + ?& ?~(l & &((gor n.a u.l) !=(n.a u.l))) + ?~(r & &((gor u.r n.a) !=(u.r n.a))) + ?~(l.a & ?&((mor n.a n.l.a) !=(n.a n.l.a) $(a l.a, l `n.a))) + ?~(r.a & ?&((mor n.a n.r.a) !=(n.a n.r.a) $(a r.a, r `n.a))) == :: ++ bif :: splits a by b From 3c0279af05aa8ad569ffa3ef643bcef6d2ee1e1f Mon Sep 17 00:00:00 2001 From: Jared Tobin Date: Thu, 27 Oct 2022 08:06:00 +0400 Subject: [PATCH 2/3] tests: add +apt:in test for set w/dupes --- pkg/arvo/tests/sys/hoon/set.hoon | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/arvo/tests/sys/hoon/set.hoon b/pkg/arvo/tests/sys/hoon/set.hoon index 77ce543d2e..c396569988 100644 --- a/pkg/arvo/tests/sys/hoon/set.hoon +++ b/pkg/arvo/tests/sys/hoon/set.hoon @@ -106,6 +106,10 @@ :: Doesn't follow horizontal & vertical ordering :: =/ unbalanced-e=(set @) [1 [3 ~ ~] [2 ~ ~]] + :: Duplicate elements + :: + =/ has-dupes=(set @) [1 [1 ~ ~] ~] + :: ;: weld %+ expect-eq !> [%b-a %.y] @@ -125,6 +129,9 @@ %+ expect-eq !> [%u-e %.n] !> [%u-e ~(apt in unbalanced-e)] + %+ expect-eq + !> [%h-d %.n] + !> [%h-d ~(apt in has-dupes)] == :: :: Test splits a in b From 7bffd0dd5555ccee92e13ffeef1dfdd327771aba Mon Sep 17 00:00:00 2001 From: Jared Tobin Date: Thu, 27 Oct 2022 08:04:13 +0400 Subject: [PATCH 3/3] jets: patch u3di_apt to match changes in b0dedeec --- pkg/urbit/jets/d/in_apt.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pkg/urbit/jets/d/in_apt.c b/pkg/urbit/jets/d/in_apt.c index c3276bc4a2..a5fe0bd9ff 100644 --- a/pkg/urbit/jets/d/in_apt.c +++ b/pkg/urbit/jets/d/in_apt.c @@ -13,15 +13,21 @@ _in_apt(u3_noun a, u3_weak l, u3_weak r) u3_noun n_a, l_a, r_a; u3x_trel(a, &n_a, &l_a, &r_a); - if ( (u3_none != l) && (c3n == u3qc_gor(n_a, l)) ) { + if ( (u3_none != l) && + ( (c3y == u3r_sing(n_a, l)) || (c3n == u3qc_gor(n_a, l)) )) { return c3n; } - if ( (u3_none != r) && (c3n == u3qc_gor(r, n_a)) ) { + if ( (u3_none != r) && + ( (c3y == u3r_sing(r, n_a)) || (c3n == u3qc_gor(r, n_a)) )) { return c3n; } if ( u3_nul != l_a ) { + if ( c3y == u3r_sing(n_a, u3h(l_a)) ) { + return c3n; + } + if ( c3n == u3qc_mor(n_a, u3h(l_a)) ) { return c3n; } @@ -32,6 +38,10 @@ _in_apt(u3_noun a, u3_weak l, u3_weak r) } if ( u3_nul != r_a ) { + if ( c3y == u3r_sing(n_a, u3h(r_a)) ) { + return c3n; + } + if ( c3n == u3qc_mor(n_a, u3h(r_a)) ) { return c3n; }