Consume spec 0.4.1-0.4.3: 5.9 bounds, 4.2 audit, loss surfacing, fill… - #2
Merged
Merged
Conversation
… 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… 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