ABR overhaul Phase 2 (planning PR #20, RFC §3 — signed off): the four correctness seams from the 08-22 review's §2, with the RFC's chosen options. Parallel-safe with #401 — no climb relaxation among them.
§2.3 phantom rate: the control task acks a SetBitratebefore the data plane applies it; when the fallback rebuild failed, the client kept climbing from a rate the encoder never ran. The failure arm now sends the live rate through retarget_tx — the same channel as the existing short-apply correction three lines up.
§2.2 missing PipelineGap: the adaptive-bitrate rebuild (~0.6 s stall) is the one rebuild that never announced — its starved window read as congestion, killed slow start, and the 401 ms field case sat minutes at ~15 Mbps on a clean link. The success arm now announces the timed gap, exactly like the mode-switch and topology arms.
§2.1 stale stream cap: the stream-shape cap was computed once from the Welcome mode. An accepted mode switch now re-teaches it in the pump (mode from mode_slot, codec/depth/chroma carried as session constants), and a re-setset_stream_cap rebinds an already-learned ceiling downward (set_ceiling deliberately never lowers). The first set keeps the founding semantics — a negotiated start above the cap stands — pinned by the existing the_stream_bound_clamps_a_learned_ceiling_only.
§2.4 latest-wins ack slot: bitrate_ack becomes a queue drained in arrival order per report window. A full resolve ack plus a corrective short retarget in the same 750 ms window used to collapse to whichever arrived last, and host-cap learning needs two consecutive short acks — a lost correction could reintroduce the encoder-overdrive sawtooth.
Verified:punktfunk-core --features quic — all 490 lib tests green natively (macOS), including the new a_mode_switch_reteaches_the_stream_cap_both_ways; cargo fmt --check clean. The host-side arms (§2.2/§2.3, stream.rs) lean on ci / rust.
ABR overhaul **Phase 2** (planning PR #20, RFC §3 — signed off): the four correctness seams from the 08-22 review's §2, with the RFC's chosen options. Parallel-safe with #401 — no climb relaxation among them.
- **§2.3 phantom rate**: the control task acks a `SetBitrate` *before* the data plane applies it; when the fallback rebuild failed, the client kept climbing from a rate the encoder never ran. The failure arm now sends the live rate through `retarget_tx` — the same channel as the existing short-apply correction three lines up.
- **§2.2 missing `PipelineGap`**: the adaptive-bitrate rebuild (~0.6 s stall) is the one rebuild that never announced — its starved window read as congestion, killed slow start, and the 401 ms field case sat minutes at ~15 Mbps on a clean link. The success arm now announces the timed gap, exactly like the mode-switch and topology arms.
- **§2.1 stale stream cap**: the stream-shape cap was computed once from the Welcome mode. An accepted mode switch now re-teaches it in the pump (mode from `mode_slot`, codec/depth/chroma carried as session constants), and a *re-set* `set_stream_cap` rebinds an already-learned ceiling downward (`set_ceiling` deliberately never lowers). The *first* set keeps the founding semantics — a negotiated start above the cap stands — pinned by the existing `the_stream_bound_clamps_a_learned_ceiling_only`.
- **§2.4 latest-wins ack slot**: `bitrate_ack` becomes a queue drained in arrival order per report window. A full resolve ack plus a corrective short retarget in the same 750 ms window used to collapse to whichever arrived last, and host-cap learning needs two *consecutive* short acks — a lost correction could reintroduce the encoder-overdrive sawtooth.
**Verified:** `punktfunk-core --features quic` — all 490 lib tests green natively (macOS), including the new `a_mode_switch_reteaches_the_stream_cap_both_ways`; `cargo fmt --check` clean. The host-side arms (§2.2/§2.3, `stream.rs`) lean on `ci / rust`.
The four correctness seams from the 08-22 auto-bitrate review §2, chosen
options per the RFC (planning design/abr-stack-overhaul.md §3):
- §2.3: a failed bitrate-change encoder rebuild now snaps the client back
(retarget_tx) — the control task acks BEFORE the apply, so the client's
climb base, utilization and proven math tracked a rate the encoder
never ran until some later event happened to correct them.
- §2.2: the ABR rebuild announces PipelineGap on success, like the
mode-switch and topology rebuilds already do — a ~0.6 s host-local
stall read as congestion killed slow start for the session (the 401 ms
field case: minutes at ~15 Mbps on a clean link).
- §2.1: an accepted mode switch re-teaches the stream-shape cap —
computed once from the Welcome mode, 1080p→4K kept a 1080p-sized climb
ceiling and 4K→720p left an oversized one standing. A re-set
set_stream_cap also rebinds the already-learned ceiling downward
(set_ceiling deliberately never lowers); the FIRST set keeps the
founding semantics, pinned by the existing stream-bound test.
- §2.4: the bitrate_ack slot becomes a queue drained in arrival order —
latest-wins collapsed a full resolve ack + corrective short retarget
landing in the same 750 ms window, and host-cap learning needs two
CONSECUTIVE short acks.
punktfunk-core --features quic: 490 tests green natively, including the
new a_mode_switch_reteaches_the_stream_cap_both_ways.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
ABR overhaul Phase 2 (planning PR #20, RFC §3 — signed off): the four correctness seams from the 08-22 review's §2, with the RFC's chosen options. Parallel-safe with #401 — no climb relaxation among them.
SetBitratebefore the data plane applies it; when the fallback rebuild failed, the client kept climbing from a rate the encoder never ran. The failure arm now sends the live rate throughretarget_tx— the same channel as the existing short-apply correction three lines up.PipelineGap: the adaptive-bitrate rebuild (~0.6 s stall) is the one rebuild that never announced — its starved window read as congestion, killed slow start, and the 401 ms field case sat minutes at ~15 Mbps on a clean link. The success arm now announces the timed gap, exactly like the mode-switch and topology arms.mode_slot, codec/depth/chroma carried as session constants), and a re-setset_stream_caprebinds an already-learned ceiling downward (set_ceilingdeliberately never lowers). The first set keeps the founding semantics — a negotiated start above the cap stands — pinned by the existingthe_stream_bound_clamps_a_learned_ceiling_only.bitrate_ackbecomes a queue drained in arrival order per report window. A full resolve ack plus a corrective short retarget in the same 750 ms window used to collapse to whichever arrived last, and host-cap learning needs two consecutive short acks — a lost correction could reintroduce the encoder-overdrive sawtooth.Verified:
punktfunk-core --features quic— all 490 lib tests green natively (macOS), including the newa_mode_switch_reteaches_the_stream_cap_both_ways;cargo fmt --checkclean. The host-side arms (§2.2/§2.3,stream.rs) lean onci / rust.