#!/usr/bin/env bash # Drive a JAPANESE title capture end to end, and ALWAYS put the locale back. # # The first JP capture (2026-08-30) demonstrated the logo stack is at rest # WITHIN a run: five frames ~1.5 s apart, byte-identical over the port's ROI, # against a whole-frame contrast control showing 5-8 % of the screen moving. # That does not test the axis sylpheed-port's drift was on -- BETWEEN runs. This # script exists to take a second, independent capture so that axis can be measured. # # 🔴 THE ORIGINAL RATIONALE HERE WAS REFUTED, and the retraction never reached this # file until 2026-08-31. It read: "BETWEEN runs, where a free-running clock lands # somewhere else on a fresh boot". IT DOES NOT. Both captures are shuttered on the # plate pulse, and the plate's pulse is part of the title animation, so the gate # PHASE-LOCKS the shutter: measured, the sweep sits 25-26 px apart across two runs # in different locales and different sessions -- 1.6 % of a ~1600 px traverse. # See structures/plate-pulse-phase-lock.md. # # ⚠️ SO WHAT THIS SCRIPT MEASURES IS NARROWER THAN THE COMMENT CLAIMED. A second # capture through the same gate is a second sample at nearly the SAME animation # phase, not a sample of a free-running clock. The RMSE 0.32 it produced is a # phase-locked lower bound on capture noise, not capture noise. The era # adjudication it fed still stands -- its margin, 16.72, clears even the unlocked # 11.9 -- but for the reason bgm/jp-title-at-rest.txt gives, not this one. # # Usage: jp_title_session.sh OUTDIR [wait_s] set -u export HOME=/sylph-home/re SDL_AUDIODRIVER=dummy DISPLAY=:98 SD="$(cd "$(dirname "$0")" && pwd)" OUT="${1:-/sylph-home/re/jp2}"; WAIT="${2:-700}" mkdir -p "$OUT" restore() { echo "-- restoring locale --" python3 "$SD/set_console_language.py" en || echo "RESTORE FAILED -- check by hand" python3 "$SD/set_console_language.py" --show } trap restore EXIT INT TERM ps -o pid= -C xenia_canary | xargs -r kill -9 # kill by NAME: `pkill -f` matches this shell python3 "$SD/set_console_language.py" ja python3 "$SD/set_console_language.py" --show ( cd "$OUT" && nohup run-canary --mem_watch=false \ --logged_profile_slot_0_xuid=B13EBABEBABEBABE \ >"$OUT/canary.stdout" 2>"$OUT/canary.stderr" & ) sleep 8 timeout $((WAIT + 120)) python3 "$SD/jp_title_capture.py" "$OUT" "$WAIT" echo "CAPTURE STEP DONE" ls -la "$OUT"/*.png 2>/dev/null | head