mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-28 19:07:47 -04:00
ab87cb8ef4
A misconfigured overlay_autocompile_cmd silently degrades an entire session to the interpreter. The diagnosis machinery for this already existed and was good — autocompile_report_broken_once() fires after 3 consecutive failures and explains exactly what to check — but it writes to fprintf(stdout), and the shipped runtime links -mwindows: a GUI-subsystem binary with no console. The warning is emitted into nothing on precisely the builds people run. Observed cost: a fresh worktree ran 100% interpreted for a whole session (runs=8 fails=8 shard_ok=0, dispatch_native=0) because game.toml named a recompiler path the documented build recipe does not produce. The only symptom was "it feels slow", and it invalidated a performance A/B before anyone thought to query the counters by hand. Three changes: - Validate the command's path arguments at CONFIGURE time. The existing check resolves only the first token (the interpreter); it never looked at --recompiler, which is the argument that actually breaks — it is hardcoded per-title and disagrees with where the recipe builds. Paths now resolve against the child's working directory and are checked before any compile is attempted, rather than the truth emerging after three failed spawns. Advisory, not fatal: the runtime still runs exactly as before, just not silently. - Record WHY in one string, exposed as degraded/degraded_reason in autocompile_status over the TCP debug server. Rule 3's answer rather than more printing. Keeps the FIRST cause, which is the useful one. - Stamp it into psx_last_run_report.json. This is the part that prevents a repeat: a field you have to query is a field nobody queries. A degraded run now says so in its own artifact, so "was that measurement valid?" is answerable after the fact instead of having to be suspected. test_autocompile_degraded (new, registered in CTest) builds the real failure shape and asserts it is caught at configure time, that the reason names the offending flag, that the first cause is retained, and that the reason is escaped so it cannot break the JSON for every consumer. Also fixes a pre-existing %d/LONG format mismatch on last_exit that this change's argument shuffle surfaced; warnings on autocompile.c go 2 -> 1 (the remaining array-bounds one in watch_thread is pre-existing and untouched). NOT done here, deliberately: the underlying cause is that every title's game.toml hardcodes a build-directory path (Tomba 2 names a worktree-relative dir the recipe never creates; MMX6 hardcodes an absolute path into one checkout). Fixing that means having CMake record the real recompiler location and touching six title repos — its own change. This one makes the failure impossible to miss. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>