mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-26 00:12:28 +03:00
Merge branch 'next/arvo' into lf/ames-snub
This commit is contained in:
commit
a2173f1eb3
32
.github/actions/glob/entrypoint.sh
vendored
32
.github/actions/glob/entrypoint.sh
vendored
@ -1,32 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
cd "$GITHUB_WORKSPACE" || exit
|
|
||||||
|
|
||||||
echo "$2" | base64 -d > service-account
|
|
||||||
echo "$3" | base64 -d > id_ssh
|
|
||||||
echo "$4" | base64 -d > id_ssh.pub
|
|
||||||
|
|
||||||
chmod 600 service-account
|
|
||||||
chmod 600 id_ssh
|
|
||||||
chmod 600 id_ssh.pub
|
|
||||||
|
|
||||||
janeway release glob-all --dev --no-pill \
|
|
||||||
--credentials service-account \
|
|
||||||
--ssh-key id_ssh \
|
|
||||||
--ci \
|
|
||||||
| bash
|
|
||||||
|
|
||||||
SHORTHASH=$(git rev-parse --short HEAD)
|
|
||||||
|
|
||||||
janeway release prepare-ota arvo-glob-"$SHORTHASH" "$1" \
|
|
||||||
--credentials service-account \
|
|
||||||
--ssh-key id_ssh \
|
|
||||||
--ci \
|
|
||||||
| bash
|
|
||||||
|
|
||||||
janeway release perform-ota "$1" \
|
|
||||||
--credentials service-account \
|
|
||||||
--ssh-key id_ssh \
|
|
||||||
--ci \
|
|
||||||
| bash
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
FROM tloncorp/janeway:v0.15.4
|
FROM tloncorp/janeway:v0.17.0
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
EXPOSE 22/tcp
|
EXPOSE 22/tcp
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
@ -1,18 +1,21 @@
|
|||||||
name: 'glob'
|
name: 'ota'
|
||||||
description: 'Create a glob and deploy it to a moon'
|
description: 'perform an OTA update of arvo on a remote ship'
|
||||||
inputs:
|
inputs:
|
||||||
ship:
|
ship:
|
||||||
description: "Ship to deploy to"
|
description: "target ship"
|
||||||
required: true
|
required: true
|
||||||
credentials:
|
credentials:
|
||||||
description: "base64-encoded GCP Service Account credentials"
|
description: "base64-encoded GCP Service Account credentials"
|
||||||
required: true
|
required: true
|
||||||
ssh-sec-key:
|
ssh-sec-key:
|
||||||
description: "A base64-encoded SSH secret key for the container to use"
|
description: "base64-encoded SSH secret key for the container to use"
|
||||||
required: true
|
required: true
|
||||||
ssh-pub-key:
|
ssh-pub-key:
|
||||||
description: "The corresponding base64-encoded SSH public key"
|
description: "base64-encoded corresponding SSH public key"
|
||||||
required: true
|
required: true
|
||||||
|
ref:
|
||||||
|
description: "git ref of arvo source to check out"
|
||||||
|
required: false
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
@ -22,4 +25,4 @@ runs:
|
|||||||
- ${{ inputs.credentials }}
|
- ${{ inputs.credentials }}
|
||||||
- ${{ inputs.ssh-sec-key }}
|
- ${{ inputs.ssh-sec-key }}
|
||||||
- ${{ inputs.ssh-pub-key }}
|
- ${{ inputs.ssh-pub-key }}
|
||||||
|
- ${{ inputs.ref }}
|
20
.github/actions/ota/entrypoint.sh
vendored
Executable file
20
.github/actions/ota/entrypoint.sh
vendored
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
echo "$2" | base64 -d > /service-account
|
||||||
|
echo "$3" | base64 -d > /id_ssh
|
||||||
|
echo "$4" | base64 -d > /id_ssh.pub
|
||||||
|
|
||||||
|
chmod 600 /service-account
|
||||||
|
chmod 600 /id_ssh
|
||||||
|
chmod 600 /id_ssh.pub
|
||||||
|
|
||||||
|
janeway \
|
||||||
|
--ci \
|
||||||
|
--verbose \
|
||||||
|
--credentials /service-account \
|
||||||
|
--ssh-key /id_ssh \
|
||||||
|
release ota \
|
||||||
|
arvo \
|
||||||
|
"$1" \
|
||||||
|
${5:+"--ref"} ${5:+"$5"} \
|
||||||
|
| bash
|
27
.github/workflows/chromatic.yml
vendored
27
.github/workflows/chromatic.yml
vendored
@ -1,27 +0,0 @@
|
|||||||
name: Chromatic Deployment
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'pkg/interface/**'
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- 'pkg/interface/**'
|
|
||||||
branches:
|
|
||||||
- 'release/next-userspace'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
chromatic-deployment:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: "Deploy Chromatic"
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- run: npm i && npm run bootstrap
|
|
||||||
- name: Publish to Chromatic
|
|
||||||
uses: chromaui/action@v1
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
|
||||||
workingDir: pkg/interface
|
|
20
.github/workflows/glob.yml
vendored
20
.github/workflows/glob.yml
vendored
@ -1,20 +0,0 @@
|
|||||||
name: glob
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'release/next-userspace'
|
|
||||||
jobs:
|
|
||||||
glob:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: "Create and deploy a glob to ~hanruc-nalfus-nidsut-tomdun"
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
lfs: true
|
|
||||||
- uses: ./.github/actions/glob
|
|
||||||
with:
|
|
||||||
ship: 'hanruc-nalfus-nidsut-tomdun'
|
|
||||||
credentials: ${{ secrets.JANEWAY_SERVICE_KEY }}
|
|
||||||
ssh-sec-key: ${{ secrets.JANEWAY_SSH_SEC_KEY }}
|
|
||||||
ssh-pub-key: ${{ secrets.JANEWAY_SSH_PUB_KEY }}
|
|
||||||
|
|
27
.github/workflows/merge-master.yml
vendored
27
.github/workflows/merge-master.yml
vendored
@ -1,27 +0,0 @@
|
|||||||
name: merge
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
jobs:
|
|
||||||
merge-to-next-js:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: "Merge master to release/next-userspace"
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: devmasx/merge-branch@v1.3.1
|
|
||||||
with:
|
|
||||||
type: now
|
|
||||||
target_branch: release/next-userspace
|
|
||||||
github_token: ${{ secrets.JANEWAY_BOT_TOKEN }}
|
|
||||||
|
|
||||||
merge-to-group-timer:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: "Merge master to ops/group-timer"
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: devmasx/merge-branch@v1.3.1
|
|
||||||
with:
|
|
||||||
type: now
|
|
||||||
target_branch: ops/group-timer
|
|
||||||
github_token: ${{ secrets.JANEWAY_BOT_TOKEN }}
|
|
17
.github/workflows/merge-release.yml
vendored
17
.github/workflows/merge-release.yml
vendored
@ -1,17 +0,0 @@
|
|||||||
name: ops-merge
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'release/*'
|
|
||||||
jobs:
|
|
||||||
merge-release-to-ops:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: "Merge to ops-tlon"
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: devmasx/merge-branch@v1.3.1
|
|
||||||
with:
|
|
||||||
type: now
|
|
||||||
target_branch: ops-tlon
|
|
||||||
github_token: ${{ secrets.JANEWAY_BOT_TOKEN }}
|
|
||||||
|
|
19
.github/workflows/ota.yml
vendored
Normal file
19
.github/workflows/ota.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
name: ota
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'next/arvo'
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: "make an OTA update to arvo on ~binnec-dozzod-marzod"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/ota
|
||||||
|
with:
|
||||||
|
ship: 'canary'
|
||||||
|
credentials: ${{ secrets.JANEWAY_SERVICE_KEY }}
|
||||||
|
ssh-sec-key: ${{ secrets.JANEWAY_SSH_SEC_KEY }}
|
||||||
|
ssh-pub-key: ${{ secrets.JANEWAY_SSH_PUB_KEY }}
|
||||||
|
ref: 'next/arvo'
|
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:40bc203b8a2d2ebad81723da6fc946ee32d2f8a204884f50f9710177ae257d08
|
oid sha256:e46c7fb35826bcc3352eca8dbfeea3a8bdf1686cf46b3f873fad0c09bc25c5a7
|
||||||
size 5712264
|
size 5715362
|
||||||
|
70
doc/spec/nock/10.txt
Normal file
70
doc/spec/nock/10.txt
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
Author: Mencius Moldbug [moldbug@gmail.com]
|
||||||
|
Date: 9/15/2008
|
||||||
|
Version: 10K
|
||||||
|
|
||||||
|
1. Introduction
|
||||||
|
|
||||||
|
This file defines one function, "nock."
|
||||||
|
|
||||||
|
nock is in the public domain.
|
||||||
|
|
||||||
|
2. Data
|
||||||
|
|
||||||
|
A "noun" is either an "atom" or a "cell." An "atom" is an unsigned
|
||||||
|
integer of any size. A "cell" is an ordered pair of any two nouns,
|
||||||
|
the "head" and "tail."
|
||||||
|
|
||||||
|
3. Semantics
|
||||||
|
|
||||||
|
nock maps one noun to another. It doesn't always terminate.
|
||||||
|
|
||||||
|
4. Pseudocode
|
||||||
|
|
||||||
|
nock is defined in a pattern-matching pseudocode, below.
|
||||||
|
|
||||||
|
Brackets enclose cells. [a b c] is [a [b c]].
|
||||||
|
|
||||||
|
5. Definition
|
||||||
|
|
||||||
|
5.1 Transformations
|
||||||
|
|
||||||
|
*[a [b c] d] => [*[a b c] *[a d]]
|
||||||
|
*[a 0 b] => /[b a]
|
||||||
|
*[a 1 b] => [b]
|
||||||
|
*[a 2 b c d] => *[a 3 [0 1] 3 [1 c d] [1 0] 3 [1 2 3] [1 0] 5 5 b]
|
||||||
|
*[a 3 b] => **[a b]
|
||||||
|
*[a 4 b] => &*[a b]
|
||||||
|
*[a 5 b] => ^*[a b]
|
||||||
|
*[a 6 b] => =*[a b]
|
||||||
|
*[a] => *[a]
|
||||||
|
|
||||||
|
5.2 Operators
|
||||||
|
|
||||||
|
5.2.1 Goto [*]
|
||||||
|
|
||||||
|
*[a] -> nock[a]
|
||||||
|
|
||||||
|
5.2.2 Deep [&]
|
||||||
|
|
||||||
|
&[a b] -> 0
|
||||||
|
&[a] -> 1
|
||||||
|
|
||||||
|
5.2.4 Bump [^]
|
||||||
|
|
||||||
|
^[a b] -> ^[a b]
|
||||||
|
^[a] -> (a + 1)
|
||||||
|
|
||||||
|
5.2.5 Like [=]
|
||||||
|
|
||||||
|
=[a a] -> 0
|
||||||
|
=[a b] -> 1
|
||||||
|
=[a] -> =[a]
|
||||||
|
|
||||||
|
5.2.6 Snip [/]
|
||||||
|
|
||||||
|
/[1 a] -> a
|
||||||
|
/[2 a b] -> a
|
||||||
|
/[3 a b] -> b
|
||||||
|
/[(a + a) b] -> /[2 /[a b]]
|
||||||
|
/[(a + a + 1) b] -> /[3 /[a b]]
|
||||||
|
/[a] -> /[a]
|
74
doc/spec/nock/11.txt
Normal file
74
doc/spec/nock/11.txt
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
Author: Mencius Moldbug (moldbug@gmail.com)
|
||||||
|
Date: 5/25/2008
|
||||||
|
Version: 11K
|
||||||
|
|
||||||
|
1. Introduction
|
||||||
|
|
||||||
|
This file defines one function, "nock."
|
||||||
|
|
||||||
|
nock is in the public domain.
|
||||||
|
|
||||||
|
2. Data
|
||||||
|
|
||||||
|
A "noun" is either an "atom" or a "cell." An "atom" is an unsigned
|
||||||
|
integer of any size. A "cell" is an ordered pair of any two nouns,
|
||||||
|
the "head" and "tail."
|
||||||
|
|
||||||
|
3. Semantics
|
||||||
|
|
||||||
|
nock maps one noun to another. It doesn't always terminate.
|
||||||
|
|
||||||
|
4. Pseudocode
|
||||||
|
|
||||||
|
nock is defined in a pattern-matching pseudocode, below.
|
||||||
|
|
||||||
|
Parentheses enclose cells. (a b c) is (a (b c)).
|
||||||
|
|
||||||
|
5. Definition
|
||||||
|
|
||||||
|
5.1 Transformations
|
||||||
|
|
||||||
|
*(a (b c) d) => (*(a b c) *(a d))
|
||||||
|
*(a 0 b) => /(b a)
|
||||||
|
*(a 1 b) => (b)
|
||||||
|
*(a 2 b c d) => *(a 3 (0 1) 3 (1 c d) (1 0) 3 (1 2 3) (1 0) 5 5 b)
|
||||||
|
*(a 3 b) => **(a b)
|
||||||
|
*(a 4 b) => &*(a b)
|
||||||
|
*(a 5 b) => ^*(a b)
|
||||||
|
*(a 6 b) => =*(a b)
|
||||||
|
|
||||||
|
*(a 7 b c) => *(a 3 (((1 0) b) c) 1 0 3)
|
||||||
|
*(a 8 b c) => *(a c)
|
||||||
|
|
||||||
|
*(a) => *(a)
|
||||||
|
|
||||||
|
5.2 Operators
|
||||||
|
|
||||||
|
5.2.1 Goto (*)
|
||||||
|
|
||||||
|
*(a) -> nock(a)
|
||||||
|
|
||||||
|
5.2.2 Deep (&)
|
||||||
|
|
||||||
|
&(a b) -> 0
|
||||||
|
&(a) -> 1
|
||||||
|
|
||||||
|
5.2.4 Bump (^)
|
||||||
|
|
||||||
|
^(a b) -> ^(a b)
|
||||||
|
^(a) -> a + 1
|
||||||
|
|
||||||
|
5.2.5 Same (=)
|
||||||
|
|
||||||
|
=(a a) -> 0
|
||||||
|
=(a b) -> 1
|
||||||
|
=(a) -> =(a)
|
||||||
|
|
||||||
|
5.2.6 Snip (/)
|
||||||
|
|
||||||
|
/(1 a) -> a
|
||||||
|
/(2 a b) -> a
|
||||||
|
/(3 a b) -> b
|
||||||
|
/((a + a) b) -> /(2 /(a b))
|
||||||
|
/((a + a + 1) b) -> /(3 /(a b))
|
||||||
|
/(a) -> /(a)
|
75
doc/spec/nock/12.txt
Normal file
75
doc/spec/nock/12.txt
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
Author: Curtis Yarvin (curtis.yarvin@gmail.com)
|
||||||
|
Date: 3/28/2008
|
||||||
|
Version: 0.12
|
||||||
|
|
||||||
|
1. Introduction
|
||||||
|
|
||||||
|
This file defines one function, "nock."
|
||||||
|
|
||||||
|
nock is in the public domain.
|
||||||
|
|
||||||
|
2. Data
|
||||||
|
|
||||||
|
A "noun" is either an "atom" or a "cell." An "atom" is an unsigned
|
||||||
|
integer of any size. A "cell" is an ordered pair of any two nouns,
|
||||||
|
the "head" and "tail."
|
||||||
|
|
||||||
|
3. Semantics
|
||||||
|
|
||||||
|
nock maps one noun to another. It doesn't always terminate.
|
||||||
|
|
||||||
|
4. Pseudocode
|
||||||
|
|
||||||
|
nock is defined in a pattern-matching pseudocode, below.
|
||||||
|
|
||||||
|
Parentheses enclose cells. (a b c) is (a (b c)).
|
||||||
|
|
||||||
|
5. Definition
|
||||||
|
|
||||||
|
5.1 Transformations
|
||||||
|
|
||||||
|
*(a (b c) d) => (*(a b c) *(a d))
|
||||||
|
*(a 0 b) => /(b a)
|
||||||
|
*(a 1 b) => (b)
|
||||||
|
*(a 2 b c) => *(*(a b) c)
|
||||||
|
*(a 3 b) => **(a b)
|
||||||
|
*(a 4 b) => &*(a b)
|
||||||
|
*(a 5 b) => ^*(a b)
|
||||||
|
*(a 6 b) => =*(a b)
|
||||||
|
|
||||||
|
*(a 7 b c d) => *(a 3 (0 1) 3 (1 c d) (1 0) 3 (1 2 3) (1 0) 5 5 b)
|
||||||
|
*(a 8 b c) => *(a 2 (((1 0) b) c) 0 3)
|
||||||
|
*(a 9 b c) => *(a c)
|
||||||
|
|
||||||
|
*(a) => *(a)
|
||||||
|
|
||||||
|
5.2 Operators
|
||||||
|
|
||||||
|
5.2.1 Goto (*)
|
||||||
|
|
||||||
|
*(a) -> nock(a)
|
||||||
|
|
||||||
|
5.2.2 Deep (&)
|
||||||
|
|
||||||
|
&(a b) -> 0
|
||||||
|
&(a) -> 1
|
||||||
|
|
||||||
|
5.2.4 Bump (^)
|
||||||
|
|
||||||
|
^(a b) -> ^(a b)
|
||||||
|
^(a) -> a + 1
|
||||||
|
|
||||||
|
5.2.5 Same (=)
|
||||||
|
|
||||||
|
=(a a) -> 0
|
||||||
|
=(a b) -> 1
|
||||||
|
=(a) -> =(a)
|
||||||
|
|
||||||
|
5.2.6 Snip (/)
|
||||||
|
|
||||||
|
/(1 a) -> a
|
||||||
|
/(2 a b) -> a
|
||||||
|
/(3 a b) -> b
|
||||||
|
/((a + a) b) -> /(2 /(a b))
|
||||||
|
/((a + a + 1) b) -> /(3 /(a b))
|
||||||
|
/(a) -> /(a)
|
71
doc/spec/nock/13.txt
Normal file
71
doc/spec/nock/13.txt
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
Author: Curtis Yarvin (curtis.yarvin@gmail.com)
|
||||||
|
Date: 3/8/2008
|
||||||
|
Version: 0.13
|
||||||
|
|
||||||
|
1. Manifest
|
||||||
|
|
||||||
|
This file defines one Turing-complete function, "nock."
|
||||||
|
|
||||||
|
nock is in the public domain. So far as I know, it is
|
||||||
|
neither patentable nor patented. Use it at your own risk.
|
||||||
|
|
||||||
|
2. Data
|
||||||
|
|
||||||
|
Both the domain and range of nock are "nouns."
|
||||||
|
|
||||||
|
A "noun" is either an "atom" or a "cell." An "atom" is an unsigned
|
||||||
|
integer of any size. A "cell" is an ordered pair of any two nouns,
|
||||||
|
the "head" and "tail."
|
||||||
|
|
||||||
|
3. Pseudocode
|
||||||
|
|
||||||
|
nock is defined in a pattern-matching pseudocode.
|
||||||
|
|
||||||
|
Match precedence is top-down. Operators are prefix. Parens
|
||||||
|
denote cells, and group right: (a b c) is (a (b c)).
|
||||||
|
|
||||||
|
4. Definition
|
||||||
|
|
||||||
|
4.1 Transformations
|
||||||
|
|
||||||
|
*(a 0 b c) => *(*(a b) c)
|
||||||
|
*(a 0 b) => /(b a)
|
||||||
|
*(a 1 b) => (b)
|
||||||
|
*(a 2 b) => **(a b)
|
||||||
|
*(a 3 b) => &*(a b)
|
||||||
|
*(a 4 b) => ^*(a b)
|
||||||
|
*(a 5 b) => =*(a b)
|
||||||
|
*(a 6 b c d) => *(a 2 (0 1) 2 (1 c d) (1 0) 2 (1 2 3) (1 0) 4 4 b)
|
||||||
|
*(a b c) => (*(a b) *(a c))
|
||||||
|
*(a) => *(a)
|
||||||
|
|
||||||
|
4.2 Operators
|
||||||
|
|
||||||
|
4.2.1 Goto (*)
|
||||||
|
|
||||||
|
*(a) -> nock(a)
|
||||||
|
|
||||||
|
4.2.2 Deep (&)
|
||||||
|
|
||||||
|
&(a b) -> 0
|
||||||
|
&(a) -> 1
|
||||||
|
|
||||||
|
4.2.3 Bump (^)
|
||||||
|
|
||||||
|
^(a b) -> ^(a b)
|
||||||
|
^(a) -> a + 1
|
||||||
|
|
||||||
|
4.2.4 Same (=)
|
||||||
|
|
||||||
|
=(a a) -> 0
|
||||||
|
=(a b) -> 1
|
||||||
|
=(a) -> =(a)
|
||||||
|
|
||||||
|
4.2.5 Snip (/)
|
||||||
|
|
||||||
|
/(1 a) -> a
|
||||||
|
/(2 a b) -> a
|
||||||
|
/(3 a b) -> b
|
||||||
|
/((a + a) b) -> /(2 /(a b))
|
||||||
|
/((a + a + 1) b) -> /(3 /(a b))
|
||||||
|
/(a) -> /(a)
|
42
doc/spec/nock/6.txt
Normal file
42
doc/spec/nock/6.txt
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
1 Structures
|
||||||
|
|
||||||
|
A noun is an atom or a cell. An atom is any natural number.
|
||||||
|
A cell is an ordered pair of nouns.
|
||||||
|
|
||||||
|
2 Reductions
|
||||||
|
|
||||||
|
nock(a) *a
|
||||||
|
[a b c] [a [b c]]
|
||||||
|
|
||||||
|
?[a b] 0
|
||||||
|
?a 1
|
||||||
|
+a 1 + a
|
||||||
|
=[a a] 0
|
||||||
|
=[a b] 1
|
||||||
|
|
||||||
|
/[1 a] a
|
||||||
|
/[2 a b] a
|
||||||
|
/[3 a b] b
|
||||||
|
/[(a + a) b] /[2 /[a b]]
|
||||||
|
/[(a + a + 1) b] /[3 /[a b]]
|
||||||
|
|
||||||
|
*[a [b c] d] [*[a b c] *[a d]]
|
||||||
|
|
||||||
|
*[a 0 b] /[b a]
|
||||||
|
*[a 1 b] b
|
||||||
|
*[a 2 b c] *[*[a b] *[a c]]
|
||||||
|
*[a 3 b] ?*[a b]
|
||||||
|
*[a 4 b] +*[a b]
|
||||||
|
*[a 5 b] =*[a b]
|
||||||
|
|
||||||
|
*[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
|
||||||
|
*[a 7 b c] *[a 2 b 1 c]
|
||||||
|
*[a 8 b c] *[a 7 [[0 1] b] c]
|
||||||
|
*[a 9 b c] *[a 7 c 0 b]
|
||||||
|
*[a 10 b c] *[a c]
|
||||||
|
*[a 10 [b c] d] *[a 8 c 7 [0 2] d]
|
||||||
|
|
||||||
|
+[a b] +[a b]
|
||||||
|
=a =a
|
||||||
|
/a /a
|
||||||
|
*a *a
|
42
doc/spec/nock/7.txt
Normal file
42
doc/spec/nock/7.txt
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
1 Structures
|
||||||
|
|
||||||
|
A noun is an atom or a cell. An atom is any natural number.
|
||||||
|
A cell is any ordered pair of nouns.
|
||||||
|
|
||||||
|
2 Pseudocode
|
||||||
|
|
||||||
|
[a b c] [a [b c]]
|
||||||
|
nock(a) *a
|
||||||
|
|
||||||
|
?[a b] 0
|
||||||
|
?a 1
|
||||||
|
^a 1 + a
|
||||||
|
=[a a] 0
|
||||||
|
=[a b] 1
|
||||||
|
|
||||||
|
/[1 a] a
|
||||||
|
/[2 a b] a
|
||||||
|
/[3 a b] b
|
||||||
|
/[(a + a) b] /[2 /[a b]]
|
||||||
|
/[(a + a + 1) b] /[3 /[a b]]
|
||||||
|
|
||||||
|
*[a [b c] d] [*[a b c] *[a d]]
|
||||||
|
|
||||||
|
*[a 0 b] /[b a]
|
||||||
|
*[a 1 b] b
|
||||||
|
*[a 2 b c] *[*[a b] *[a c]]
|
||||||
|
*[a 3 b] ?*[a b]
|
||||||
|
*[a 4 b] ^*[a b]
|
||||||
|
*[a 5 b] =*[a b]
|
||||||
|
|
||||||
|
*[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
|
||||||
|
*[a 7 b c] *[a 2 b 1 c]
|
||||||
|
*[a 8 b c] *[a 7 [[7 [0 1] b] 0 1] c]
|
||||||
|
*[a 9 b c] *[a 7 c 0 b]
|
||||||
|
*[a 10 b c] *[a c]
|
||||||
|
*[a 10 [b c] d] *[a 8 c 7 [0 3] d]
|
||||||
|
|
||||||
|
^[a b] ^[a b]
|
||||||
|
=a =a
|
||||||
|
/a /a
|
||||||
|
*a *a
|
45
doc/spec/nock/8.txt
Normal file
45
doc/spec/nock/8.txt
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
1 Structures
|
||||||
|
|
||||||
|
A noun is an atom or a cell. An atom is any unsigned integer.
|
||||||
|
A cell is an ordered pair of nouns.
|
||||||
|
|
||||||
|
2 Pseudocode
|
||||||
|
|
||||||
|
[a b c] is [a [b c]]; *a is nock(a). Reductions match top-down.
|
||||||
|
|
||||||
|
3 Reductions
|
||||||
|
|
||||||
|
?[a b] 0
|
||||||
|
?a 1
|
||||||
|
^a (a + 1)
|
||||||
|
=[a a] 0
|
||||||
|
=[a b] 1
|
||||||
|
|
||||||
|
/[1 a] a
|
||||||
|
/[2 a b] a
|
||||||
|
/[3 a b] b
|
||||||
|
/[(a + a) b] /[2 /[a b]]
|
||||||
|
/[(a + a + 1) b] /[3 /[a b]]
|
||||||
|
|
||||||
|
*[a [b c] d] [*[a b c] *[a d]]
|
||||||
|
*[a 0 b] /[b a]
|
||||||
|
*[a 1 b] b
|
||||||
|
*[a 2 b c] *[*[a b] *[a c]]
|
||||||
|
*[a 3 b] ?*[a b]
|
||||||
|
*[a 4 b] ^*[a b]
|
||||||
|
*[a 5 b] =*[a b]
|
||||||
|
|
||||||
|
*[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
|
||||||
|
*[a 7 b c] *[a 2 b 1 c]
|
||||||
|
*[a 8 b c] *[a 7 [7 b [0 1]] c]
|
||||||
|
*[a 9 b c] *[a 8 b 2 [[7 [0 3] d] [0 5]] 0 5]
|
||||||
|
*[a 10 b c] *[a 8 b 8 [7 [0 3] c] 0 2]
|
||||||
|
*[a 11 b c] *[a 8 b 7 [0 3] c]
|
||||||
|
*[a 12 b c] *[a [1 0] 1 c]
|
||||||
|
|
||||||
|
^[a b] ^[a b]
|
||||||
|
=a =a
|
||||||
|
/a /a
|
||||||
|
*a *a
|
||||||
|
|
||||||
|
|
43
doc/spec/nock/9.txt
Normal file
43
doc/spec/nock/9.txt
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
1 Context
|
||||||
|
|
||||||
|
This spec defines one function, Nock.
|
||||||
|
|
||||||
|
2 Structures
|
||||||
|
|
||||||
|
A noun is an atom or a cell. An atom is any unsigned integer.
|
||||||
|
A cell is an ordered pair of any two nouns.
|
||||||
|
|
||||||
|
3 Pseudocode
|
||||||
|
|
||||||
|
Brackets enclose cells. [a b c] is [a [b c]].
|
||||||
|
|
||||||
|
*a is Nock(a). Reductions match top-down.
|
||||||
|
|
||||||
|
4 Reductions
|
||||||
|
|
||||||
|
?[a b] => 0
|
||||||
|
?a => 1
|
||||||
|
|
||||||
|
^[a b] => ^[a b]
|
||||||
|
^a => (a + 1)
|
||||||
|
|
||||||
|
=[a a] => 0
|
||||||
|
=[a b] => 1
|
||||||
|
=a => =a
|
||||||
|
|
||||||
|
/[1 a] => a
|
||||||
|
/[2 a b] => a
|
||||||
|
/[3 a b] => b
|
||||||
|
/[(a + a) b] => /[2 /[a b]]
|
||||||
|
/[(a + a + 1) b] => /[3 /[a b]]
|
||||||
|
/a => /a
|
||||||
|
|
||||||
|
*[a 0 b] => /[b a]
|
||||||
|
*[a 1 b] => b
|
||||||
|
*[a 2 b c d] => *[a 3 [0 1] 3 [1 c d] [1 0] 3 [1 2 3] [1 0] 5 5 b]
|
||||||
|
*[a 3 b] => **[a b]
|
||||||
|
*[a 4 b] => ?*[a b]
|
||||||
|
*[a 5 b] => ^*[a b]
|
||||||
|
*[a 6 b] => =*[a b]
|
||||||
|
*[a [b c] d] => [*[a b c] *[a d]]
|
||||||
|
*a => *a
|
@ -4,7 +4,7 @@
|
|||||||
naive,
|
naive,
|
||||||
dice,
|
dice,
|
||||||
default-agent,
|
default-agent,
|
||||||
/ verb,
|
verb,
|
||||||
dbug
|
dbug
|
||||||
:: To update, run from dojo:
|
:: To update, run from dojo:
|
||||||
:: -azimuth-snap-state %default 'version-0'
|
:: -azimuth-snap-state %default 'version-0'
|
||||||
|
@ -716,7 +716,7 @@
|
|||||||
'rtt'^(numb (div rtt ~s1))
|
'rtt'^(numb (div rtt ~s1))
|
||||||
'rttvar'^(numb (div rttvar ~s1))
|
'rttvar'^(numb (div rttvar ~s1))
|
||||||
'ssthresh'^(numb ssthresh)
|
'ssthresh'^(numb ssthresh)
|
||||||
'num-live'^(numb num-live)
|
'num-live'^(numb ~(wyt by live))
|
||||||
'cwnd'^(numb cwnd)
|
'cwnd'^(numb cwnd)
|
||||||
'counter'^(numb counter)
|
'counter'^(numb counter)
|
||||||
==
|
==
|
||||||
|
File diff suppressed because one or more lines are too long
@ -415,7 +415,7 @@
|
|||||||
==
|
==
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
:: |de: axal engine
|
:: |of: axal engine
|
||||||
::
|
::
|
||||||
++ of
|
++ of
|
||||||
=| fat=(axal)
|
=| fat=(axal)
|
||||||
|
@ -1247,10 +1247,10 @@
|
|||||||
=| [l=(unit) r=(unit)]
|
=| [l=(unit) r=(unit)]
|
||||||
|. ^- ?
|
|. ^- ?
|
||||||
?~ a &
|
?~ a &
|
||||||
?& ?~(l & (gor n.a u.l))
|
?& ?~(l & &((gor n.a u.l) !=(n.a u.l)))
|
||||||
?~(r & (gor u.r n.a))
|
?~(r & &((gor u.r n.a) !=(u.r n.a)))
|
||||||
?~(l.a & ?&((mor n.a n.l.a) $(a l.a, l `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) $(a r.a, r `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
|
++ bif :: splits a by b
|
||||||
|
@ -745,6 +745,7 @@
|
|||||||
$% [%private-keys ~]
|
$% [%private-keys ~]
|
||||||
[%public-keys ships=(set ship)]
|
[%public-keys ships=(set ship)]
|
||||||
[%turf ~]
|
[%turf ~]
|
||||||
|
[%ruin ships=(set ship)]
|
||||||
== ==
|
== ==
|
||||||
$: @tas
|
$: @tas
|
||||||
$% [%plea =ship =plea]
|
$% [%plea =ship =plea]
|
||||||
@ -1297,7 +1298,7 @@
|
|||||||
=(%$ syd)
|
=(%$ syd)
|
||||||
==
|
==
|
||||||
?. for.veb.bug.ames-state ~
|
?. for.veb.bug.ames-state ~
|
||||||
~> %slog.0^leaf/"ames: scry-fail {<[why=why lot=lot now=now syd=syd]>}"
|
~> %slog.0^leaf/"ames: scry-fail {<why=why lot=lot now=now syd=syd>}"
|
||||||
~
|
~
|
||||||
:: /ax/protocol/version @
|
:: /ax/protocol/version @
|
||||||
:: /ax/peers (map ship ?(%alien %known))
|
:: /ax/peers (map ship ?(%alien %known))
|
||||||
@ -1833,28 +1834,30 @@
|
|||||||
|. ^- tape
|
|. ^- tape
|
||||||
=/ sndr [our our-life.channel]
|
=/ sndr [our our-life.channel]
|
||||||
=/ rcvr [ship her-life.channel]
|
=/ rcvr [ship her-life.channel]
|
||||||
"plea {<sndr^rcvr^bone=bone^vane.plea^path.plea>}"
|
"plea {<sndr rcvr bone=bone vane.plea path.plea>}"
|
||||||
abet:(on-memo:(make-peer-core peer-state channel) bone plea %plea)
|
abet:(on-memo:(make-peer-core peer-state channel) bone plea %plea)
|
||||||
:: +on-cork: handle request to kill a flow
|
:: +on-cork: handle request to kill a flow
|
||||||
::
|
::
|
||||||
++ on-cork
|
++ on-cork
|
||||||
|= =ship
|
|= =ship
|
||||||
^+ event-core
|
^+ event-core
|
||||||
|
=/ =plea [%$ /flow [%cork ~]]
|
||||||
=/ ship-state (~(get by peers.ames-state) ship)
|
=/ ship-state (~(get by peers.ames-state) ship)
|
||||||
::
|
?. ?=([~ %known *] ship-state)
|
||||||
?> ?=([~ %known *] ship-state)
|
%+ enqueue-alien-todo ship
|
||||||
|
|= todos=alien-agenda
|
||||||
|
todos(messages [[duct plea] messages.todos])
|
||||||
=/ =peer-state +.u.ship-state
|
=/ =peer-state +.u.ship-state
|
||||||
=/ =channel [[our ship] now channel-state -.peer-state]
|
=/ =channel [[our ship] now channel-state -.peer-state]
|
||||||
::
|
::
|
||||||
=^ =bone ossuary.peer-state (bind-duct ossuary.peer-state duct)
|
=^ =bone ossuary.peer-state (bind-duct ossuary.peer-state duct)
|
||||||
=/ =plea [%$ /flow [%cork ~]]
|
|
||||||
::
|
::
|
||||||
=. closing.peer-state (~(put in closing.peer-state) bone)
|
=. closing.peer-state (~(put in closing.peer-state) bone)
|
||||||
%- %^ trace msg.veb ship
|
%- %^ trace msg.veb ship
|
||||||
|. ^- tape
|
|. ^- tape
|
||||||
=/ sndr [our our-life.channel]
|
=/ sndr [our our-life.channel]
|
||||||
=/ rcvr [ship her-life.channel]
|
=/ rcvr [ship her-life.channel]
|
||||||
"cork plea {<sndr^rcvr^bone=bone^vane.plea^path.plea>}"
|
"cork plea {<sndr rcvr bone=bone vane.plea path.plea>}"
|
||||||
abet:(on-memo:(make-peer-core peer-state channel) bone plea %plea)
|
abet:(on-memo:(make-peer-core peer-state channel) bone plea %plea)
|
||||||
:: +on-take-wake: receive wakeup or error notification from behn
|
:: +on-take-wake: receive wakeup or error notification from behn
|
||||||
::
|
::
|
||||||
@ -1982,14 +1985,14 @@
|
|||||||
:: we shouldn't be hearing about ships we don't care about
|
:: we shouldn't be hearing about ships we don't care about
|
||||||
::
|
::
|
||||||
?~ ship-state
|
?~ ship-state
|
||||||
~> %slog.0^leaf/"ames: breach unknown {<our^ship>}"
|
~> %slog.0^leaf/"ames: breach unknown {<our ship>}"
|
||||||
event-core
|
event-core
|
||||||
:: if an alien breached, this doesn't affect us
|
:: if an alien breached, this doesn't affect us
|
||||||
::
|
::
|
||||||
?: ?=([~ %alien *] ship-state)
|
?: ?=([~ %alien *] ship-state)
|
||||||
~> %slog.0^leaf/"ames: breach alien {<our^ship>}"
|
~> %slog.0^leaf/"ames: breach alien {<our ship>}"
|
||||||
event-core
|
event-core
|
||||||
~> %slog.0^leaf/"ames: breach peer {<our^ship>}"
|
~> %slog.0^leaf/"ames: breach peer {<our ship>}"
|
||||||
:: a peer breached; drop messaging state
|
:: a peer breached; drop messaging state
|
||||||
::
|
::
|
||||||
=/ =peer-state +.u.ship-state
|
=/ =peer-state +.u.ship-state
|
||||||
@ -2122,6 +2125,8 @@
|
|||||||
=. event-core
|
=. event-core
|
||||||
%+ reel messages.todos
|
%+ reel messages.todos
|
||||||
|= [[=^duct =plea] core=_event-core]
|
|= [[=^duct =plea] core=_event-core]
|
||||||
|
?: ?=(%$ -.plea)
|
||||||
|
(on-cork:core(duct duct) ship)
|
||||||
(on-plea:core(duct duct) ship plea)
|
(on-plea:core(duct duct) ship plea)
|
||||||
:: apply outgoing packet blobs
|
:: apply outgoing packet blobs
|
||||||
::
|
::
|
||||||
@ -2200,10 +2205,27 @@
|
|||||||
::
|
::
|
||||||
(emit unix-duct.ames-state %give %turf turfs)
|
(emit unix-duct.ames-state %give %turf turfs)
|
||||||
:: +on-vega: handle kernel reload
|
:: +on-vega: handle kernel reload
|
||||||
:: +on-trim: handle request to free memory
|
|
||||||
::
|
::
|
||||||
++ on-vega event-core
|
++ on-vega event-core
|
||||||
++ on-trim event-core
|
:: +on-trim: handle request to free memory
|
||||||
|
::
|
||||||
|
:: %ruin comets not seen for six months
|
||||||
|
::
|
||||||
|
++ on-trim
|
||||||
|
^+ event-core
|
||||||
|
=; rui=(set @p)
|
||||||
|
(emit duct %pass /ruin %j %ruin rui)
|
||||||
|
=- (silt (turn - head))
|
||||||
|
%+ skim
|
||||||
|
~(tap by peers.ames-state)
|
||||||
|
|= [=ship s=ship-state]
|
||||||
|
?. &(?=(%known -.s) =(%pawn (clan:title ship))) %.n
|
||||||
|
?& (gth (sub now ~d180) last-contact.qos.s)
|
||||||
|
::
|
||||||
|
%- ~(any by snd.s)
|
||||||
|
|= m=message-pump-state
|
||||||
|
!=(~ unsent-fragments.m)
|
||||||
|
==
|
||||||
:: +enqueue-alien-todo: helper to enqueue a pending request
|
:: +enqueue-alien-todo: helper to enqueue a pending request
|
||||||
::
|
::
|
||||||
:: Also requests key and life from Jael on first request.
|
:: Also requests key and life from Jael on first request.
|
||||||
@ -2649,12 +2671,12 @@
|
|||||||
=(~ unsent-fragments.pum)
|
=(~ unsent-fragments.pum)
|
||||||
=(~ live.packet-pump-state.pum)
|
=(~ live.packet-pump-state.pum)
|
||||||
==
|
==
|
||||||
~> %slog.0^leaf/"ames: bad pump state {<[her.channel i.boz]>}"
|
~> %slog.0^leaf/"ames: bad pump state {<her.channel i.boz>}"
|
||||||
$(boz t.boz)
|
$(boz t.boz)
|
||||||
:: no outstanding messages, so send a new %cork
|
:: no outstanding messages, so send a new %cork
|
||||||
::
|
::
|
||||||
:: TODO use +trace
|
:: TODO use +trace
|
||||||
~> %slog.0^leaf/"ames: recork {<[her.channel i.boz]>}"
|
~> %slog.0^leaf/"ames: recork {<her.channel i.boz>}"
|
||||||
=/ =plea [%$ /flow [%cork ~]]
|
=/ =plea [%$ /flow [%cork ~]]
|
||||||
(on-memo i.boz plea %plea)
|
(on-memo i.boz plea %plea)
|
||||||
:: +got-duct: look up $duct by .bone, asserting already bound
|
:: +got-duct: look up $duct by .bone, asserting already bound
|
||||||
@ -2827,11 +2849,18 @@
|
|||||||
::
|
::
|
||||||
(emit [/ames]~ %pass wire %b %rest next-wake)
|
(emit [/ames]~ %pass wire %b %rest next-wake)
|
||||||
=/ nax-bone=^bone (mix 0b10 bone)
|
=/ nax-bone=^bone (mix 0b10 bone)
|
||||||
|
=? peer-core (~(has by snd.peer-state) nax-bone)
|
||||||
|
%. peer-core
|
||||||
|
%+ trace odd.veb
|
||||||
|
=/ dat [her.channel bone=nax-bone message-num=message-num -.task]
|
||||||
|
|.("remove naxplanation flow {<dat>}")
|
||||||
=. peer-state
|
=. peer-state
|
||||||
=, peer-state
|
=, peer-state
|
||||||
%_ peer-state
|
%_ peer-state
|
||||||
|
:: preemptively delete nax flows (e.g. nacks for initial %watches)
|
||||||
|
::
|
||||||
|
snd (~(del by (~(del by snd) bone)) nax-bone)
|
||||||
rcv (~(del by rcv) bone)
|
rcv (~(del by rcv) bone)
|
||||||
snd (~(del by snd) bone)
|
|
||||||
corked (~(put in corked) bone)
|
corked (~(put in corked) bone)
|
||||||
closing (~(del in closing) bone)
|
closing (~(del in closing) bone)
|
||||||
krocs (~(del in krocs) bone)
|
krocs (~(del in krocs) bone)
|
||||||
@ -3255,9 +3284,14 @@
|
|||||||
++ packet-queue
|
++ packet-queue
|
||||||
%- (ordered-map live-packet-key live-packet-val)
|
%- (ordered-map live-packet-key live-packet-val)
|
||||||
lte-packets
|
lte-packets
|
||||||
|
:: +live-packets: number of sent packets awaiting ack
|
||||||
|
::
|
||||||
|
++ live-packets
|
||||||
|
^- @ud
|
||||||
|
~(wyt by live.state)
|
||||||
:: +gauge: inflate a |pump-gauge to track congestion control
|
:: +gauge: inflate a |pump-gauge to track congestion control
|
||||||
::
|
::
|
||||||
++ gauge (make-pump-gauge now.channel metrics.state [her bug]:channel)
|
++ gauge (make-pump-gauge metrics.state live-packets [now her bug]:channel)
|
||||||
:: +work: handle $packet-pump-task request
|
:: +work: handle $packet-pump-task request
|
||||||
::
|
::
|
||||||
++ work
|
++ work
|
||||||
@ -3312,7 +3346,7 @@
|
|||||||
=? packet-pump ?=(^ static-fragment)
|
=? packet-pump ?=(^ static-fragment)
|
||||||
%- %+ trace snd.veb
|
%- %+ trace snd.veb
|
||||||
=/ nums [message-num fragment-num]:u.static-fragment.res
|
=/ nums [message-num fragment-num]:u.static-fragment.res
|
||||||
|.("dead {<nums^show:gauge>}")
|
|.("dead {<nums show:gauge>}")
|
||||||
(give %send u.static-fragment.res)
|
(give %send u.static-fragment.res)
|
||||||
packet-pump
|
packet-pump
|
||||||
::
|
::
|
||||||
@ -3371,7 +3405,6 @@
|
|||||||
:: update .live and .metrics
|
:: update .live and .metrics
|
||||||
::
|
::
|
||||||
=. live.state (gas:packet-queue live.state send-list)
|
=. live.state (gas:packet-queue live.state send-list)
|
||||||
=. metrics.state (on-sent:gauge (lent send-list))
|
|
||||||
:: TMI
|
:: TMI
|
||||||
::
|
::
|
||||||
=> .(sent `(list static-fragment)`sent)
|
=> .(sent `(list static-fragment)`sent)
|
||||||
@ -3433,7 +3466,7 @@
|
|||||||
=(0 (mod counter.metrics.state 20))
|
=(0 (mod counter.metrics.state 20))
|
||||||
==
|
==
|
||||||
same
|
same
|
||||||
(trace snd.veb |.("send: {<[fragment=fragment-num show:gauge]>}"))
|
(trace snd.veb |.("send: {<fragment=fragment-num show:gauge>}"))
|
||||||
:: .resends is backward, so fold backward and emit
|
:: .resends is backward, so fold backward and emit
|
||||||
::
|
::
|
||||||
=. packet-pump
|
=. packet-pump
|
||||||
@ -3457,7 +3490,7 @@
|
|||||||
==
|
==
|
||||||
^- [new-val=(unit live-packet-val) stop=? _acc]
|
^- [new-val=(unit live-packet-val) stop=? _acc]
|
||||||
::
|
::
|
||||||
=/ gauge (make-pump-gauge now.channel metrics.acc [her bug]:channel)
|
=/ gauge (make-pump-gauge metrics.acc live-packets [now her bug]:channel)
|
||||||
:: is this the acked packet?
|
:: is this the acked packet?
|
||||||
::
|
::
|
||||||
?: =(key [message-num fragment-num])
|
?: =(key [message-num fragment-num])
|
||||||
@ -3492,7 +3525,7 @@
|
|||||||
=- =. metrics.state metrics.-
|
=- =. metrics.state metrics.-
|
||||||
=. live.state live.-
|
=. live.state live.-
|
||||||
::
|
::
|
||||||
%- (trace snd.veb |.("done {<message-num=message-num^show:gauge>}"))
|
%- (trace snd.veb |.("done {<message-num=message-num show:gauge>}"))
|
||||||
(fast-resend-after-ack message-num `fragment-num`0)
|
(fast-resend-after-ack message-num `fragment-num`0)
|
||||||
::
|
::
|
||||||
^+ [metrics=metrics.state live=live.state]
|
^+ [metrics=metrics.state live=live.state]
|
||||||
@ -3504,7 +3537,7 @@
|
|||||||
==
|
==
|
||||||
^- [new-val=(unit live-packet-val) stop=? pump-metrics]
|
^- [new-val=(unit live-packet-val) stop=? pump-metrics]
|
||||||
::
|
::
|
||||||
=/ gauge (make-pump-gauge now.channel metrics [her bug]:channel)
|
=/ gauge (make-pump-gauge metrics live-packets [now her bug]:channel)
|
||||||
:: if we get an out-of-order ack for a message, skip until it
|
:: if we get an out-of-order ack for a message, skip until it
|
||||||
::
|
::
|
||||||
?: (lth message-num.key message-num)
|
?: (lth message-num.key message-num)
|
||||||
@ -3552,9 +3585,10 @@
|
|||||||
:: +make-pump-gauge: construct |pump-gauge congestion control core
|
:: +make-pump-gauge: construct |pump-gauge congestion control core
|
||||||
::
|
::
|
||||||
++ make-pump-gauge
|
++ make-pump-gauge
|
||||||
|= [now=@da pump-metrics =ship =bug]
|
|= [pump-metrics live-packets=@ud now=@da =ship =bug]
|
||||||
|
:: TODO rename live-packets num-live
|
||||||
=* veb veb.bug
|
=* veb veb.bug
|
||||||
=* metrics +<+<
|
=* metrics +<-
|
||||||
|%
|
|%
|
||||||
++ trace
|
++ trace
|
||||||
|= [verb=? print=(trap tape)]
|
|= [verb=? print=(trap tape)]
|
||||||
@ -3574,15 +3608,7 @@
|
|||||||
::
|
::
|
||||||
++ num-slots
|
++ num-slots
|
||||||
^- @ud
|
^- @ud
|
||||||
(sub-safe cwnd num-live)
|
(sub-safe cwnd live-packets)
|
||||||
:: +on-sent: adjust metrics based on sending .num-sent fresh packets
|
|
||||||
::
|
|
||||||
++ on-sent
|
|
||||||
|= num-sent=@ud
|
|
||||||
^- pump-metrics
|
|
||||||
::
|
|
||||||
=. num-live (add num-live num-sent)
|
|
||||||
metrics
|
|
||||||
:: +on-ack: adjust metrics based on a packet getting acknowledged
|
:: +on-ack: adjust metrics based on a packet getting acknowledged
|
||||||
::
|
::
|
||||||
++ on-ack
|
++ on-ack
|
||||||
@ -3590,7 +3616,6 @@
|
|||||||
^- pump-metrics
|
^- pump-metrics
|
||||||
::
|
::
|
||||||
=. counter +(counter)
|
=. counter +(counter)
|
||||||
=. num-live (dec num-live)
|
|
||||||
:: if below congestion threshold, add 1; else, add avg. 1 / cwnd
|
:: if below congestion threshold, add 1; else, add avg. 1 / cwnd
|
||||||
::
|
::
|
||||||
=. cwnd
|
=. cwnd
|
||||||
@ -3630,7 +3655,7 @@
|
|||||||
::
|
::
|
||||||
=? cwnd !in-recovery (max 2 (div cwnd 2))
|
=? cwnd !in-recovery (max 2 (div cwnd 2))
|
||||||
%- %+ trace snd.veb
|
%- %+ trace snd.veb
|
||||||
|.("skip {<[resend=resend in-recovery=in-recovery show]>}")
|
|.("skip {<resend=resend in-recovery=in-recovery show>}")
|
||||||
metrics
|
metrics
|
||||||
:: +on-timeout: (re)enter slow-start mode on packet loss
|
:: +on-timeout: (re)enter slow-start mode on packet loss
|
||||||
::
|
::
|
||||||
@ -3656,12 +3681,12 @@
|
|||||||
(lth cwnd ssthresh)
|
(lth cwnd ssthresh)
|
||||||
:: +in-recovery: %.y iff we're recovering from a skipped packet
|
:: +in-recovery: %.y iff we're recovering from a skipped packet
|
||||||
::
|
::
|
||||||
:: We finish recovering when .num-live finally dips back down to
|
:: We finish recovering when .live-packets finally dips back down to
|
||||||
:: .cwnd.
|
:: .cwnd.
|
||||||
::
|
::
|
||||||
++ in-recovery
|
++ in-recovery
|
||||||
^- ?
|
^- ?
|
||||||
(gth num-live cwnd)
|
(gth live-packets cwnd)
|
||||||
:: +sub-safe: subtract with underflow protection
|
:: +sub-safe: subtract with underflow protection
|
||||||
::
|
::
|
||||||
++ sub-safe
|
++ sub-safe
|
||||||
@ -3678,7 +3703,7 @@
|
|||||||
rttvar=(div rttvar ms)
|
rttvar=(div rttvar ms)
|
||||||
ssthresh=ssthresh
|
ssthresh=ssthresh
|
||||||
cwnd=cwnd
|
cwnd=cwnd
|
||||||
num-live=num-live
|
num-live=live-packets
|
||||||
counter=counter
|
counter=counter
|
||||||
==
|
==
|
||||||
--
|
--
|
||||||
@ -3724,7 +3749,7 @@
|
|||||||
::
|
::
|
||||||
?: (gte seq (add 10 last-acked.state))
|
?: (gte seq (add 10 last-acked.state))
|
||||||
%- %+ trace odd.veb
|
%- %+ trace odd.veb
|
||||||
|.("future %hear {<seq=seq^last-acked=last-acked.state>}")
|
|.("future %hear {<seq=seq last-acked=last-acked.state>}")
|
||||||
message-sink
|
message-sink
|
||||||
::
|
::
|
||||||
=/ is-last-fragment=? =(+(fragment-num) num-fragments)
|
=/ is-last-fragment=? =(+(fragment-num) num-fragments)
|
||||||
@ -3735,7 +3760,7 @@
|
|||||||
:: single packet ack
|
:: single packet ack
|
||||||
::
|
::
|
||||||
%- %+ trace rcv.veb
|
%- %+ trace rcv.veb
|
||||||
|.("send dupe ack {<seq=seq^fragment-num=fragment-num>}")
|
|.("send dupe ack {<seq=seq fragment-num>}")
|
||||||
(give %send seq %& fragment-num)
|
(give %send seq %& fragment-num)
|
||||||
:: whole message (n)ack
|
:: whole message (n)ack
|
||||||
::
|
::
|
||||||
@ -3755,8 +3780,8 @@
|
|||||||
%- %+ trace rcv.veb
|
%- %+ trace rcv.veb
|
||||||
|. ^- tape
|
|. ^- tape
|
||||||
=/ data
|
=/ data
|
||||||
:* her.channel seq=seq bone=bone
|
:* her.channel seq=seq bone=bone.shut-packet
|
||||||
fragment-num=fragment-num num-fragments=num-fragments
|
fragment-num num-fragments
|
||||||
la=last-acked.state lh=last-heard.state
|
la=last-acked.state lh=last-heard.state
|
||||||
==
|
==
|
||||||
"hear last in-progress {<data>}"
|
"hear last in-progress {<data>}"
|
||||||
@ -3765,8 +3790,8 @@
|
|||||||
::
|
::
|
||||||
%- %+ trace rcv.veb |.
|
%- %+ trace rcv.veb |.
|
||||||
=/ data
|
=/ data
|
||||||
:* seq=seq fragment-num=fragment-num
|
:* seq=seq fragment-num
|
||||||
num-fragments=num-fragments closing=closing
|
num-fragments closing=closing
|
||||||
==
|
==
|
||||||
"send ack-1 {<data>}"
|
"send ack-1 {<data>}"
|
||||||
(give %send seq %& fragment-num)
|
(give %send seq %& fragment-num)
|
||||||
@ -3796,7 +3821,7 @@
|
|||||||
"hear last dupe {<data>}"
|
"hear last dupe {<data>}"
|
||||||
message-sink
|
message-sink
|
||||||
%- %+ trace rcv.veb
|
%- %+ trace rcv.veb
|
||||||
|.("send dupe ack {<her.channel^seq=seq^fragment-num=fragment-num>}")
|
|.("send dupe ack {<her.channel seq=seq fragment-num>}")
|
||||||
(give %send seq %& fragment-num)
|
(give %send seq %& fragment-num)
|
||||||
:: new fragment; store in state and check if message is done
|
:: new fragment; store in state and check if message is done
|
||||||
::
|
::
|
||||||
@ -3813,7 +3838,7 @@
|
|||||||
=? message-sink !is-last-fragment
|
=? message-sink !is-last-fragment
|
||||||
%- %+ trace rcv.veb |.
|
%- %+ trace rcv.veb |.
|
||||||
=/ data
|
=/ data
|
||||||
[seq=seq fragment-num=fragment-num num-fragments=num-fragments]
|
[seq=seq fragment-num num-fragments]
|
||||||
"send ack-2 {<data>}"
|
"send ack-2 {<data>}"
|
||||||
(give %send seq %& fragment-num)
|
(give %send seq %& fragment-num)
|
||||||
:: enqueue all completed messages starting at +(last-heard.state)
|
:: enqueue all completed messages starting at +(last-heard.state)
|
||||||
|
@ -523,6 +523,11 @@
|
|||||||
?~ error=error.sign-arvo
|
?~ error=error.sign-arvo
|
||||||
~
|
~
|
||||||
`[[%leaf (trip tag.u.error)] tang.u.error]
|
`[[%leaf (trip tag.u.error)] tang.u.error]
|
||||||
|
:: send a %cork if we get a nack upon initial subscription
|
||||||
|
::
|
||||||
|
=? mo-core
|
||||||
|
&(?=(^ err) |(?=(%watch-as remote-request) ?=(%watch remote-request)))
|
||||||
|
(mo-pass [%sys wire] %a %cork ship)
|
||||||
::
|
::
|
||||||
?- remote-request
|
?- remote-request
|
||||||
%watch-as (mo-give %unto %watch-ack err)
|
%watch-as (mo-give %unto %watch-ack err)
|
||||||
|
@ -462,12 +462,12 @@
|
|||||||
:: [%vega ~]
|
:: [%vega ~]
|
||||||
::
|
::
|
||||||
%vega
|
%vega
|
||||||
+>.$::
|
+>.$
|
||||||
|
::
|
||||||
:: in response to memory pressure
|
:: in response to memory pressure
|
||||||
:: [%trim p=@ud]
|
:: [%trim p=@ud]
|
||||||
::
|
::
|
||||||
%trim
|
%trim
|
||||||
::TODO consider %ruin-ing long-offline comets
|
|
||||||
+>.$
|
+>.$
|
||||||
::
|
::
|
||||||
:: watch private keys
|
:: watch private keys
|
||||||
@ -736,12 +736,10 @@
|
|||||||
++ subscribers-on-ship
|
++ subscribers-on-ship
|
||||||
|= =ship
|
|= =ship
|
||||||
^- (set duct)
|
^- (set duct)
|
||||||
=/ specific-subs (~(get ju ney.zim) ship)
|
:: union of general and ship-specific subs
|
||||||
=/ general-subs=(set duct)
|
::
|
||||||
?: ?=(?(%czar %king %duke) (clan:title ship))
|
%- ~(uni in nel.zim)
|
||||||
nel.zim
|
(~(get ju ney.zim) ship)
|
||||||
~
|
|
||||||
(~(uni in specific-subs) general-subs)
|
|
||||||
::
|
::
|
||||||
++ feed
|
++ feed
|
||||||
|_ :: hen: subscription source
|
|_ :: hen: subscription source
|
||||||
@ -997,7 +995,7 @@
|
|||||||
=| lex=state-2
|
=| lex=state-2
|
||||||
|= $: :: now: current time
|
|= $: :: now: current time
|
||||||
:: eny: unique entropy
|
:: eny: unique entropy
|
||||||
:: ski: namespace resolver
|
:: rof: namespace resolver
|
||||||
::
|
::
|
||||||
now=@da
|
now=@da
|
||||||
eny=@uvJ
|
eny=@uvJ
|
||||||
|
@ -106,6 +106,10 @@
|
|||||||
:: Doesn't follow horizontal & vertical ordering
|
:: Doesn't follow horizontal & vertical ordering
|
||||||
::
|
::
|
||||||
=/ unbalanced-e=(set @) [1 [3 ~ ~] [2 ~ ~]]
|
=/ unbalanced-e=(set @) [1 [3 ~ ~] [2 ~ ~]]
|
||||||
|
:: Duplicate elements
|
||||||
|
::
|
||||||
|
=/ has-dupes=(set @) [1 [1 ~ ~] ~]
|
||||||
|
::
|
||||||
;: weld
|
;: weld
|
||||||
%+ expect-eq
|
%+ expect-eq
|
||||||
!> [%b-a %.y]
|
!> [%b-a %.y]
|
||||||
@ -125,6 +129,9 @@
|
|||||||
%+ expect-eq
|
%+ expect-eq
|
||||||
!> [%u-e %.n]
|
!> [%u-e %.n]
|
||||||
!> [%u-e ~(apt in unbalanced-e)]
|
!> [%u-e ~(apt in unbalanced-e)]
|
||||||
|
%+ expect-eq
|
||||||
|
!> [%h-d %.n]
|
||||||
|
!> [%h-d ~(apt in has-dupes)]
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
:: Test splits a in b
|
:: Test splits a in b
|
||||||
|
@ -143,6 +143,7 @@
|
|||||||
|= a=@
|
|= a=@
|
||||||
^- hexb
|
^- hexb
|
||||||
=/ l=@ (met 3 a)
|
=/ l=@ (met 3 a)
|
||||||
|
?: =(l 0) 1^a
|
||||||
?: =(l 1) 1^a
|
?: =(l 1) 1^a
|
||||||
?: =(l 2) (cat:byt ~[1^0xfd (flip:byt 2^a)])
|
?: =(l 2) (cat:byt ~[1^0xfd (flip:byt 2^a)])
|
||||||
?: (lte l 4) (cat:byt ~[1^0xfe (flip:byt 4^a)])
|
?: (lte l 4) (cat:byt ~[1^0xfe (flip:byt 4^a)])
|
||||||
@ -162,7 +163,7 @@
|
|||||||
%0xfe 2
|
%0xfe 2
|
||||||
%0xff 3
|
%0xff 3
|
||||||
==
|
==
|
||||||
:_ (drop:byt (add 1 len) h)
|
:_ (drop:byt (add 1 (bex len)) h)
|
||||||
%- flip:byt
|
%- flip:byt
|
||||||
(take:byt (bex len) (drop:byt 1 h))
|
(take:byt (bex len) (drop:byt 1 h))
|
||||||
:: +dea: atom instead of hexb for parsed CompactSize
|
:: +dea: atom instead of hexb for parsed CompactSize
|
||||||
|
@ -3,7 +3,8 @@
|
|||||||
::
|
::
|
||||||
=/ debug |
|
=/ debug |
|
||||||
|%
|
|%
|
||||||
+* option [item]
|
++ option
|
||||||
|
|$ [item]
|
||||||
[term=cord detail=item]
|
[term=cord detail=item]
|
||||||
::
|
::
|
||||||
:: Like +rose except also produces line number
|
:: Like +rose except also produces line number
|
||||||
|
@ -158,6 +158,7 @@ a {
|
|||||||
@media all and (prefers-color-scheme: dark) {
|
@media all and (prefers-color-scheme: dark) {
|
||||||
body {
|
body {
|
||||||
background-color: #333;
|
background-color: #333;
|
||||||
|
color: white;
|
||||||
}
|
}
|
||||||
.bg-black-d {
|
.bg-black-d {
|
||||||
background-color: black;
|
background-color: black;
|
||||||
|
@ -24,7 +24,7 @@ With:
|
|||||||
import UrbitInterface from '@urbit/http-api';
|
import UrbitInterface from '@urbit/http-api';
|
||||||
import { settings } from '@urbit/api';
|
import { settings } from '@urbit/api';
|
||||||
const api: UrbitInterface = useApi();
|
const api: UrbitInterface = useApi();
|
||||||
api.poke(setings.putEntry(bucket, key, value));
|
api.poke(settings.putEntry(bucket, key, value));
|
||||||
```
|
```
|
||||||
|
|
||||||
You may import single functions
|
You may import single functions
|
||||||
@ -38,4 +38,4 @@ import { settings } from '@urbit/api';
|
|||||||
|
|
||||||
This package also provides types and utilities for working with Urbit's internal data structures, such as Nouns, Das, Tas, and so forth.
|
This package also provides types and utilities for working with Urbit's internal data structures, such as Nouns, Das, Tas, and so forth.
|
||||||
|
|
||||||
This package was originally developed as part of Tlon's Landscape client and therefore the best reference material exists [there](https://github.com/urbit/urbit/tree/master/pkg/interface/src).
|
This package was originally developed as part of Tlon's Landscape client and therefore the best reference material exists [there](https://github.com/urbit/urbit/tree/master/pkg/interface/src).
|
||||||
|
@ -13,15 +13,21 @@ _in_apt(u3_noun a, u3_weak l, u3_weak r)
|
|||||||
u3_noun n_a, l_a, r_a;
|
u3_noun n_a, l_a, r_a;
|
||||||
u3x_trel(a, &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;
|
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;
|
return c3n;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( u3_nul != l_a ) {
|
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)) ) {
|
if ( c3n == u3qc_mor(n_a, u3h(l_a)) ) {
|
||||||
return c3n;
|
return c3n;
|
||||||
}
|
}
|
||||||
@ -32,6 +38,10 @@ _in_apt(u3_noun a, u3_weak l, u3_weak r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( u3_nul != r_a ) {
|
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)) ) {
|
if ( c3n == u3qc_mor(n_a, u3h(r_a)) ) {
|
||||||
return c3n;
|
return c3n;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user