fix(video): validate pass-through fixed GOP cadence - #380
victorwon2001 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Holding this on #376 rather than on your code. The gate is clean and the derivation is right.
#376 is open on what to do, and this implements one of its three options. The author measured nominal-io/xplane-mcap 36 minutes after you opened: 9 off-grid intervals in 102, on a conforming pass-through stream that video.py:513 cites as validating our lossless-suffix guarantee. Your change would refuse it.
The derivation and the finding survive whichever way it lands; the SourceNotConforming raise is the contingent part.
Separately: _validate_passthrough_video_payload returning bool gives a validator a second job in its return type.
|
Holding this on #376 rather than on your code. The gate is clean and the cadence derivation is right. #376 is open on what to do, not just how, and this implements one of its three options. The issue author measured The derivation and the finding survive whichever way #376 lands; the Separately: |
|
#376 has a direction: measure and stamp the observed interval, report irregular cadence as a doctor finding, refuse nothing. Your derivation and the What goes in is the other half: provenance stamps the requested |
e0bf4cb to
5390ad0
Compare
There was a problem hiding this comment.
The reshape is right: the raise is gone and the cadence check is a finding.
What blocks it is the other half of #376. Provenance stamps gop_seconds at transform.py:900 from the resolved config, through one writer both paths use, with nothing recording which ran. So on pass-through this check reads a requested value as ground truth, and nominal-io/xplane-mcap (9 off-grid intervals in 102) produces errors against a GOP nobody applied.
For encoded video it is provably right: scenecut=0:keyint=min-keyint=gop_frames. video.py:670-683 already asserts that, so consider calling it.
Two smaller things: fps = 1.0 for a single-message channel is invented, and _check_video_payload now returns bool | None where None means four things.
Summary
video-keyframe-cadencetohflow doctor, comparing structurally valid video keyframes with the message-index grid implied by stampedgop_secondsand the channel's measured frame rate.SourceNotConformingrefusal, including when the existing lossless AUD repair is needed.hflow doctor; non-finite GOP-frame calculations are reported as cadence errors rather than raising.Refs #376
Why
Real-corpus evidence showed that enforcing fixed GOP during pass-through ingest would reject a recording used to validate the existing lossless AUD-repair path. The change is therefore limited to diagnosis; pass-through
provenance/v1.gop_secondsremains the configured target, and a separate provenance revision can distinguish configured and measured cadence without changing canonical bytes in this PR.Validation
The focused processing/doctor suite passed with 74 tests, and the full root suite passed with 1728 tests and 6 skips. Ruff, formatting, typing, documentation links, and diff whitespace validation also passed.
Checklist
uv run ruff check --fix,uv run ruff format, anduv run ty check.