Skip to content

Consume spec 0.4.1-0.4.3: 5.9 bounds, 4.2 audit, loss surfacing, fill… - #2

Merged
1e1f merged 1 commit into
mainfrom
claude/link-wire-spec-review-6phyy9
Jul 3, 2026
Merged

Consume spec 0.4.1-0.4.3: 5.9 bounds, 4.2 audit, loss surfacing, fill…#2
1e1f merged 1 commit into
mainfrom
claude/link-wire-spec-review-6phyy9

Conversation

@1e1f

@1e1f 1e1f commented Jul 3, 2026

Copy link
Copy Markdown
Member

… mode

Spec pin: SPEC_REF moves to d27abb9 (v0.4.3) in both workflows; README status now reads 0.4.3. Golden vectors are unchanged since 0.1.0 and still round-trip byte-for-byte.

Ch. 03 5.9 (receive-side per-chunk frame limit, new in 0.4.2): the receiver MUST bound its decode-to-render copy. Ours stages into the decoded vector itself, so chunks above the reference endpoint's 512-frame limit deliver intact - locked in by tests at the wire layer (a 550-frame chunk; the probed full 1200-byte 2x275 datagram) and the delivery layer. New wire constants V1_MAX_CHUNK_FRAMES (512) and AUDIO_FIXED_OVERHEAD (28) with citations.

Ch. 02 4.2 (sharpened in 0.4.1): audited the measurement state machine against the sharpened text. The retry budget was already cumulative and never restored by pong receipt (now regression-tested), and pong admission already correlates by the measured endpoint, which 0.4.1 now grants as [N] latitude (now cited in a comment). No behavior change.

Ch. 03 5.8 (SHOULD surface loss): Source tracks sequence gaps; Link::channel_lost_chunks exposes the per-subscription count. The first seen chunk seeds the counter (a mid-stream subscribe is not loss); reordered late arrivals take their gap back off the count.

Datagram fill mode (opt-in, Config::fill_audio_datagrams): the sink packer is rewritten as plan+consume with parameterized sizing. The default stays reference-identical (502-byte sample cap, 576-byte datagrams). Fill mode packs toward the 3.1 SHOULD payload budget (1176 bytes) with every chunk within the 5.9 512-frame bound: 548-frame mono datagrams vs the reference's 251, ~2.2x fewer packets, legal toward any v1 peer per the 0.4.2 probes. Covered by packer unit tests and an end-to-end loopback test (packed chunks reassemble into the sent stream; the loss counter stays zero).

The rewrite also fixes a pre-existing edge: a sub-frame residue segment (a write shorter than one interleaved frame) could wedge the old drain loop; the planner now skips residue and the consumer drops it.

I have complied with PROVENANCE.md; this contribution is derived only from permitted inputs.

Claude-Session: https://claude.ai/code/session_01FghD1hbMTBz29cjLTTPAQd

… mode

Spec pin: SPEC_REF moves to d27abb9 (v0.4.3) in both workflows; README
status now reads 0.4.3. Golden vectors are unchanged since 0.1.0 and
still round-trip byte-for-byte.

Ch. 03 5.9 (receive-side per-chunk frame limit, new in 0.4.2): the
receiver MUST bound its decode-to-render copy. Ours stages into the
decoded vector itself, so chunks above the reference endpoint's
512-frame limit deliver intact - locked in by tests at the wire layer
(a 550-frame chunk; the probed full 1200-byte 2x275 datagram) and the
delivery layer. New wire constants V1_MAX_CHUNK_FRAMES (512) and
AUDIO_FIXED_OVERHEAD (28) with citations.

Ch. 02 4.2 (sharpened in 0.4.1): audited the measurement state machine
against the sharpened text. The retry budget was already cumulative and
never restored by pong receipt (now regression-tested), and pong
admission already correlates by the measured endpoint, which 0.4.1 now
grants as [N] latitude (now cited in a comment). No behavior change.

Ch. 03 5.8 (SHOULD surface loss): Source tracks sequence gaps;
Link::channel_lost_chunks exposes the per-subscription count. The first
seen chunk seeds the counter (a mid-stream subscribe is not loss);
reordered late arrivals take their gap back off the count.

Datagram fill mode (opt-in, Config::fill_audio_datagrams): the sink
packer is rewritten as plan+consume with parameterized sizing. The
default stays reference-identical (502-byte sample cap, 576-byte
datagrams). Fill mode packs toward the 3.1 SHOULD payload budget
(1176 bytes) with every chunk within the 5.9 512-frame bound:
548-frame mono datagrams vs the reference's 251, ~2.2x fewer packets,
legal toward any v1 peer per the 0.4.2 probes. Covered by packer unit
tests and an end-to-end loopback test (packed chunks reassemble into
the sent stream; the loss counter stays zero).

The rewrite also fixes a pre-existing edge: a sub-frame residue
segment (a write shorter than one interleaved frame) could wedge the
old drain loop; the planner now skips residue and the consumer drops it.

I have complied with PROVENANCE.md; this contribution is derived only
from permitted inputs.

Claude-Session: https://claude.ai/code/session_01FghD1hbMTBz29cjLTTPAQd
@1e1f
1e1f merged commit 91b6120 into main Jul 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants