mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-28 10:59:16 -04:00
8f654965b5
Re-land of the shard-observability suite from 6da8c02 (stale branch), merged against current master (keeps master's overlay_ext() platform suffixes, recompiler_patch hash sources, and the unconditional v12 rfe forwarder). - compile_overlays.py: ShardStats tallies every shard outcome — per-shard "SHARD FAIL [class]" lines, a SHARD BUILD SUMMARY, a machine-readable "PSX_SHARD_RESULT ok=N failed=M skipped=K" line, and a non-zero exit when any shard that should have built failed (previously a run that built zero shards exited 0, indistinguishable from a clean run). - New --check preflight: build every shard into a throwaway dir and report pass/fail — answers "would this game's shards compile against the current recompiler + headers?" without a runtime. - Retain audit-failed interior-fragment C (<phys>_<interior>_fragment_FAILED.c) for triage, plus a persistent doomed-interior memo (interior_fail_memo.txt) keyed (phys,interior,region_crc) so autocompile stops re-walking data-as-code fragments every cycle (~90x off the V8 fragment pass). - Extract DISPATCH_PREAMBLE to runtime/include/overlay_dispatch_preamble.c.inc (single source of truth for the shard link contract, loaded by load_dispatch_preamble(); missing file is a hard error). - codegen_hash_sources.cmake: fold the shard COMPILE surface (overlay_api.h, cpu_state.h, the .inc) into the cg tag so header/ABI/link-contract drift reshards same-tree instead of silently breaking every new shard compile. - autocompile.c: parse PSX_SHARD_RESULT from the child-output tail, expose shard_ok/shard_fail/shard_skipped/shard_fail_total over autocompile_status; ALWAYS rescan on completion so shards that did build load even when the run also reported failures. Live proof on the stale branch: Tomba's first autocompile surfaced 9 shard link failures (undefined psx_rfe_mark_escape — since fixed by v12) and V8 surfaced 91 benign data-as-code fragment failures, all previously silent. Codegen hash changes => every title reshards once on next build (expected; loader rejects/regenerates stale shards). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>