Files
psxrecomp/runtime/include/overlay_backend.h
T
Matthew Stanley 5b7e69b441 Remove the sljit Tier-2 in-process JIT backend
The tier mis-compiled and has been hard-gated off since 2026-06-25; overlay
gaps fall to gcc/tcc shards and the dirty-RAM interpreter, unchanged.

Re-do on master of the removal validated on the stale branch (6da8c02),
reconciled with everything master grew since the fork:

- Delete overlay_sljit.{c,h}, overlay_compile_worker.{c,h}, lib/sljit,
  runtime/tests/sljit_*.c, and the runtime.cmake sources/include-dirs.
- Strip the sljit provider/backend from code_provider.{c,h},
  overlay_backend.{c,h} ("sljit" in overlay_backend/PSX_OVERLAY_BACKEND now
  degrades to auto so stale configs still boot), main.cpp, debug_server.c
  (sljit_status/sljit_async/sljit_try TCP commands), overlay_loader.{c,h}
  (live policy, JIT-on-miss, persisted-shard cache, async worker glue,
  psx_sljit_call/cop2/memx host helpers — reachable only via the removed
  cpu->sljit_helpers table), and cpu_state.h (SLJIT_HLP_* enum + the
  sljit_helpers[] member; CPUState layout change reshards via the cg tag).
- Master-only entanglement resolved before deletion: 28165d6's Einhander WS
  player-X bound emit existed in three paths (gcc code_generator, sljit,
  dirty_ram_interp). The gcc shard link contract now forwards
  psx_ws_player_x_bound (ABI v13, previous commit), so deleting the sljit
  emit path loses no widescreen behavior; ffc6688's game-dispatch block
  inside the dead psx_sljit_call helper goes with it.
- Reword comments that described sljit as a live backend (gpu.{c,h},
  ws_*_detect.h, cosim_state.c, dirty_ram_interp.c, autocompile.h,
  boot_state.h, config_loader.h, compile_overlays.py, and the CPS marker
  comments the recompiler emits).

recompiler psxrecomp-game builds clean; game runtimes rebuilt + boot-verified
separately.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 22:22:38 -07:00

59 lines
2.5 KiB
C

#ifndef OVERLAY_BACKEND_H
#define OVERLAY_BACKEND_H
/* overlay_backend — compiler-NEUTRAL overlay tier-selection policy.
*
* This is NOT specific to any one producer. It decides which native overlay
* tier fills a gap, in priority order:
*
* static > gcc shard > tcc shard > interp
*
* - gcc: spawn-gcc -> overlay DLL. The developer / production "holy grail"
* (best-optimized; the shards shipped in releases).
* - tcc: spawn-tcc -> overlay DLL. Bundled, toolchain-free user fallback that
* fills regions the shipped gcc cache misses on a machine without gcc.
*
* (The in-process sljit JIT tier was removed 2026-07-15 — it mis-compiled and
* had been gated off since 2026-06-25. Uncovered gaps fall to the interpreter.)
*
* gcc and tcc go through the IDENTICAL pipeline (recompiler -> C -> compiler ->
* DLL -> loader); they differ only in the compiler binary the autocompile
* command runs. So both map to the same in-runtime "code provider" (the
* autocompile spawn) — see code_provider.c — and which compiler runs is chosen
* here by the resolved backend.
*/
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
OVERLAY_BACKEND_AUTO = 0, /* gcc if a gcc toolchain is present, else tcc */
OVERLAY_BACKEND_GCC = 1, /* force spawn-gcc->DLL (dev / production shards) */
/* value 2 was OVERLAY_BACKEND_SLJIT (removed 2026-07-15) */
OVERLAY_BACKEND_TCC = 3, /* spawn-tcc->DLL (bundled, toolchain-free fallback) */
OVERLAY_BACKEND_AUTO_NO_GCC = 4 /* dev/test: resolve like AUTO but pretend no gcc toolchain
* (gcc shards still LOAD; gaps fill via tcc) — simulate a
* toolchain-less user box on a dev machine. */
} OverlayBackend;
/* Resolve the effective backend once at startup. `gcc_toolchain_available` is 1
* when a gcc toolchain is actually reachable AND a compile command is wired (a
* real dev/production box). Precedence: env PSX_OVERLAY_BACKEND > game.toml
* [runtime] overlay_backend (`cfg`) > AUTO. AUTO -> gcc if the toolchain is
* present, else tcc. AUTO_NO_GCC -> tcc regardless (the simulate-user mode).
* The result is cached + logged. */
OverlayBackend overlay_backend_resolve(const char *cfg, int gcc_toolchain_available);
/* The cached resolution (OVERLAY_BACKEND_AUTO until resolve() runs). */
OverlayBackend overlay_backend_active(void);
/* "auto" | "gcc" | "tcc" | "auto-no-gcc". */
const char *overlay_backend_name(OverlayBackend b);
#ifdef __cplusplus
}
#endif
#endif /* OVERLAY_BACKEND_H */