Files
psxrecomp/runtime
Matthew Stanley 80c33a8903 observability: capture CPU regs + full scratchpad in heartbeat, add spin-freeze wedge kind
The freeze heartbeat (always-on, ships in production builds since it is the
only observability that survives a main-thread stall) gains two things that
make a *logical hang* diagnosable from the small, user-uploadable
psx_freeze_heartbeat.json alone:

1. CPU register file (pc + 32 GPRs, same shape as psx_last_run_report's "cpu")
   and the full 1 KB scratchpad (0x1F800000..0x3FF) in every tick and every
   auto-dump. PSX engines keep per-frame command/list state in scratchpad;
   $t1 (gpr[9]) holds the BIOS A0/B0/C0 function index while a guest is parked
   in a kernel-call poll, so this also answers "which B0 function".

2. A new wedge kind D (5, "spin_freeze"): frames advance at a healthy rate but
   current_func + last_store_pc + dirty_ram_insns are all pinned across the
   window = the game is spinning while the IRQ/render loop keeps running. The
   existing hard-freeze / reentry-storm / slow-frames thresholds all miss this
   class (Tomba dwarf-village dialogue hang, issue #1: ~51fps, exc_re ~1.6K/frame).

Runtime-only, no regen. Verified: release config (PSX_DEBUG_TOOLS=OFF) links;
emitted JSON parses clean (gpr[32], scratchpad 1024 bytes).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 14:03:42 -07:00
..