Commit 696ba12a by PLN (Algolia)

fix(finish): the global-stem gate compares against the master now, not a magic number

A threshold of 3700 seconds against an expected 3779 accepted exactly the state
the pass sits in for minutes: it writes in 120 s chunks, so 31 chunks is 3720 s —
one short — and "basically done" sails through a loose comparison. My own monitor
fired a premature COMPLETE on that very number, which is how I noticed: the check
and the bug had the same blind spot because I wrote both.

It now reads the expected duration from the master itself and allows two seconds,
so the check cannot drift from the thing it checks.

The fallback message says what a short global file would actually cost, which is
the part worth naming: it does not FAIL the comparison, because compare_global
takes min(len(a), len(b)). It compares fewer seconds per track and reports thinner
evidence under identical column headings. Silent degradation in a summary nobody
watches being written is worse than an error.

Second attempt at this commit. The first edit silently no-op'd — a scripted
replacement whose search string carried escaped line-continuations that did not
match the file, while the script printed "gate tightened" unconditionally, and I
reported success on the strength of that print. Caught by grepping the file. This
version asserts the anchor exists before replacing and asserts the content changed
after, then proves it by grep rather than by message. That is the third instance
tonight of the same failure shape — a check whose failure mode is indistinguishable
from success — so the assertions are the actual fix, not the gate.

Held until now deliberately: finish_cosmic.sh was mid-execution, and bash reads
scripts incrementally, so editing a running script can corrupt the run.
parent 5885da5f
...@@ -51,16 +51,25 @@ echo "--- stem EDA ---" ...@@ -51,16 +51,25 @@ echo "--- stem EDA ---"
# trap that made me misread "4 of 14 sections done" earlier tonight. The global # trap that made me misread "4 of 14 sections done" earlier tonight. The global
# comparison seeks into these by absolute time, so a truncated global stem would # comparison seeks into these by absolute time, so a truncated global stem would
# silently mis-align every later track rather than fail. # silently mis-align every later track rather than fail.
# Compare against the MASTER's own duration, not a hardcoded number. A threshold
# of 3700 was a rubber stamp: the pass writes in 120 s chunks, so it sits at
# 3720 s — 31 chunks, one short — for minutes while looking "basically done" to
# any loose comparison. My own monitor fired a premature COMPLETE on that number.
WANT=$(ffprobe -v error -show_entries format=duration -of csv=p=0 \
"$ROOT/ZOOM0067.MP3" 2>/dev/null | cut -d. -f1); WANT=${WANT:-3779}
GDUR=0 GDUR=0
if [ -f "$ROOT/stems_demucs/global/vocals.wav" ]; then if [ -f "$ROOT/stems_demucs/global/vocals.wav" ]; then
GDUR=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$ROOT/stems_demucs/global/vocals.wav" 2>/dev/null | cut -d. -f1) GDUR=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$ROOT/stems_demucs/global/vocals.wav" 2>/dev/null | cut -d. -f1)
GDUR=${GDUR:-0} GDUR=${GDUR:-0}
fi fi
if [ "$GDUR" -ge 3700 ]; then if [ "$GDUR" -ge "$((WANT - 2))" ]; then
echo "global stems complete (${GDUR}s) — full EDA with local-vs-global" echo "global stems complete (${GDUR}s of ${WANT}s) — full EDA with local-vs-global"
"$PY" "$TT/eda_stems.py" "$SPEC" "$PY" "$TT/eda_stems.py" "$SPEC"
else else
echo "global stems incomplete (${GDUR}s of ~3779) — section-only EDA" echo "global stems SHORT (${GDUR}s of ${WANT}s) — section-only EDA."
echo " A short global file does not FAIL the comparison — compare_global takes"
echo " min(len(a),len(b)) — it compares fewer seconds per track and reports"
echo " thinner evidence under the same headings. Worth saying out loud."
"$PY" "$TT/eda_stems.py" "$SPEC" --no-global "$PY" "$TT/eda_stems.py" "$SPEC" --no-global
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment