Files
Sylpheed/tools/re-capture/route_liveness_probe.sh
sim e909c7c133 chore: retire the last dead paths and names from the consolidation
Nothing here changes what a tool computes; it changes where tools look.

- tools/re-capture: 33 censuses globbed /work/sylph_extract, a path that has
  existed nowhere since /work became a clone, so they matched nothing and
  printed empty results. They now resolve the disc through a new disc.py
  from $SYLPHEED_DISC and exit loudly without it (the #44 fix, generalised).
  Nine scripts that imported siblings from the retired Reborn checkout or an
  old session scratchpad now import from their own directory. unitgroup.py
  only needs the variable when --pak is not given.
- sylpheed-xex: the loader only ever uses the XEX2 retail key. The dead
  devkit key and a doc comment claiming a devkit fallback that does not
  exist are gone; Project Sylpheed is a retail XEX2, so no XEX1 key either.
- sylpheed-viewer: real_font_rasterizes looked for /tmp/sylph_extract and so
  always skipped. It reads $SYLPHEED_DISC now, and passes against the disc.
- Comments and docs that named xenia-rs, the Reborn repository or /work/*.pe
  as places to look now name sylpheed.db, Canary's ppc_context.h and the
  flat .pe; docs/re/README.md no longer says the native Canary build does not
  run.

Historical records keep their original paths: findings that were measured
against /work/xenia-rs/sylpheed.db still say so.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-16 22:30:28 +02:00

38 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Boot to the main menu, then walk menu steps, measuring LIVENESS after each by
# comparing two frames a few seconds apart. Never trusts a progress log.
set -u
export HOME=/sylph-home/re SDL_AUDIODRIVER=dummy DISPLAY=:98 XENIA_PAD_FILE=/tmp/xenia_pad.txt
export PYTHONPATH=/sylph-home/.local/lib/python3.12/site-packages
SD="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export PATH="$SD/bin:$PATH"
OUT=/tmp/route; rm -rf $OUT; mkdir -p $OUT
pad(){ python3 "$SD/pad.py" "$@"; }
shot(){ screenshot "$OUT/$1.png" >/dev/null 2>&1; }
live(){ # two frames 5s apart -> % pixels changed
screenshot "$OUT/_a.png" >/dev/null 2>&1; sleep 5; screenshot "$OUT/_b.png" >/dev/null 2>&1
python3 - "$OUT/_a.png" "$OUT/_b.png" <<'PY'
from PIL import Image; import numpy as np, sys
a=np.asarray(Image.open(sys.argv[1]).convert('RGB'),dtype=float)
b=np.asarray(Image.open(sys.argv[2]).convert('RGB'),dtype=float)
d=np.abs(b-a); print(f"{(d.max(2)>4).mean()*100:.2f}")
PY
}
say(){ echo "[$(date +%T)] $*"; }
say "waiting for the title, then one A"
for i in $(seq 1 240); do
shot probe; s=$(python3 "$SD/screen_id.py" "$OUT/probe.png" | awk '{print $1}')
[ "$s" = title ] && break
[ "$s" = menu ] && break
sleep 2
done
say "screen=$s ; liveness here = $(live)%"
if [ "$s" = title ]; then pad tap A; sleep 6; fi
for i in $(seq 1 60); do
shot probe; s=$(python3 "$SD/screen_id.py" "$OUT/probe.png" | awk '{print $1}')
[ "$s" = menu ] && break; sleep 2
done
say "MAIN MENU (screen=$s) liveness = $(live)%"
shot 00-mainmenu