aboutsummaryrefslogtreecommitdiffstats
path: root/research/experiments
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-01 09:18:23 +0100
committereunhhu <[email protected]>2026-10-01 09:18:23 +0100
commitd1db24f0e5c3bba583a1f2a9d8a0c9d3fc64a55c (patch)
treea561489ec57f9bb766b3572318316b09a4172a39 /research/experiments
parent5f5603ce239dce08ae2ec4b0fa828787b220493c (diff)
downloadpure-d1db24f0e5c3bba583a1f2a9d8a0c9d3fc64a55c.tar.gz
pure-d1db24f0e5c3bba583a1f2a9d8a0c9d3fc64a55c.zip
Measure wires on the sending loop, and a host's threads (028)
Five rounds of 1,000 bursts by one wire, four wires, one link and four links: a thread each (966b82f), links on the loop (94e7bb8), wires on it too (5f5603c). Medians: one wire 774k, 782k, 779k sends/s; four wires 629k, 625k, 615k (the same CPU a send); one link 581k to 948k; four links 485k to 811k. A host whose app sends to ten links and ten wires has 24 threads before and 5 after (3 with no output).
Diffstat (limited to 'research/experiments')
-rw-r--r--research/experiments/028-one-sending-loop/2026-10-01-threads-linux-aarch64.jsonl4
-rw-r--r--research/experiments/028-one-sending-loop/2026-10-01-wires-linux-aarch64.jsonl60
-rw-r--r--research/experiments/028-one-sending-loop/2026-10-01-wires-load.txt2
-rw-r--r--research/experiments/028-one-sending-loop/many.aup43
-rwxr-xr-xresearch/experiments/028-one-sending-loop/runs.sh27
-rwxr-xr-xresearch/experiments/028-one-sending-loop/threads.py82
6 files changed, 211 insertions, 7 deletions
diff --git a/research/experiments/028-one-sending-loop/2026-10-01-threads-linux-aarch64.jsonl b/research/experiments/028-one-sending-loop/2026-10-01-threads-linux-aarch64.jsonl
new file mode 100644
index 0000000..89a6a2d
--- /dev/null
+++ b/research/experiments/028-one-sending-loop/2026-10-01-threads-linux-aarch64.jsonl
@@ -0,0 +1,4 @@
+{"version": "before", "outputs": "none", "threads": 3}
+{"version": "before", "outputs": "ten links, ten wires", "threads": 24}
+{"version": "wires", "outputs": "none", "threads": 3}
+{"version": "wires", "outputs": "ten links, ten wires", "threads": 5}
diff --git a/research/experiments/028-one-sending-loop/2026-10-01-wires-linux-aarch64.jsonl b/research/experiments/028-one-sending-loop/2026-10-01-wires-linux-aarch64.jsonl
new file mode 100644
index 0000000..62a4ec4
--- /dev/null
+++ b/research/experiments/028-one-sending-loop/2026-10-01-wires-linux-aarch64.jsonl
@@ -0,0 +1,60 @@
+{"round": 1, "version": "before", "way": "wire", "sends": 1000000, "seconds": 1.352, "sends_per_second": 739763, "cpu_us_per_send": 2.35, "threads": 4, "packets": 0, "load": 0.47}
+{"round": 1, "version": "push", "way": "wire", "sends": 1000000, "seconds": 1.27, "sends_per_second": 787237, "cpu_us_per_send": 2.25, "threads": 4, "packets": 0, "load": 0.47}
+{"round": 1, "version": "wires", "way": "wire", "sends": 1000000, "seconds": 1.371, "sends_per_second": 729436, "cpu_us_per_send": 2.35, "threads": 4, "packets": 0, "load": 0.47}
+{"round": 1, "version": "before", "way": "wires4", "sends": 4000000, "seconds": 6.373, "sends_per_second": 627648, "cpu_us_per_send": 2.75, "threads": 7, "packets": 0, "load": 0.59}
+{"round": 1, "version": "push", "way": "wires4", "sends": 4000000, "seconds": 6.507, "sends_per_second": 614678, "cpu_us_per_send": 2.78, "threads": 7, "packets": 0, "load": 0.7}
+{"round": 1, "version": "wires", "way": "wires4", "sends": 4000000, "seconds": 6.452, "sends_per_second": 619971, "cpu_us_per_send": 2.74, "threads": 4, "packets": 0, "load": 0.81}
+{"round": 1, "version": "before", "way": "link", "sends": 1000000, "seconds": 1.674, "sends_per_second": 597196, "cpu_us_per_send": 2.94, "threads": 5, "packets": 33784, "load": 0.99}
+{"round": 1, "version": "push", "way": "link", "sends": 1000000, "seconds": 1.129, "sends_per_second": 885488, "cpu_us_per_send": 1.9, "threads": 5, "packets": 16498, "load": 0.99}
+{"round": 1, "version": "wires", "way": "link", "sends": 1000000, "seconds": 1.022, "sends_per_second": 978034, "cpu_us_per_send": 1.86, "threads": 5, "packets": 16624, "load": 0.99}
+{"round": 1, "version": "before", "way": "links4", "sends": 4000000, "seconds": 8.25, "sends_per_second": 484872, "cpu_us_per_send": 3.72, "threads": 8, "packets": 184984, "load": 0.99}
+{"round": 1, "version": "push", "way": "links4", "sends": 4000000, "seconds": 4.995, "sends_per_second": 800736, "cpu_us_per_send": 2.24, "threads": 5, "packets": 64064, "load": 1.38}
+{"round": 1, "version": "wires", "way": "links4", "sends": 4000000, "seconds": 4.958, "sends_per_second": 806702, "cpu_us_per_send": 2.21, "threads": 5, "packets": 64058, "load": 1.75}
+{"round": 2, "version": "push", "way": "wire", "sends": 1000000, "seconds": 1.296, "sends_per_second": 771720, "cpu_us_per_send": 2.3, "threads": 4, "packets": 0, "load": 2.01}
+{"round": 2, "version": "wires", "way": "wire", "sends": 1000000, "seconds": 1.259, "sends_per_second": 794105, "cpu_us_per_send": 2.23, "threads": 4, "packets": 0, "load": 2.01}
+{"round": 2, "version": "before", "way": "wire", "sends": 1000000, "seconds": 1.326, "sends_per_second": 754251, "cpu_us_per_send": 2.31, "threads": 4, "packets": 0, "load": 2.01}
+{"round": 2, "version": "push", "way": "wires4", "sends": 4000000, "seconds": 6.397, "sends_per_second": 625265, "cpu_us_per_send": 2.78, "threads": 7, "packets": 0, "load": 2.01}
+{"round": 2, "version": "wires", "way": "wires4", "sends": 4000000, "seconds": 6.506, "sends_per_second": 614773, "cpu_us_per_send": 2.77, "threads": 4, "packets": 0, "load": 2.01}
+{"round": 2, "version": "before", "way": "wires4", "sends": 4000000, "seconds": 6.304, "sends_per_second": 634567, "cpu_us_per_send": 2.74, "threads": 7, "packets": 0, "load": 2.0}
+{"round": 2, "version": "push", "way": "link", "sends": 1000000, "seconds": 1.05, "sends_per_second": 952430, "cpu_us_per_send": 1.86, "threads": 5, "packets": 16623, "load": 2.0}
+{"round": 2, "version": "wires", "way": "link", "sends": 1000000, "seconds": 1.055, "sends_per_second": 948267, "cpu_us_per_send": 1.87, "threads": 5, "packets": 16614, "load": 2.0}
+{"round": 2, "version": "before", "way": "link", "sends": 1000000, "seconds": 1.659, "sends_per_second": 602710, "cpu_us_per_send": 2.85, "threads": 5, "packets": 33567, "load": 2.0}
+{"round": 2, "version": "push", "way": "links4", "sends": 4000000, "seconds": 4.877, "sends_per_second": 820117, "cpu_us_per_send": 2.19, "threads": 5, "packets": 64040, "load": 2.08}
+{"round": 2, "version": "wires", "way": "links4", "sends": 4000000, "seconds": 4.884, "sends_per_second": 818959, "cpu_us_per_send": 2.2, "threads": 5, "packets": 64040, "load": 2.07}
+{"round": 2, "version": "before", "way": "links4", "sends": 4000000, "seconds": 7.81, "sends_per_second": 512176, "cpu_us_per_send": 3.48, "threads": 8, "packets": 159257, "load": 2.31}
+{"round": 3, "version": "wires", "way": "wire", "sends": 1000000, "seconds": 1.261, "sends_per_second": 792888, "cpu_us_per_send": 2.23, "threads": 4, "packets": 0, "load": 2.52}
+{"round": 3, "version": "before", "way": "wire", "sends": 1000000, "seconds": 1.286, "sends_per_second": 777453, "cpu_us_per_send": 2.29, "threads": 4, "packets": 0, "load": 2.48}
+{"round": 3, "version": "push", "way": "wire", "sends": 1000000, "seconds": 1.267, "sends_per_second": 789266, "cpu_us_per_send": 2.26, "threads": 4, "packets": 0, "load": 2.48}
+{"round": 3, "version": "wires", "way": "wires4", "sends": 4000000, "seconds": 6.618, "sends_per_second": 604447, "cpu_us_per_send": 2.78, "threads": 4, "packets": 0, "load": 2.48}
+{"round": 3, "version": "before", "way": "wires4", "sends": 4000000, "seconds": 6.374, "sends_per_second": 627507, "cpu_us_per_send": 2.77, "threads": 7, "packets": 0, "load": 2.48}
+{"round": 3, "version": "push", "way": "wires4", "sends": 4000000, "seconds": 6.393, "sends_per_second": 625673, "cpu_us_per_send": 2.76, "threads": 7, "packets": 0, "load": 2.44}
+{"round": 3, "version": "wires", "way": "link", "sends": 1000000, "seconds": 1.059, "sends_per_second": 944142, "cpu_us_per_send": 1.87, "threads": 5, "packets": 16582, "load": 2.4}
+{"round": 3, "version": "before", "way": "link", "sends": 1000000, "seconds": 1.721, "sends_per_second": 581019, "cpu_us_per_send": 3.0, "threads": 5, "packets": 36428, "load": 2.45}
+{"round": 3, "version": "push", "way": "link", "sends": 1000000, "seconds": 1.031, "sends_per_second": 969940, "cpu_us_per_send": 1.84, "threads": 5, "packets": 16629, "load": 2.45}
+{"round": 3, "version": "wires", "way": "links4", "sends": 4000000, "seconds": 5.009, "sends_per_second": 798553, "cpu_us_per_send": 2.28, "threads": 5, "packets": 64095, "load": 2.45}
+{"round": 3, "version": "before", "way": "links4", "sends": 4000000, "seconds": 7.778, "sends_per_second": 514296, "cpu_us_per_send": 3.51, "threads": 8, "packets": 164895, "load": 2.33}
+{"round": 3, "version": "push", "way": "links4", "sends": 4000000, "seconds": 4.919, "sends_per_second": 813238, "cpu_us_per_send": 2.21, "threads": 5, "packets": 64030, "load": 2.51}
+{"round": 4, "version": "before", "way": "wire", "sends": 1000000, "seconds": 1.292, "sends_per_second": 773787, "cpu_us_per_send": 2.3, "threads": 4, "packets": 0, "load": 2.63}
+{"round": 4, "version": "push", "way": "wire", "sends": 1000000, "seconds": 1.283, "sends_per_second": 779269, "cpu_us_per_send": 2.27, "threads": 4, "packets": 0, "load": 2.63}
+{"round": 4, "version": "wires", "way": "wire", "sends": 1000000, "seconds": 1.289, "sends_per_second": 775712, "cpu_us_per_send": 2.25, "threads": 4, "packets": 0, "load": 2.63}
+{"round": 4, "version": "before", "way": "wires4", "sends": 4000000, "seconds": 6.305, "sends_per_second": 634448, "cpu_us_per_send": 2.75, "threads": 7, "packets": 0, "load": 2.58}
+{"round": 4, "version": "push", "way": "wires4", "sends": 4000000, "seconds": 6.422, "sends_per_second": 622837, "cpu_us_per_send": 2.78, "threads": 7, "packets": 0, "load": 2.53}
+{"round": 4, "version": "wires", "way": "wires4", "sends": 4000000, "seconds": 6.503, "sends_per_second": 615065, "cpu_us_per_send": 2.74, "threads": 4, "packets": 0, "load": 2.57}
+{"round": 4, "version": "before", "way": "link", "sends": 1000000, "seconds": 1.772, "sends_per_second": 564258, "cpu_us_per_send": 3.09, "threads": 5, "packets": 37603, "load": 2.4}
+{"round": 4, "version": "push", "way": "link", "sends": 1000000, "seconds": 1.085, "sends_per_second": 921686, "cpu_us_per_send": 1.9, "threads": 5, "packets": 16542, "load": 2.4}
+{"round": 4, "version": "wires", "way": "link", "sends": 1000000, "seconds": 1.094, "sends_per_second": 913690, "cpu_us_per_send": 1.91, "threads": 5, "packets": 16555, "load": 2.4}
+{"round": 4, "version": "before", "way": "links4", "sends": 4000000, "seconds": 8.281, "sends_per_second": 483009, "cpu_us_per_send": 3.73, "threads": 8, "packets": 181881, "load": 2.4}
+{"round": 4, "version": "push", "way": "links4", "sends": 4000000, "seconds": 4.965, "sends_per_second": 805687, "cpu_us_per_send": 2.27, "threads": 5, "packets": 64058, "load": 2.43}
+{"round": 4, "version": "wires", "way": "links4", "sends": 4000000, "seconds": 4.932, "sends_per_second": 811087, "cpu_us_per_send": 2.21, "threads": 5, "packets": 64052, "load": 2.55}
+{"round": 5, "version": "push", "way": "wire", "sends": 1000000, "seconds": 1.279, "sends_per_second": 781585, "cpu_us_per_send": 2.27, "threads": 4, "packets": 0, "load": 2.75}
+{"round": 5, "version": "wires", "way": "wire", "sends": 1000000, "seconds": 1.284, "sends_per_second": 778944, "cpu_us_per_send": 2.25, "threads": 4, "packets": 0, "load": 2.69}
+{"round": 5, "version": "before", "way": "wire", "sends": 1000000, "seconds": 1.291, "sends_per_second": 774369, "cpu_us_per_send": 2.28, "threads": 4, "packets": 0, "load": 2.69}
+{"round": 5, "version": "push", "way": "wires4", "sends": 4000000, "seconds": 6.289, "sends_per_second": 635982, "cpu_us_per_send": 2.73, "threads": 7, "packets": 0, "load": 2.69}
+{"round": 5, "version": "wires", "way": "wires4", "sends": 4000000, "seconds": 6.422, "sends_per_second": 622871, "cpu_us_per_send": 2.74, "threads": 4, "packets": 0, "load": 2.55}
+{"round": 5, "version": "before", "way": "wires4", "sends": 4000000, "seconds": 6.355, "sends_per_second": 629470, "cpu_us_per_send": 2.74, "threads": 7, "packets": 0, "load": 2.62}
+{"round": 5, "version": "push", "way": "link", "sends": 1000000, "seconds": 1.142, "sends_per_second": 875663, "cpu_us_per_send": 1.95, "threads": 5, "packets": 16590, "load": 2.57}
+{"round": 5, "version": "wires", "way": "link", "sends": 1000000, "seconds": 1.049, "sends_per_second": 953505, "cpu_us_per_send": 1.89, "threads": 5, "packets": 16637, "load": 2.57}
+{"round": 5, "version": "before", "way": "link", "sends": 1000000, "seconds": 1.759, "sends_per_second": 568423, "cpu_us_per_send": 3.05, "threads": 5, "packets": 35183, "load": 2.69}
+{"round": 5, "version": "push", "way": "links4", "sends": 4000000, "seconds": 4.987, "sends_per_second": 802077, "cpu_us_per_send": 2.21, "threads": 5, "packets": 64046, "load": 2.69}
+{"round": 5, "version": "wires", "way": "links4", "sends": 4000000, "seconds": 4.912, "sends_per_second": 814352, "cpu_us_per_send": 2.2, "threads": 5, "packets": 64040, "load": 2.71}
+{"round": 5, "version": "before", "way": "links4", "sends": 4000000, "seconds": 8.294, "sends_per_second": 482288, "cpu_us_per_send": 3.77, "threads": 8, "packets": 191764, "load": 2.82}
diff --git a/research/experiments/028-one-sending-loop/2026-10-01-wires-load.txt b/research/experiments/028-one-sending-loop/2026-10-01-wires-load.txt
new file mode 100644
index 0000000..ca4e0ac
--- /dev/null
+++ b/research/experiments/028-one-sending-loop/2026-10-01-wires-load.txt
@@ -0,0 +1,2 @@
+ 09:11:30 up 6:23, 3 users, load average: 0.47, 0.62, 0.78
+ 09:15:25 up 6:27, 3 users, load average: 2.93, 1.83, 1.24
diff --git a/research/experiments/028-one-sending-loop/many.aup b/research/experiments/028-one-sending-loop/many.aup
new file mode 100644
index 0000000..03d2b23
--- /dev/null
+++ b/research/experiments/028-one-sending-loop/many.aup
@@ -0,0 +1,43 @@
+input ping = message { k: u32 }
+output l1 = message { k: u32 }
+output l2 = message { k: u32 }
+output l3 = message { k: u32 }
+output l4 = message { k: u32 }
+output l5 = message { k: u32 }
+output l6 = message { k: u32 }
+output l7 = message { k: u32 }
+output l8 = message { k: u32 }
+output l9 = message { k: u32 }
+output l10 = message { k: u32 }
+output w1 = message { k: u32 }
+output w2 = message { k: u32 }
+output w3 = message { k: u32 }
+output w4 = message { k: u32 }
+output w5 = message { k: u32 }
+output w6 = message { k: u32 }
+output w7 = message { k: u32 }
+output w8 = message { k: u32 }
+output w9 = message { k: u32 }
+output w10 = message { k: u32 }
+on ping {
+ send l1 { k: ping.k }
+ send l2 { k: ping.k }
+ send l3 { k: ping.k }
+ send l4 { k: ping.k }
+ send l5 { k: ping.k }
+ send l6 { k: ping.k }
+ send l7 { k: ping.k }
+ send l8 { k: ping.k }
+ send l9 { k: ping.k }
+ send l10 { k: ping.k }
+ send w1 { k: ping.k }
+ send w2 { k: ping.k }
+ send w3 { k: ping.k }
+ send w4 { k: ping.k }
+ send w5 { k: ping.k }
+ send w6 { k: ping.k }
+ send w7 { k: ping.k }
+ send w8 { k: ping.k }
+ send w9 { k: ping.k }
+ send w10 { k: ping.k }
+}
diff --git a/research/experiments/028-one-sending-loop/runs.sh b/research/experiments/028-one-sending-loop/runs.sh
index 65eb51d..e580982 100755
--- a/research/experiments/028-one-sending-loop/runs.sh
+++ b/research/experiments/028-one-sending-loop/runs.sh
@@ -2,20 +2,24 @@
# The runs of docs/design/017's 2b, from the repository's root, in steps
# (a step at a time: a background job may be stopped after half an hour).
# runs.sh build the builds, each in /tmp/pure-028/NAME with its
-# pure-crypto.so: before (a thread a link, 3791ab8),
-# threads-push (before with threads-push.patch: the
-# owner pushes a turn's sends at once), loop (one
-# sending loop, 32f96b3), push (the loop with push,
-# 6d3c3c2)
+# pure-crypto.so: before (a thread a link and a wire,
+# 3791ab8), threads-push (before with threads-push.patch:
+# the owner pushes a turn's sends at once), loop (one
+# sending loop for links, 32f96b3), push (the loop with
+# push, 6d3c3c2), wires (wires on the loop too, eb3812a)
# runs.sh links five rounds of 1,000 bursts by one link, four links and
# one wire, the builds in turns, once the last minute's
# load is below 1.5
+# runs.sh wires the same by one wire, four wires, one link and four
+# links: before, push and wires
+# runs.sh threads a host's threads with ten links and ten wires, and with
+# no output: before and wires
set -e
out=research/experiments/028-one-sending-loop
builds=/tmp/pure-028
case "$1" in
build)
- for pair in before:3791ab8 threads-push:3791ab8 loop:32f96b3 push:6d3c3c2; do
+ for pair in before:3791ab8 threads-push:3791ab8 loop:32f96b3 push:6d3c3c2 wires:eb3812a; do
name=${pair%%:*} commit=${pair#*:}
rm -rf $builds/src-$name
git worktree add -f -q --detach $builds/src-$name $commit
@@ -32,5 +36,14 @@ links)
threads-push=$builds/threads-push/pure-serve loop=$builds/loop/pure-serve push=$builds/push/pure-serve \
> $out/2026-10-01-links-linux-aarch64.jsonl
echo "$(uptime)" >> $out/2026-10-01-links-load.txt ;;
-*) echo "runs.sh build|links" >&2; exit 2 ;;
+wires)
+ until awk '{ exit !($1 < 1.5) }' /proc/loadavg; do sleep 10; done
+ echo "$(uptime)" > $out/2026-10-01-wires-load.txt
+ python3 $out/sends.py 5 1000 wire,wires4,link,links4 before=$builds/before/pure-serve \
+ push=$builds/push/pure-serve wires=$builds/wires/pure-serve > $out/2026-10-01-wires-linux-aarch64.jsonl
+ echo "$(uptime)" >> $out/2026-10-01-wires-load.txt ;;
+threads)
+ (cd $out && python3 threads.py before=$builds/before/pure-serve wires=$builds/wires/pure-serve) \
+ > $out/2026-10-01-threads-linux-aarch64.jsonl ;;
+*) echo "runs.sh build|links|wires|threads" >&2; exit 2 ;;
esac
diff --git a/research/experiments/028-one-sending-loop/threads.py b/research/experiments/028-one-sending-loop/threads.py
new file mode 100755
index 0000000..b890c67
--- /dev/null
+++ b/research/experiments/028-one-sending-loop/threads.py
@@ -0,0 +1,82 @@
+#!/usr/bin/env python3
+"""The threads of a host whose app sends to ten links and ten wires,
+against the same host with no output wired (docs/design/017, 2b): many
+sends one message to each of its twenty outputs; the links go to the
+host's own --link-port, the wires to its own HTTP port, each to an app of
+its own (d1..d20), all sealed (a host that names its senders takes
+nothing unsealed). The threads are counted once every receiver has its
+message. One connection thread, two workers.
+
+threads.py NAME=PURE_SERVE [NAME=PURE_SERVE ...] a JSON line per host
+"""
+import http.client
+import json
+import shutil
+import socket
+import subprocess
+import sys
+import tempfile
+import time
+from pathlib import Path
+
+from sends import AUP, HERE, free_port, started, stopped, threads
+
+
+def host(serve, work, modules, key, public, wired):
+ link_port, http_port = free_port(socket.SOCK_DGRAM), free_port(socket.SOCK_STREAM)
+ sends = [f'send=l{n}=pure://127.0.0.1:{link_port}/d{n}/take seal=l{n}={public}' for n in range(1, 11)] + \
+ [f'send=w{n}=http://127.0.0.1:{http_port}/d{n + 10}/inputs/take seal=w{n}={public}' for n in range(1, 11)] \
+ if wired else []
+ (work / 'apps.conf').write_text(f"many {modules['many']} {work / 'many'} {' '.join(sends)}\n" +
+ ''.join(f"d{n} {modules['dst']} {work / f'd{n}'}\n" for n in range(1, 21)))
+ args = [serve, '--apps', work / 'apps.conf', '--threads', 1, '--workers', 2, '--port', http_port, '--key', key]
+ if wired:
+ args += ['--link-port', link_port, *sum((['--sender', f'many.{o}{n}={public}'] for o in 'lw' for n in range(1, 11)), [])]
+ process, info = started(args)
+ client = http.client.HTTPConnection('127.0.0.1', info['port'], timeout=60)
+
+ def ask(method, path):
+ client.request(method, path, b'' if method == 'POST' else None)
+ answer = client.getresponse()
+ body = answer.read()
+ assert answer.status == 200, (path, answer.status, answer.getheader('X-Pure-Error'))
+ return body
+
+ try:
+ ask('POST', '/many/inputs/ping?k=7')
+ deadline = time.time() + 20
+ while wired and any(int(ask('GET', f'/d{n}/views/count')) < 1 for n in range(1, 21)):
+ assert time.time() < deadline, 'not every receiver has its message'
+ time.sleep(0.01)
+ return threads(process.pid)
+ finally:
+ client.close()
+ stopped(process)
+
+
+def main():
+ serves = {name: Path(path).resolve() for name, path in (a.split('=', 1) for a in sys.argv[1:])}
+ work = Path(tempfile.mkdtemp(prefix='pure-threads-', dir='/dev/shm'))
+ try:
+ modules = {}
+ for name in ('many', 'dst'):
+ modules[name] = work / f'{name}.pmod'
+ subprocess.run([str(AUP), 'build', str(HERE / f'{name}.aup'), '-o', str(modules[name])], check=True)
+ key = work / 'host.key'
+ (work / 'one.conf').write_text(f"x {modules['dst']} {work / 'keys'}\n")
+ process, info = started([list(serves.values())[-1], '--apps', work / 'one.conf', '--key', key, '--port', 0])
+ public = info['public_key']
+ stopped(process)
+ for name, serve in serves.items():
+ for wired in (False, True):
+ runs = work / f'{name}-{wired}'
+ runs.mkdir()
+ print(json.dumps({'version': name, 'outputs': 'ten links, ten wires' if wired else 'none',
+ 'threads': host(serve, runs, modules, key, public, wired)}), flush=True)
+ shutil.rmtree(runs)
+ finally:
+ shutil.rmtree(work)
+
+
+if __name__ == '__main__':
+ main()