<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>doodleshnookie.net - weida</title>
    <subtitle>weida, iced_nodegraph, zeughaus and griasdi: four projects, and the log of building them with coding agents. By tuco86.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://blog.doodleshnookie.net/topics/weida/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://blog.doodleshnookie.net"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-09-30T00:00:00+00:00</updated>
    <id>https://blog.doodleshnookie.net/topics/weida/atom.xml</id>
    <entry xml:lang="en">
        <title>Late is lost: weida learns to drop on purpose</title>
        <published>2026-09-30T00:00:00+00:00</published>
        <updated>2026-09-30T00:00:00+00:00</updated>
        
        <author>
          <name>tuco86</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.doodleshnookie.net/log/late-is-lost/"/>
        <id>https://blog.doodleshnookie.net/log/late-is-lost/</id>
        
        <content type="html" xml:base="https://blog.doodleshnookie.net/log/late-is-lost/">&lt;p&gt;Until this week weida delivered all of a unit or a named failure. Within a
connection QUIC retransmits until the stream finishes or is reset, which is
right for a file and wrong for a voice frame: “a 20 ms audio frame that arrives
after its playout time is worthless”. Decision 0034,
&lt;a rel=&quot;external&quot; href=&quot;https://weida.doodleshnookie.net/decisions/0034-late-is-lost/&quot;&gt;Late is lost&lt;/a&gt;,
gives weida a way to lose data on purpose, where the loss can be seen and
nobody waits for it.&lt;/p&gt;
&lt;h2 id=&quot;two-requests-from-outside&quot;&gt;Two requests from outside&lt;/h2&gt;
&lt;p&gt;The sentence about the audio frame is not mine. It comes from one of two
requirement documents that projects building on weida filed against it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https://github.com/tuco86/weida/blob/main/docs/requirements/griasdi-voice.md&quot;&gt;griasdi voice&lt;/a&gt;:
&lt;a href=&quot;/#sheet-griasdi&quot;&gt;griasdi&lt;/a&gt; is a chat and voice application in which every
byte travels over weida. Voice is 50 datagrams a second per speaker, 80 to
250 bytes each, from a client to its server and from the server to everyone
who listens.&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https://github.com/tuco86/weida/blob/main/docs/requirements/zeughaus-video.md&quot;&gt;zeughaus video&lt;/a&gt;:
fan-out of preview frames to several viewers, and later compressed video,
whose frames depend on each other.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;griasdi asked for a primitive and explicitly not for a pattern, because
fan-out is the forwarding server’s job. I wanted more than that: something
that is part of weida itself, so that architectures like these can be
expressed in it, even if that takes new patterns. Both positions are recorded
in the decision, and the second one shaped it.&lt;/p&gt;
&lt;h2 id=&quot;what-reading-quinn-turned-up&quot;&gt;What reading quinn turned up&lt;/h2&gt;
&lt;p&gt;Before any of it was built, writing the decision meant reading &lt;code&gt;quinn&lt;/code&gt;’s
source, and that turned up a problem that already existed. Every weida QUIC
connection advertised datagram support, and &lt;code&gt;quinn&lt;/code&gt; would buffer up to
&lt;code&gt;STREAM_RWND&lt;/code&gt; = 1 250 000 bytes of a peer’s datagrams per connection, which
weida never read. The buffer is bounded, it drops the oldest, but no document
named it: at 64 connections that is about 80 MB per peer.&lt;/p&gt;
&lt;p&gt;It was the first item fixed, in
&lt;a rel=&quot;external&quot; href=&quot;https://github.com/tuco86/weida/commit/ef27f72&quot;&gt;&lt;code&gt;ef27f72&lt;/code&gt;&lt;/a&gt; (“fix(weida): stop
advertising datagrams nobody reads”). The regression test saw
&lt;code&gt;max_datagram_size() == Some(1162)&lt;/code&gt; before the fix and &lt;code&gt;None&lt;/code&gt; after it. The
analysis is in 0034 §2.3, the result in the B-279 line of
&lt;a rel=&quot;external&quot; href=&quot;https://github.com/tuco86/weida/blob/main/docs/NIGHTLOG.md&quot;&gt;&lt;code&gt;docs/NIGHTLOG.md&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;one-carrier-two-stream-mechanisms-one-pattern&quot;&gt;One carrier, two stream mechanisms, one pattern&lt;/h2&gt;
&lt;p&gt;That is the shape of the
&lt;a rel=&quot;external&quot; href=&quot;https://weida.doodleshnookie.net/decisions/0034-late-is-lost/&quot;&gt;decision&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;datagram flow&lt;/strong&gt; at L0. A FLOW stream registers it and is its lifetime,
its units travel as QUIC datagrams, &lt;code&gt;send&lt;/code&gt; never waits, and a slow reader
loses its oldest datagrams. It is off by default. Where the peer has not
agreed to datagrams, opening a flow fails with a named error; weida never
quietly substitutes a stream, which would deliver the unit late.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Expiry and priority&lt;/strong&gt; on the streams that already exist:
&lt;code&gt;OutgoingTransfer::expire_at&lt;/code&gt; resets a stream whose bytes are not all
acknowledged by a deadline, and &lt;code&gt;set_priority&lt;/code&gt; hands &lt;code&gt;quinn&lt;/code&gt;’s priority to
the stream.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;RADIO/DISH&lt;/strong&gt;, ZeroMQ’s name for lossy fan-out. A new segment resets the
unacknowledged copies of the previous one on its topic, a dish states a
&lt;code&gt;max_age&lt;/code&gt;, and a dish that falls behind loses the old segment, never the new
one.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;a-forwarding-server-is-one-loop&quot;&gt;A forwarding server is one loop&lt;/h2&gt;
&lt;p&gt;The guide teaches it with a program,
&lt;a rel=&quot;external&quot; href=&quot;https://github.com/tuco86/weida/blob/main/crates/weida/examples/guide_late_is_lost.rs&quot;&gt;&lt;code&gt;crates/weida/examples/guide_late_is_lost.rs&lt;/code&gt;&lt;/a&gt;,
and &lt;a rel=&quot;external&quot; href=&quot;https://github.com/tuco86/weida/blob/main/crates/weida/tests/guide.rs&quot;&gt;&lt;code&gt;crates/weida/tests/guide.rs&lt;/code&gt;&lt;/a&gt;
asserts what it prints. This is the whole forwarding path of a selective
forwarding unit, from &lt;code&gt;docs/GUIDE.md&lt;/code&gt; §2.6:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #1B2620; background-color: #D2DFC1;&quot; &gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #2D6446;font-weight: bold;&quot;&gt;while let&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; Ok&lt;/span&gt;&lt;span style=&quot;color: #435148;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Incoming&lt;/span&gt;&lt;span style=&quot;color: #435148;font-weight: bold;&quot;&gt;::&lt;/span&gt;&lt;span&gt;Flow&lt;/span&gt;&lt;span style=&quot;color: #435148;&quot;&gt;(&lt;/span&gt;&lt;span&gt;mic&lt;/span&gt;&lt;span style=&quot;color: #435148;&quot;&gt;))&lt;/span&gt;&lt;span style=&quot;color: #435148;font-weight: bold;&quot;&gt; =&lt;/span&gt;&lt;span&gt; mics&lt;/span&gt;&lt;span style=&quot;color: #435148;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span&gt;accept&lt;/span&gt;&lt;span style=&quot;color: #435148;&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color: #435148;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #2D6446;font-weight: bold;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #435148;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #2D6446;font-weight: bold;&quot;&gt;    let&lt;/span&gt;&lt;span&gt; radio&lt;/span&gt;&lt;span style=&quot;color: #435148;font-weight: bold;&quot;&gt; =&lt;/span&gt;&lt;span&gt; room&lt;/span&gt;&lt;span style=&quot;color: #435148;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span&gt;clone&lt;/span&gt;&lt;span style=&quot;color: #435148;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    tokio&lt;/span&gt;&lt;span style=&quot;color: #435148;font-weight: bold;&quot;&gt;::&lt;/span&gt;&lt;span&gt;spawn&lt;/span&gt;&lt;span style=&quot;color: #435148;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #2D6446;font-weight: bold;&quot;&gt;async move&lt;/span&gt;&lt;span style=&quot;color: #435148;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #2D6446;font-weight: bold;&quot;&gt;        while let&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; Some&lt;/span&gt;&lt;span style=&quot;color: #435148;&quot;&gt;(&lt;/span&gt;&lt;span&gt;frame&lt;/span&gt;&lt;span style=&quot;color: #435148;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #435148;font-weight: bold;&quot;&gt; =&lt;/span&gt;&lt;span&gt; mic&lt;/span&gt;&lt;span style=&quot;color: #435148;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span&gt;recv&lt;/span&gt;&lt;span style=&quot;color: #435148;&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color: #435148;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #2D6446;font-weight: bold;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #435148;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #2D6446;font-weight: bold;&quot;&gt;            let&lt;/span&gt;&lt;span&gt; _&lt;/span&gt;&lt;span style=&quot;color: #435148;font-weight: bold;&quot;&gt; =&lt;/span&gt;&lt;span&gt; radio&lt;/span&gt;&lt;span style=&quot;color: #435148;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span&gt;datagram&lt;/span&gt;&lt;span style=&quot;color: #435148;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #1F3A6B;&quot;&gt;&amp;quot;room.voice&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #435148;&quot;&gt;,&lt;/span&gt;&lt;span&gt; frame&lt;/span&gt;&lt;span style=&quot;color: #435148;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #435148;&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #435148;&quot;&gt;    });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #435148;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A microphone is a flow into the server, and every frame goes back out as a
one-packet segment on the radio. The payload is bytes to it; in griasdi’s case
it is ciphertext the server cannot read. The program’s own output:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #1B2620; background-color: #D2DFC1;&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;100 of 100 frames reached both listeners; 5 of 5 segments crossed the relay; payload untouched: true&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;what-voice-costs-beside-a-bulk-upload&quot;&gt;What voice costs beside a bulk upload&lt;/h2&gt;
&lt;p&gt;Item B-289 measured one question the decision left open: what a bulk upload
to the same host does to a voice flow, by path and by congestion controller.
The conditions, from
&lt;a rel=&quot;external&quot; href=&quot;https://github.com/tuco86/weida/blob/main/docs/IMPLEMENTATION.md&quot;&gt;&lt;code&gt;docs/IMPLEMENTATION.md&lt;/code&gt;&lt;/a&gt;
§4 “Verified results — voice beside bulk (B-289)”, commit
&lt;a rel=&quot;external&quot; href=&quot;https://github.com/tuco86/weida/commit/c45c63c&quot;&gt;&lt;code&gt;c45c63c&lt;/code&gt;&lt;/a&gt;: AMD Ryzen 7 5800X,
Linux 7.2.8, rustc 1.98.1, release profile, loopback through an in-process
shaper (20 Mbit/s from client to server into a 64 KiB drop-tail queue), voice
of 200 bytes at 50 Hz beside back-to-back 1 MiB uploads, two runs of the whole
probe. Each cell gives both runs.&lt;/p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Paths&lt;/th&gt;&lt;th&gt;Controller&lt;/th&gt;&lt;th&gt;Voice p50 (ms)&lt;/th&gt;&lt;th&gt;Voice p95 (ms)&lt;/th&gt;&lt;th&gt;Voice loss (%)&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;separate&lt;/td&gt;&lt;td&gt;CUBIC&lt;/td&gt;&lt;td&gt;43.0 / 43.9&lt;/td&gt;&lt;td&gt;81.6 / 91.7&lt;/td&gt;&lt;td&gt;4.10 / 4.60&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;separate&lt;/td&gt;&lt;td&gt;BBR&lt;/td&gt;&lt;td&gt;5.6 / 5.6&lt;/td&gt;&lt;td&gt;6.7 / 47.7&lt;/td&gt;&lt;td&gt;8.69 / 8.69&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;one&lt;/td&gt;&lt;td&gt;CUBIC&lt;/td&gt;&lt;td&gt;42.7 / 42.2&lt;/td&gt;&lt;td&gt;49.5 / 49.5&lt;/td&gt;&lt;td&gt;0.00 / 0.00&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;one&lt;/td&gt;&lt;td&gt;BBR&lt;/td&gt;&lt;td&gt;8.8 / 48.5&lt;/td&gt;&lt;td&gt;56.6 / 52.8&lt;/td&gt;&lt;td&gt;5.39 / 1.90&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;The rule was set before measuring: on separate paths, BBR had to cut voice p95
by at least 30 %. It did, so 0034 §6 now says that a bulk profile sharing a
bottleneck with media runs BBR. The default stays CUBIC. The same rows show
the price: voice loss roughly doubles under BBR, and its p95 differs sevenfold
between the two runs.&lt;/p&gt;
&lt;p&gt;The backlog item asked for &lt;code&gt;tc netem&lt;/code&gt;. The agent’s loop runs without sudo, so
it built a userspace shaper instead and flagged that for me to look at. A
loopback with a userspace shaper is not a residential uplink, and the
document says so.&lt;/p&gt;
&lt;h2 id=&quot;how-it-was-built&quot;&gt;How it was built&lt;/h2&gt;
&lt;p&gt;This is the part the log is for. The decision was written by a coding agent
from the two requirement documents. I reviewed it and accepted it in
&lt;a rel=&quot;external&quot; href=&quot;https://github.com/tuco86/weida/commit/fce4fd8&quot;&gt;&lt;code&gt;fce4fd8&lt;/code&gt;&lt;/a&gt; (“docs(decisions):
accept 0034, late is lost”). After that it was built as backlog items
&lt;a rel=&quot;external&quot; href=&quot;https://github.com/tuco86/weida/blob/main/docs/BACKLOG.md&quot;&gt;B-279 to B-292&lt;/a&gt;
under the rule of
&lt;a rel=&quot;external&quot; href=&quot;https://github.com/tuco86/weida/blob/main/docs/LOOP.md&quot;&gt;&lt;code&gt;docs/LOOP.md&lt;/code&gt;&lt;/a&gt;: one
backlog item, one gate, one commit. The whole run is the
&lt;a rel=&quot;external&quot; href=&quot;https://github.com/tuco86/weida/compare/fce4fd8...59f79f6&quot;&gt;29 commits&lt;/a&gt; from
accepting the note to &lt;a rel=&quot;external&quot; href=&quot;https://github.com/tuco86/weida/commit/59f79f6&quot;&gt;&lt;code&gt;59f79f6&lt;/code&gt;&lt;/a&gt;,
which brings RADIO/DISH to blocking Rust and Python.&lt;/p&gt;
&lt;p&gt;The run ended with the nightlog’s review section, written for me. Apart from
the shaper it named three corrections the plan had not asked for, each recorded
on its item: the radio keeps a floor when it evicts a topic, so a re-created
topic cannot restart below a dish’s newest segment (B-285); a fuzz target
that had not compiled since the protocol gained DATA key 13 was fixed in
&lt;a rel=&quot;external&quot; href=&quot;https://github.com/tuco86/weida/commit/862ac88&quot;&gt;&lt;code&gt;862ac88&lt;/code&gt;&lt;/a&gt;; and the guide
program paces its segments at a frame interval, because segments sent back to
back counted the reader’s own copies as superseded before their
acknowledgement arrived (B-290).&lt;/p&gt;
&lt;h2 id=&quot;what-this-does-not-claim&quot;&gt;What this does not claim&lt;/h2&gt;
&lt;p&gt;Nobody runs datagram flows or RADIO/DISH yet. griasdi and zeughaus asked for
them, and neither uses them today. The measurement above is one machine on
loopback, and nothing here is tested for interoperability with MOQT or
moq-lite.&lt;/p&gt;
</content>
        
    </entry>
</feed>
