fix(badapple): refuse a non-cache --tiles path before the jump

demo.sh loaded (and jumped) the payload before it ever looked at --tiles, so a
wrong path -- the frames directory rather than the cache make_tiles.py writes --
only surfaced after the machine had been handed to a payload that never returns,
forcing a reboot to retry.  It now checks dictionary.bin/stream.bin first, names
the frames-vs-cache confusion when the directory holds raw frames, and exits 2
without touching the network.  The README's failure table gains that row and the
--no-load recovery for an instance that has already been jumped.
This commit is contained in:
arti committed 2026-10-31 22:05:48 +02:00
1 parent 650ec9a0cd
commit c166c6fdec
2 files changed
+21

No files matched your search

+2
View File
@@ -208,6 +208,8 @@ path; for a live run the screen is the evidence.
| symptom | cause |
|---|---|
| `demo.sh: ... did not answer within 180s` | the terminal is not on the tap, or `run.sh net` was started without the LANCE interface selected in its cfg |
| `demo.sh: ... has no dictionary.bin` | `--tiles` wants a **cache** directory, not the frames directory `clip_from_video.py` wrote; the message names the `make_tiles.py --clip … --out …` command that builds it |
| payload already jumped, need to send again | the script refuses a bad cache path *before* the jump for this reason, but if it happens: rerun with `--no-load` — the payload is still running and waiting, and `vidsend` brings the dictionary with it |
| poke reads back a mismatch | the image is being loaded over a stale link, or the payload was built for a different load address |
| `DICT_BYTES` stuck below 32768 | datagrams lost before the payload saw them — check the tap and the sender's interface |
| picture sheared in MAME | `VT1200_MONITOR=VR150` is selected (the old derived 1024-px layout); leave the default VR319 |
+19
View File
@@ -42,6 +42,25 @@ while [ $# -gt 0 ]; do
esac
done
# --- the cache, checked BEFORE anything irreversible ------------------------
# The jump hands the payload the remote-debug process and it never returns, so
# a bad --tiles path discovered afterwards leaves the machine needing a restart
# to try again. Refuse it here instead.
if [ "$SEND" = 1 ]; then
for f in dictionary.bin stream.bin; do
if [ ! -f "$TILES/$f" ]; then
echo "demo.sh: $TILES has no $f -- that is not a tile cache" >&2
if ls "$TILES"/[0-9]*.bin > /dev/null 2>&1; then
echo " it looks like a FRAMES directory (raw 1-bpp frames)." >&2
echo " build the cache from it first:" >&2
echo " python3 harness/udpstream/make_tiles.py --clip $TILES --out $TILES-tiles" >&2
fi
echo " the committed 30-frame cache is harness/udpstream/tiles" >&2
exit 2
fi
done
fi
# --- readiness: an ICMP reply from the terminal's own stack -----------------
start=$(date +%s)
while ! ping -c1 -W1 "$HOST" > /dev/null 2>&1; do