Line references at rewrite b58160b. Minor, in the spirit of #86.
What happens
encode accumulates stream sizes into a local seeded with StreamSizes::default():
ab_av1/operation.rs:162 — let mut sizes = StreamSizes::default();
ab_av1/operation.rs:182-184 — Update::StreamSizes { .. } overwrites it.
ab_av1/operation.rs:185-192 — Update::Done { .. } returns immediately with stream_sizes: sizes.
StreamSizes is four plain u64s (ab_av1/types.rs:69-74), so the default is all zeros and carries no "unset" state.
Two ways that reads wrong:
-
If StreamSizes is never emitted, we report a successful encode with zero video, audio, subtitle and other bytes. A successful video encode never legitimately has zero video bytes, so this is a silent data-quality failure rather than an error. Upstream derives these by parsing ffmpeg's summary line, so a parse miss or an ffmpeg output change produces it.
-
If StreamSizes arrived after Done it would be dropped, because the Done arm returns rather than breaking. The ordering happens to hold in the pinned fork (sizes are yielded inside the progress loop, Done after it), but nothing across the boundary enforces it, and the failure is silent rather than loud.
Where the zeros go
coordinator/output_flow.rs:285-289 copies them field-for-field into StreamByteSizes, which reaches state.rs:82, projection.rs:997 and estimation.rs:387. So a missing report becomes persisted history that later feeds estimation.
Direction
Make the absence representable rather than defaulted: accumulate Option<StreamSizes> and decide explicitly at Done whether "no sizes reported" is an error, a warning, or a legitimately empty result. Same principle as the reject/deltas item in #86, that a state which should be impossible is better made unrepresentable than left to call-site ordering.
Not observed in the wild; found by reading the adapter while auditing the ab-av1 boundary.
Line references at
rewriteb58160b. Minor, in the spirit of #86.What happens
encodeaccumulates stream sizes into a local seeded withStreamSizes::default():ab_av1/operation.rs:162—let mut sizes = StreamSizes::default();ab_av1/operation.rs:182-184—Update::StreamSizes { .. }overwrites it.ab_av1/operation.rs:185-192—Update::Done { .. }returns immediately withstream_sizes: sizes.StreamSizesis four plainu64s (ab_av1/types.rs:69-74), so the default is all zeros and carries no "unset" state.Two ways that reads wrong:
If
StreamSizesis never emitted, we report a successful encode with zero video, audio, subtitle and other bytes. A successful video encode never legitimately has zero video bytes, so this is a silent data-quality failure rather than an error. Upstream derives these by parsing ffmpeg's summary line, so a parse miss or an ffmpeg output change produces it.If
StreamSizesarrived afterDoneit would be dropped, because theDonearm returns rather than breaking. The ordering happens to hold in the pinned fork (sizes are yielded inside the progress loop,Doneafter it), but nothing across the boundary enforces it, and the failure is silent rather than loud.Where the zeros go
coordinator/output_flow.rs:285-289copies them field-for-field intoStreamByteSizes, which reachesstate.rs:82,projection.rs:997andestimation.rs:387. So a missing report becomes persisted history that later feeds estimation.Direction
Make the absence representable rather than defaulted: accumulate
Option<StreamSizes>and decide explicitly atDonewhether "no sizes reported" is an error, a warning, or a legitimately empty result. Same principle as the reject/deltas item in #86, that a state which should be impossible is better made unrepresentable than left to call-site ordering.Not observed in the wild; found by reading the adapter while auditing the ab-av1 boundary.