This repository has been archived on 2026-09-16. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Syplheed-Reborn/tools/re-capture/blackscreen_probe.sh
Sylpheed RE agent fa48e39d90 docs/re: the mission path measured end to end — the cache crash is the blocker
Driving menu -> NEW GAME -> DIFFICULTY -> SELECT DATA -> slot 01 with plain flags
gets further than any run so far: SELECT DATA is reached with ZERO crashes (the
screen is alive — a log_ui_draws probe there records 140 draws over 8 frames),
and then choosing a slot lets the game proceed into a cinematic or load, where it
crashes at 0x82307128 — the same cache-flush std::map erase.

So the crash is intermittent in WHERE it fires, not whether: boot, SELECT DATA,
and now after slot selection. There is no safe path through the menus to be found
by choosing different options.

And it is the blocker for every mission-side experiment — the second capital-ship
capture included. Navigation is not the obstacle any more; it is scripted and
works.

Not settled and said so: how to get past it. --mem_watch=false does not (twice).
--eh_dispatch is still untested because no run with it on has reached a throw.
The black-screen hang is a separate intermittent failure with no diagnosis. A fix
is emulator guest-race work, not RE.
2026-08-19 05:08:46 +00:00

63 lines
2.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# Drive into the black-screen hang and ask what the guest is still doing.
#
# Three questions, three cheap probes, all taken WHILE the screen is black:
# * is it still presenting frames? -> F10 arms the UI draw capture, whose
# header records the frame numbers it covered and how many draws it saw
# * is it still doing file I/O? -> count ResolvePath lines before/after
# * is it still running at all? -> the emulator's own MEM-WATCH/thread log
set -u
export HOME=/sylph-home/re SDL_AUDIODRIVER=dummy DISPLAY=:98
SD="$(cd "$(dirname "$0")" && pwd)"
OUT="${1:-/sylph-home/re/blackprobe}"
mkdir -p "$OUT"; rm -f "$OUT"/xenia_re_ui_draws_*.log
shot(){ screenshot "$1" >/dev/null 2>&1; }
screen(){ shot /tmp/bp.png; python3 "$SD/screen_id.py" /tmp/bp.png | awk '{print $1}'; }
alive(){ ps -o pid=,stat= -C xenia_canary 2>/dev/null | awk '$2 !~ /^Z/ {print $1}'; }
resolves(){ grep -c "ResolvePath" "$OUT/canary.stdout" 2>/dev/null || echo 0; }
for attempt in $(seq 1 "${ATTEMPTS:-3}"); do
echo "=== attempt $attempt"
pkill -9 -x xenia_canary 2>/dev/null; sleep 3
( cd "$OUT" && nohup run-canary --mem_watch=false \
--ui_draw_capture_frames=8 --ui_draw_capture_max=4000 \
--logged_profile_slot_0_xuid=B13EBABEBABEBABE >"$OUT/canary.stdout" 2>&1 & )
sleep 8
until xdotool search --name "Xenia-canary" >/dev/null 2>&1; do
[ -n "$(alive)" ] || { echo "EMULATOR GONE"; exit 4; }; sleep 1
done
win="$(xdotool search --name "Xenia-canary" | tail -1)"
s=""; deadline=$(( SECONDS + 420 ))
while [ $SECONDS -lt $deadline ]; do s="$(screen)"; [ "$s" = "title" ] && break; sleep 2; done
[ "$s" = "title" ] || { echo "NO TITLE"; continue; }
python3 "$SD/pad.py" tap A 0.3
for _ in 1 2 3 4 5 6 7 8; do sleep 3; s="$(screen)"; [ "$s" = "menu" ] && break; done
[ "$s" = "menu" ] || { echo "(A) refused; rebooting"; continue; }
echo "menu -> A (NEW GAME) -> A (difficulty)"
python3 "$SD/pad.py" tap A 0.3; sleep 10
python3 "$SD/pad.py" tap A 0.3
# wait for black
for i in $(seq 1 20); do
sleep 6; s="$(screen)"
mean=$(identify -format "%[fx:mean]" /tmp/bp.png 2>/dev/null)
echo " t+$((i*6))s $s mean=$mean"
case "$mean" in 0|0.0*) break ;; esac
done
shot "$OUT/black.png"
echo "--- probing the black screen"
r1=$(resolves); sleep 20; r2=$(resolves)
echo "ResolvePath lines: $r1 -> $r2 (delta $((r2-r1)))"
xdotool windowactivate --sync "$win"; sleep 1
xdotool key F10; sleep 4; xdotool mousemove 900 400 click 1; sleep 3
grep -i "UI-CAP" "$OUT/canary.stdout" | tail -3
head -2 "$OUT"/xenia_re_ui_draws_*.log 2>/dev/null
echo "log lines now: $(wc -l < "$OUT/canary.stdout")"
sleep 20
echo "log lines +20s: $(wc -l < "$OUT/canary.stdout")"
echo "BLACK PROBE DONE"
exit 0
done
echo "GAVE UP"