tools: the EXTRAS walk pressed (A) on NEW GAME -- fix the stop test

'Press until the cursor stops moving' broke on its first comparison: one DOWN
was dropped, the row read the same twice, and it concluded the cursor had
stopped while sitting on the first item. It then pressed (A) on NEW GAME. No
harm this time -- neither press registered and the screen stayed put -- but that
is luck, not the design.

A stop test that cannot distinguish 'at the end' from 'the press was lost' is
the press-counting bug wearing a different hat. Now: a non-move ends the walk
only after at least one move has been observed, four consecutive dropped presses
abort, and (A) is pressed only if the cursor demonstrably moved.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wuu56cE8vJGTBtn1ppsk8v
This commit is contained in:
sylph-decoder
2026-08-31 06:40:12 +00:00
parent 04afbe73d1
commit 97b0362bbd

View File

@@ -84,15 +84,33 @@ try: print("%.1f" % ring_row.ring_row(Image.open("/tmp/mbc_row.png")))
except Exception: print("nan")
PY
}
# 🔴 The first version of this loop broke on its FIRST comparison -- one DOWN
# was dropped, the row read the same twice, it concluded "the cursor has
# stopped" and pressed (A) on NEW GAME. A stop test that cannot tell "at the
# end" from "the press was lost" is the counting bug wearing a different hat.
# So: a non-move only ends the walk AFTER at least one move has been seen, a
# run of dropped presses aborts instead of pressing (A), and (A) is pressed
# only if the cursor demonstrably moved.
prev="$(row)"; echo " cursor row $prev"
for _ in 1 2 3 4 5 6 7 8; do
python3 "$SD/pad.py" tap DOWN 0.2; sleep 2
moved=0; stalls=0
for _ in 1 2 3 4 5 6 7 8 9 10; do
python3 "$SD/pad.py" tap DOWN 0.2; sleep 3
cur="$(row)"; echo " cursor row $cur"
[ "$cur" = "$prev" ] && break
prev="$cur"
if [ "$cur" = "$prev" ]; then
if [ "$moved" = 1 ]; then echo " cursor stopped -- at the last item"; break; fi
stalls=$((stalls+1))
[ "$stalls" -ge 4 ] && { echo "NO CURSOR MOVEMENT after 4 presses -- not pressing (A)"; exit 3; }
else
moved=1; stalls=0; prev="$cur"
fi
done
[ "$moved" = 1 ] || { echo "CURSOR NEVER MOVED -- not pressing (A)"; exit 3; }
python3 "$SD/pad.py" tap A 0.3; sleep 5
s="$(screen)"; echo " after EXTRAS attempt: $s"; shot "$OUT/extras.png"
# The blend map needs to know WHICH screen it is looking at, and screen_id
# calls both of these "menu". Ⓑ is advertised on EXTRAS and not on the main
# menu, so the footer is the discriminator a human would use; here the element
# count in the capture is checked instead, after the fact.
fi
# 3. arm, then dismiss the menu bar F10 opened