From e8c5dd9806417cb819f745e7cbb99070c29b3351 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Mon, 19 Oct 2020 11:05:31 -0700 Subject: [PATCH 1/4] [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 549c5e5db9f999604d1d09667b458274a13494da Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Wed, 17 Mar 2021 14:21:58 -0700 Subject: [PATCH 2/4] 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 4c94c7edd4bb311195e47454638f678992b759a8 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Mon, 3 May 2021 17:33:56 -0400 Subject: [PATCH 3/4] 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 2c754ff08f381dde79693e75d2961ba191047d61 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Tue, 18 May 2021 12:29:16 -0500 Subject: [PATCH 4/4] 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