Skip to content

tests: a clip whose audio outlasts its video plays to the end - #924

Merged
GLinnik21 merged 1 commit into
mainfrom
pipe-finish-audio-tail
Oct 22, 2026
Merged

GLinnik21 merged 1 commit into
mainfrom
pipe-finish-audio-tail

Conversation

@GLinnik21

@GLinnik21 GLinnik21 commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

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_eos because it is a different failure. pipe_finish_eos plays 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_eos included.

Evidence it was built from

Dev TV (webOS 4.10.2), pipe_finish_eos run with a hand-made clip of this shape (720x480 H.264 + AC3, video 20 s, audio 23 s) swapped in under its fixture name:

Device run of the new case (dev TV, webOS 4.10.2, main 60538b68 deployed, fixture built by this branch's make_fixtures.py --only pipe_h264_ac3_audio_tail): PASS in 34 s.

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 (native Unload epoch=1 continues off-frame)

Changes

  • tests/fixtures/make_fixtures.py: the shape, and one declarative knob, audio_tail_s. duration stays 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_tail 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 (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 on pipe_finish_eos.
  • tests/test_harness.py: the rule that only a reaches_eos case may name a clip that runs out no longer assumes there is one such clip (it held len(short) == 1). A new static test pins each such clip against the 0.6 x run_secs x viewings bound _resolve_fixtures skips on, and another pins that the tail clip is named by a finish case. An AudioTailFixture class covers the packet reader, the verify check (a clip that lost its tail fails), the builder's -t values (picture 20, audio and output 23, other shapes unchanged) and the case against the shape. a_finished is pinned to accept playpos=19s/23s.
  • tests/README.md, tests/run.py, docs/agent-reference.md: 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 (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

  • Built the one clip locally: 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.
  • A clip built without the tail fails verify() ("audio ends 0.001s after the video ... wanted at least 2.0s").
  • _resolve_fixtures resolves the case against the built pack (23 s against the 36 s bound); no other record in fixtures.json was 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) ====.
  • No Rust changed, so make check was not run. Both ran on the committed tree, and the status was clean before and after.

🤖 Generated with Claude Code

#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
GLinnik21 merged commit a4a7aac into main Oct 22, 2026
15 checks passed
@GLinnik21
GLinnik21 deleted the pipe-finish-audio-tail branch October 22, 2026 15:27
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant