Last iteration I said launch_mission died because skip_intro only tests for the title on a static frame, gated at rmse <= 1500, and that run logged 1503 and 1549 just above the cut. I also said the fix was NOT to nudge 1500 but to measure both signals through a boot first. Measured, and the diagnosis does not survive. boot_trace.sh logs the two signals skip_intro decides on -- frame-to-frame RMSE and the is_title.py green-glyph count -- through a clean boot with no presses at all. One run, 29 samples over 484 s: 8 samples had rmse <= 1500, so the gate OPENED eight times 0 samples had glyph > 0, so the title was never seen At t=145 s the RMSE was 1205, comfortably inside the threshold, and the glyph test was called and answered zero. A frame can be perfectly static without being the title -- the intro movie has long quiet stretches, three reading RMSE exactly 0. So 1503/1549 were almost certainly movie frames too, and raising the constant would have admitted two more of them. What is left is narrower and honest: the interactive title never appeared, rather than appearing and being missed by a threshold. The limitation is recorded rather than buried: the tracer intended 1 s sampling and achieved 16.9 s, because each iteration forks two screenshots, ImageMagick compare and a fresh Python. So this does NOT prove the title never appeared -- only that it was absent from 29 samples. A window shorter than ~17 s falls between them. The recorded next step is to make the tracer sample at the rate it claims before concluding anything stronger. Artifact: docs/re/captures/boot-signal-trace.tsv. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PMRJjbxLqZtsb5Vb7KunPE
42 lines
1.9 KiB
Bash
Executable File
42 lines
1.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Log the two signals `skip_intro.sh` decides on, every second, through a whole
|
|
# boot -- WITHOUT pressing anything.
|
|
#
|
|
# Why: skip_intro only runs the title test when the frame is static, gated at
|
|
# `rmse <= 1500`. A 381 s run measured 1503 and 1549 -- just above the cut -- so
|
|
# the title test was never called and the one allowed press was never spent.
|
|
# The fix is NOT to nudge 1500; a threshold moved to make one run pass is fitted
|
|
# to a single sample. This produces the distribution the gate should be chosen
|
|
# from: for every second, the frame-to-frame RMSE and the green-glyph count,
|
|
# which are independent measurements of "is this a static frame" and "is this
|
|
# the interactive title".
|
|
#
|
|
# Output is TSV on stdout: seconds, rmse, glyph_px.
|
|
set -u
|
|
export HOME=/sylph-home/re
|
|
DISP="${DISPLAY:-:98}"
|
|
SD="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
alive(){ ps -o pid=,stat= -C xenia_canary 2>/dev/null | awk '$2 !~ /^Z/ {print $1}'; }
|
|
|
|
until xdotool search --name "Xenia-canary" >/dev/null 2>&1; do
|
|
[ -n "$(alive)" ] || { echo "# EMULATOR GONE before the window appeared" >&2; exit 4; }
|
|
sleep 1
|
|
done
|
|
printf 'secs\trmse\tglyph\n'
|
|
deadline=$(( SECONDS + ${1:-600} ))
|
|
while [ $SECONDS -lt $deadline ]; do
|
|
rm -f /tmp/bt1.png /tmp/bt2.png
|
|
screenshot /tmp/bt1.png >/dev/null 2>&1; sleep 0.6
|
|
screenshot /tmp/bt2.png >/dev/null 2>&1
|
|
# Same liveness guard as skip_intro: two STALE files compare to a constant
|
|
# non-zero RMSE, which reads exactly like a playing movie.
|
|
if [ ! -s /tmp/bt1.png ] || [ ! -s /tmp/bt2.png ]; then
|
|
echo "# SCREENSHOT FAILED at ${SECONDS}s" >&2; exit 5
|
|
fi
|
|
[ -n "$(alive)" ] || { echo "# EMULATOR GONE at ${SECONDS}s" >&2; exit 4; }
|
|
d=$(compare -metric RMSE /tmp/bt1.png /tmp/bt2.png null: 2>&1 | sed 's/ .*//' | cut -d. -f1)
|
|
g=$(python3 "$SD/is_title.py" /tmp/bt2.png 400 2>/dev/null | sed 's/[^0-9]*\([0-9]*\).*/\1/')
|
|
printf '%s\t%s\t%s\n' "$SECONDS" "${d:-0}" "${g:-0}"
|
|
sleep 1
|
|
done
|