overlay: remove --overlay-exact; compile overlays via normal analysis (pivot)

Rips out the --overlay-exact recompiler path (analyze_exact_entries,
split_mid_function_targets, the CLI flag, and the compile_overlays.py flag),
returning the recompiler to master's naive whole-blob analysis. Overlay
compilation now splits mid-function branch targets into standalone functions —
the original behavior that produced black-on-load / blue-on-new-game — so we
can faithfully reproduce the failure before fixing it.

Pivot in approach: rather than excluding mid-function seeds at scan time, the
plan is to capture everything (the full overlay image is already dumped to
overlay_captures.json) and have the ingester detect each seed's containing
parent function at encode time and merge/ignore mid-function seeds, while
flagging entries reached only via computed/indirect jumps as jump-risk.

The runtime overlay loader/capture system (b2929aa) is unchanged. The 5
recompiler files are restored byte-exact to master (d22c9ce); config_loader's
overlay_cache flag is retained.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Matthew Stanley
2026-06-07 12:49:47 -07:00
parent b2929aa504
commit 520eebff5f
6 changed files with 11 additions and 407 deletions
+1 -5
View File
@@ -1573,11 +1573,7 @@ std::string CodeGenerator::generate_file(
// hit `psx_unknown_dispatch`. Surfaced by Phase B2 audit. The 16-pass
// cap is a safety limit; in practice each pass strictly reduces the
// remaining target set so convergence is fast.
//
// Overlay exact mode disables this: overlay branch targets are basic-block
// labels, not callable function entries, so splitting them into standalone
// functions produces broken dispatch — the mid-function-seed failure mode.
if (config_.split_mid_function_targets) {
{
std::set<uint32_t> cfgs_to_scan; // Which CFGs to scan (empty = all)
uint32_t exe_start = exe_.header.load_address;
uint32_t exe_end = exe_.end_address();