port: check-all hung for an hour on an ffmpeg that had already finished its work

check-all sat on two lines of output for over an hour. The cause was the 5.1 bed
in check-capture-controls: ffmpeg completes the filter graph and then never exits.
Diagnosed rather than guessed -- the output reaches 4604262 bytes, exactly 8.0 s
of 5.1ch/16-bit/48kHz, the full intended length, with the artifact correct on disk
while the process hangs.

Three formulations all hang and all produce byte-identical output: the original,
one with -t 8 bounding the output, and one with explicit asplit feeding each atrim
(the textbook fix for multi-use of a single input). So it is not the split, not
the output stage, and the artifact is not in doubt.

Worse than the hang: it leaks. An orphaned ffmpeg from this script's earlier aloop
form was still running after 9.5 hours, burning CPU across runs nobody was
watching. boot.gd's header already names the shape -- a job that waits forever
reads as a job still working.

Bounded with timeout, and the ARTIFACT is now checked rather than the exit code:
the bed's duration must be 8 s or the sweep refuses to score itself. That is the
better test regardless of the hang -- an exit code says ffmpeg thought it was
done, the file says what it wrote. The step now completes in 99 s and the sweep
matches its specification.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N7FiFFFwbvG2uxdcEh8HyF
This commit is contained in:
Sylpheed port agent
2026-08-30 13:51:34 +00:00
parent 03457c42e3
commit 9ab1f59195

View File

@@ -72,7 +72,30 @@ ffmpeg -v error -y -i "$W/tones.wav" -c:a pcm_f32le "$W/tones_f32.wav"
# Six NON-OVERLAPPING spans of real audio, one per channel, all continuous. A
# second attempt used `aloop=-1` to stretch the short UI cues into full-length
# channels and hung ffmpeg indefinitely; spans of the long assets need no looping.
ffmpeg -v error -y -i export/audio/bgm/main_menu.ogg \
# 🔴 THIS FFMPEG COMPLETES ITS WORK AND THEN NEVER EXITS, AND IT WEDGED THE
# WHOLE SUITE FOR AN HOUR.
#
# `check-all` sat on two lines of output for over an hour; the cause was this
# call. Diagnosed rather than guessed at: the output file reaches **4 604 262
# bytes = exactly 8.0 s of 5.1ch/16-bit/48 kHz**, the full intended length, and
# ffmpeg then hangs with the artifact already correct on disk.
#
# Three formulations were tried and all three hang, all three producing
# BYTE-IDENTICAL output: the original, one with `-t 8` bounding the output, and
# one with explicit `asplit` feeding each `atrim` (the textbook fix for
# multi-use of a single input). So it is not the split, not the output stage,
# and the artifact is not in doubt.
#
# ⚠️ Worse than the hang: it LEAKS. An orphaned ffmpeg from this script's earlier
# `aloop` form was found still running after **9.5 hours**, burning CPU across
# runs nobody was watching. `boot.gd`'s own header already names this failure
# shape -- "it does not fail, it waits, and a job that waits forever reads as a
# job still working".
#
# So: bounded, and the ARTIFACT is checked rather than the exit code. That is
# the better test regardless of the hang -- an exit code says ffmpeg thought it
# was done, the file says what it actually wrote.
timeout 90 ffmpeg -v error -y -i export/audio/bgm/main_menu.ogg \
-i export/audio/voice/ADV.ogg -i export/audio/voice/S00A.ogg \
-filter_complex "[0:a]atrim=2:10,asetpts=N/SR/TB,aformat=channel_layouts=mono[a0]; \
[0:a]atrim=20:28,asetpts=N/SR/TB,aformat=channel_layouts=mono[a1]; \
@@ -81,7 +104,12 @@ ffmpeg -v error -y -i export/audio/bgm/main_menu.ogg \
[2:a]atrim=12:20,asetpts=N/SR/TB,aformat=channel_layouts=mono[a4]; \
[2:a]atrim=35:43,asetpts=N/SR/TB,aformat=channel_layouts=mono[a5]; \
[a0][a1][a2][a3][a4][a5]join=inputs=6:channel_layout=5.1[a]" \
-map "[a]" -c:a pcm_s16le "$W/bed.wav"
-map "[a]" -c:a pcm_s16le "$W/bed.wav" </dev/null || true
bed_dur=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$W/bed.wav" 2>/dev/null || echo 0)
if ! awk "BEGIN{exit !($bed_dur > 7.9 && $bed_dur < 8.1)}"; then
echo "🔴 the 5.1 bed is $bed_dur s, not the 8 s this sweep is built on -- refusing to score it" >&2
exit 2
fi
# The same bed with 350 ms holes punched through it, every second.
ffmpeg -v error -y -i "$W/bed.wav" \