mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-28 02:56:36 -04:00
864dff187d
Two pieces from the variant-coverage investigation: 1. dirty_ram_stats per_pc rows gain an `entries` counter: dispatches that arrived from NATIVE code (call / dispatch loop), distinguished from the interpreter's own block-to-block chaining via a consumed chain-target latch. `hits` conflates the two — below the local-flow floor every taken branch re-dispatches, so chain blocks dominate and misattribute hot families. First use REFUTED the main-EXE-interior- entry hypothesis: the 0x1DFF8/0x1E0D8 family (~1M insns) has ZERO external entries — it is purely downstream of overlay interp runs, and collapsed to 57K insns once the overlay variant was compiled. No main-EXE aliasing needed. 2. compile_overlays.py merges prior-manifest evidence on rebuild: every F entry in an existing .ranges for the SAME image bytes was proven compilable, so a fresh (poorer) capture cannot regress coverage. Callable entries re-enter as captured function entries; non-callable ones (alias wrappers from a prior build) re-enter as dispatch entries so the classifier re-derives their interior disposition — feeding them back as walk roots would truncate their hosts. Village variant DLL (000E7000_9707AAB5) force-rebuilt with merged evidence: 195 -> 244 functions incl. interior aliases. Verified on a user-played village+overworld lap: 0x12A60C (~1M interp insns), 0x138084, 0xED2F4 now native and absent from per_pc; 0 dispatch misses, 0 aborts, 0 invalidations. Remaining interp load is (a) the variant long tail — the same overlay region holds scene-dependent variants where one variant's code address is another variant's DATA (0x800E889C: code in the overworld-family image, a pointer table in the village image); per-entry hashing correctly refuses stale native code, and each variant gets covered when captured — and (b) the kernel-RAM SIO stub at 0xCF0 (~4.6M insns/ session), a separate class. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>