Files
Matthew Stanley 1252c61c9d tools/divergence: persist the native-vs-interp first-divergence toolkit
Dev tooling only (never shipped: tools/ is not bundled in releases, and the
debug-server commands it drives are all PSX_NO_DEBUG_TOOLS-stripped in release
builds). Saved so the first-divergence workflow that root-caused the Tomba2
logo->FMV stall is never re-invented.

- t2probe.py   layer 1 fingerprint cap/diff; layer 2 unified-recorder dump +
               recdiff/recdiff_state (state fork, addr/val only); resolves the
               debug_client import relative to tools/.
- waitf.py     retry-connect + poll-until-frame (survives socket aborts).
- shot.py      screenshot to PNG for VISUAL end-state verification.
- README.md    the 3-layer method (always-on fingerprint ring -> divergent
               frame; frame-gated recorder -> divergent access; read-watch +
               per-entry cyc -> value/pointer/timing), env seeds, and the Tomba2
               worked example.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 23:23:15 -07:00

16 lines
612 B
Python

#!/usr/bin/env python3
"""shot.py <port> <out.png> - screenshot the runtime to a PNG (then Read it to
verify VISUALLY; a frame counter advancing != visually progressing). Dev tooling."""
import sys, os
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from debug_client import connect, send_cmd
port = int(sys.argv[1]); path = sys.argv[2]
s = connect(port=port, timeout=15)
for cmd in ("screenshot_file", "screenshot"):
r = send_cmd(s, {"cmd": cmd, "path": path})
print(cmd, "->", {k: r.get(k) for k in ("ok", "error", "path")})
if r.get("ok"):
break
s.close()