Repository navigation
tests: a clip whose audio outlasts its video plays to the end - #924
Merged
Merged
Conversation
#865 ended a film on the pipeline's own end-of-stream (`type=28`) after a picture, because a film whose audio runs past its last video frame never gets its playhead within a second of the container's duration (the longest track's) and sat on the last frame for good. Nothing in the pipeline tier could see that: every clip it plays has picture and audio ending together. make_fixtures.py gets `pipe_h264_ac3_audio_tail`: 720x480 H.264 + AC-3 5.1, 20 s of picture and 23 s of audio. The knob is one declarative key, `audio_tail_s`, with `duration` staying the container's length so the duration check, the burned-in layout and the carried-forward records all keep agreeing with the file; only the testsrc2 input ends early. verify() reads both streams' last packet times back out of the finished file and fails the build unless the audio ends at least 2 s after the video, so a regenerated clip that lost the tail cannot pass quietly. The manifest gets `pipe_finish_audio_tail`, graded like `pipe_finish_eos` (`reaches_eos`) and separate from it for the same reason the replay case is: ending on the pipeline's word and ending on the playhead are different failures. The harness rule that only a `reaches_eos` case may name a clip that runs out no longer assumes one such clip; a static test also pins each such clip against the 0.6 x run_secs bound that _resolve_fixtures skips on. The prose that said `EOS reached` needs the playhead within a second of the duration, and that a truncated transfer cannot reach it, is corrected in tests/README.md and `a_finished`'s docstring. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Oct 26, 2026
…1053) Merging was done with ad-hoc `gh` calls, and twice it went wrong: #387 merged RED because `gh pr merge` was chained after a watcher that read "run completed" mid-run, and #924 read `gh run list` as success while checks were still running. `tools/pr-land.py` is now the one place that judges a PR's checks and merges it. - `pr-land.py gate N [--sha S]`: one verdict, one exit code. 0 green, 1 red, 3 refused (not OPEN, wrong base, BEHIND/DIRTY/HAS_HOOKS, a required check skipping or unknown, an unlisted merge state), 4 not yet (running, missing required check, empty or unstable list), 5 the head moved off S. Required checks come from the base branch's ruleset; a base that requires nothing needs a stable check list over two polls. Green requires `mergeStateStatus == CLEAN`. - `pr-land.py wait N --sha S [--timeout]`: the same judgment, polled. - `pr-land.py merge N --sha S --subject T (--body-file F | --body-from-pr)`: waits, then `gh pr merge N --squash --match-head-commit S`, with the SHA that was gated (never re-read), no `--admin`, `--auto` or branch deletion. A head race re-gates and retries only with the same SHA, otherwise exit 5. The squash message is scanned against the repo's private-value list through `outbound-guard.py` (fails closed), and what was scanned is byte-identical to what is sent. Afterwards it fetches `main` and checks the squash commit is an ancestor; a verify failure says the merge went through. - UNSTABLE (required checks pass, a non-required one such as CodeQL is still running or failed) is judged by its rows: a failed row is red and named, a pending row is "not yet", never green until CLEAN. Stage 1a of the automation series. `restack`, the `land-pr` skill and the outbound-guard refusal of a raw `gh pr merge` follow in their own changes. One independent review of the combined diff found no path to `gh pr merge` without green checks and the gated head, one MAJOR (UNSTABLE refused by name) and four MINOR; all fixed with the new cases red first. `python3 tools/test_pr_land.py`: 69 tests OK (fake `gh`, injected clock, temp dirs).
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.
What
A permanent pipeline-tier case,
pipe_finish_audio_tail, with its own fixture,pipe_h264_ac3_audio_tail.mkv: 720x480 H.264 + AC-3 5.1, 20 s of picture and 23 s of audio. It grades that a film ends although its audio outlasts its video (#865).It is separate from
pipe_finish_eosbecause it is a different failure.pipe_finish_eosplays a clip whose picture and audio end together, which the pump's playhead arithmetic (pos >= dur - 1s) alone can end. This clip's playhead stops at the last frame (playpos=19s/23s) and never gets within a second of the container's duration (the longest track's), so only the pipeline's own end-of-stream (smp_cb type=28,Shared::pipeline_eos) ends it. The two share their expectations,reaches_eosincluded.Evidence it was built from
Dev TV (webOS 4.10.2),
pipe_finish_eosrun with a hand-made clip of this shape (720x480 H.264 + AC3, video 20 s, audio 23 s) swapped in under its fixture name:EOS pushed at true EOF,feed a#800 ... fed=21979000000 reply=e, clock stuck atpos=19s,smp_cb type=28 num=1 str=true, then nothing.[FAIL] finished: no 'EOS reached' line, max_stall 36 s.main(with player: a film ends on the pipeline's end-of-stream #865):EOS pushed at true EOF->smp_cb type=28 num=1 str=true->smp: the pipeline reached end-of-stream->EOS reached: playpos=19s/23s -> ended->stop_bufferfeed: torn down. PASS in 33 s.Device run of the new case (dev TV, webOS 4.10.2, main
60538b68deployed, fixture built by this branch'smake_fixtures.py --only pipe_h264_ac3_audio_tail): PASS in 34 s.Changes
tests/fixtures/make_fixtures.py: the shape, and one declarative knob,audio_tail_s.durationstays the container's length (23), so the duration check, the burned-in layout and the records of shapes a run did not build keep agreeing with the file; only the testsrc2 input ends early (picture_secs).verify_audio_tailreads both streams' last packet times back out of the finished file and fails the build unless the audio ends at least 2 s after the video (and within 0.25 s of the declared tail). Trap 9's second half now names both run-out clips.tests/manifest.json: the case, modelled onpipe_finish_eos.tests/test_harness.py: the rule that only areaches_eoscase may name a clip that runs out no longer assumes there is one such clip (it heldlen(short) == 1). A new static test pins each such clip against the0.6 x run_secs x viewingsbound_resolve_fixturesskips on, and another pins that the tail clip is named by a finish case. AnAudioTailFixtureclass covers the packet reader, the verify check (a clip that lost its tail fails), the builder's-tvalues (picture 20, audio and output 23, other shapes unchanged) and the case against the shape.a_finishedis pinned to acceptplaypos=19s/23s.tests/README.md,tests/run.py,docs/agent-reference.md: the prose that saidEOS reachedneeds the playhead within a second of the duration, and that a truncated transfer cannot reach it, is corrected (since player: a film ends on the pipeline's end-of-stream #865 the pipeline's word also ends it, so the line alone no longer proves the transfer ran to its end). The new case is in the README's "Playing to the END" section.No Rust changed.
Verification
python3 tests/fixtures/make_fixtures.py --tier pipeline --out "$HOME/plxnative-fixtures/pipeline" --only pipe_h264_ac3_audio_tail. Per-stream durations from ffprobe: video 20.000 s, audio 23.005 s, container 23.005 s; last packet ends 19.999 s / 23.000 s.verify()("audio ends 0.001s after the video ... wanted at least 2.0s")._resolve_fixturesresolves the case against the built pack (23 s against the 36 s bound); no other record infixtures.jsonwas dropped.make check-python-harness(CI's "host harness tests"):Ran 498 tests in 384.609s/OK.make check-python-rest(CI's "host python/shell/C gates"):==== check: 103 steps — all ok (354s wall, 452s cpu, 4 at once; slowest: test_build_gc.py 145s, check-placeholders.py 76s, test_demo_library.py 73s) ====.make checkwas not run. Both ran on the committed tree, and the status was clean before and after.🤖 Generated with Claude Code