Commit Graph

326 Commits

Author SHA1 Message Date
Matthew Stanley 84a901289d mods: make bezel artwork user-selected 2026-08-24 17:03:52 -07:00
Matthew Stanley 9ba703e5ed Merge remote-tracking branch 'origin/master' into split/pr169-presentation-bezel
# Conflicts:
#	runtime/runtime.cmake
2026-08-24 15:16:40 -07:00
Matthew Stanley c8e3dac678 presentation: expose bezel artwork as a mod 2026-08-24 15:15:15 -07:00
Matthew Stanley 7a872bc018 docs: add host optimization and upstream audit notes 2026-08-23 13:09:19 -07:00
Matthew Stanley 55cec09acd docs: retire stale sljit references, attribute TinyCC
The sljit Tier-2 in-process JIT was replaced by the tcc tier in c2a3f6ad
(2026-06-25) and removed outright in 5b7e69b4 (2026-07-15). That removal
reworded the C-level comments but touched no markdown, so the prose still
described sljit as a live, default-on backend.

Backends today are static -> gcc -> tcc: gcc is the development default when
it is on PATH, tcc is the toolchain-free path for players. Both are external
compilers invoked as a subprocess that produce a DLL; neither is an in-process
JIT. docs/ARCHITECTURE.md, docs/BUILDING.md, docs/EXECUTION_MODEL.md,
docs/COMPILING_OVERLAYS.md and README.md already said this correctly and are
unchanged here.

- THIRD_PARTY_ATTRIBUTION.md: the sljit entry claimed code vendored at
  lib/sljit/ and compiled into the runtime. That directory does not exist.
  Replaced with a TinyCC entry, which was missing entirely despite tcc being
  the compiler intended to reach end users.
- docs/internal/SLJIT_PERSIST_CACHE.md: deleted. It documented the persisted
  shard cache of a subsystem that no longer exists, as "implemented" and
  "default-on". docs/internal/README.md updated to point at the current model
  instead of a dead link.
- docs/ASYNC_OVERLAY_COMPILE.md: superseded-in-part header. Deliberately NOT
  rewritten sljit->tcc: the passages about serializing .sljit blobs,
  overlay_sljit_deserialize and an in-memory JIT registry describe a mechanism
  tcc never used, so renaming it would trade one false claim for another. The
  async worker/file-handoff design and the CPS work remain accurate.
- docs/OVERLAY_CACHE_V2.md: sljit dropped from the dispatch priority chain.
- ISSUES.md: Issue #7 closed as superseded — the backend it reported against
  was deleted rather than fixed.
- docs/internal/COSIM_ORACLE.md: sljit_helpers left CPUState with the tier.
- Dated session logs (RECURSION_BUG.md 25.5, BACKDROP_PRELOAD.md,
  ecosystem-watch.md) keep their narrative and get a pointer to the removal.

One thing this does not fix: docs assert the tcc toolchain is "downloaded at
release-packaging time and bundled beside the game exe". runtime/src/main.cpp
does look for <exe_dir>/overlay_toolchain/, but no script in this repository
creates it. The attribution entry now states only what the code does and notes
that if packaging supplies the bundle, it happens outside this repo and must
carry the TinyCC notice. Flagged rather than papered over.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-16 18:16:34 -07:00
Alex Vanderveen d4ea4ade1f fix crash path from bad splash screen bug, and optimize cross platform pacing + rollback 2026-08-14 02:25:59 -04:00
Alex Vanderveen 4274a76a19 fmv hardening 2026-08-13 01:28:56 -04:00
Alex Vanderveen d5b5a029fe hotfix ci template 2026-08-12 21:53:26 -04:00
Alex Vanderveen c4f412be17 project studio, harden prefetch sdl3 2026-08-12 16:49:03 -04:00
Alex Vanderveen b1c2317c44 Merge pull request #138 from mstan/master
upstream merge
2026-08-12 02:11:00 -04:00
Matthew Stanley 0bd6ddf730 Merge master into fix/issue72-overlay-project-root
Conflict: recompiler/CMakeLists.txt. Master gained #134's test registrations
in the same block where #133 added stall_report. Resolved as the union of both.

Also RE-ENABLES aot_overlay_discovery, which is not part of the conflict region
and so would otherwise have survived the merge untouched. #134 registered it
DISABLED with this reason:

  "fails in check_real_batched_fragment_publication: that check reaches
   MOD.compile_fragment_batch, which spawns psxrecomp-game with cwd set to its
   own TemporaryDirectory, so BIOS-profile resolution finds nothing ... it
   needs an owner, and DISABLED keeps it counted until then."

This branch is that owner -- resolving BIOS-profile lookup against
--project-root instead of the CWD is exactly that fix. Landing it while leaving
the test disabled would ship the fix with its own proof switched off, which is
the silent-rot class #134 exists to prevent.

Measured on this tree, msys64 toolchain driven from PowerShell:

  - pristine origin/master: test_aot_overlay_discovery.py exits 1 at
    check_real_batched_fragment_publication, "no BIOS profile found"
  - this merge: ALL PASS, and ctest -R aot_overlay_discovery passes in 7.64s
    with the DISABLED property removed
  - baked codegen hash 0xfbb44d49u on BOTH arms -- the cache tag does not move,
    so existing overlay caches keep loading
  - full ctest failure set identical to pristine master, no new failures

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 22:27:33 -07:00
Alex Vanderveen 2207cd9a09 auto versioning CI releases 2026-08-11 22:05:20 -04:00
Alex Vanderveen 581d4e927c Merge origin/master into feat/legendofmanaetc
Resolve main.cpp by keeping ae_fill/rematch netplay bring-up and taking
master's mod-safe turbo_loads/skip_fmv apply (no pre-activation clobber).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-11 19:28:20 -04:00
Alex Vanderveen 599d326dd0 default multitap and multitap hack, and savestate optimizations 2026-08-11 14:20:26 -04:00
Alex Vanderveen 4e8900e6fe bios netplay patch 2026-08-10 23:20:30 -04:00
Alex Vanderveen 91d683d87d bios hotfix 2026-08-10 22:53:17 -04:00
Alex Vanderveen 71adcfa2c0 BIOS pathing 2026-08-10 22:17:30 -04:00
Matthew Stanley f0cfa92afa config: retire the legacy generic turbo_loads switch — load acceleration is mod-only
Load acceleration moved to the Mods catalog in 125d84d
(psx.enhancement.fast-loading "Fast Loading (host pacing)" and
psx.enhancement.cd-speed, both `game_id = "*"` so they ship with every
title, both default-off), and recomp-ui deliberately stopped drawing a
generic Turbo loads row. But the legacy switch was left live here with
`offer_turbo_loads` defaulting TRUE, so any title that had not explicitly
migrated still got turbo forced on — with no UI to turn it back off.

That shipped to players. MegaManX6Recomp v1.0.4 and v1.0.5 both carry
`[runtime] turbo_loads = true` in the game.toml inside the release zip
(verified by extracting the artifacts). Two paths forced it on:

  * game.toml [runtime] turbo_loads set g_turbo_loads_enabled directly;
  * a stale [video] turbo_loads in settings.toml was restored, and the
    seed write persisted it — so one run latched the value permanently
    and no later game.toml change could undo it.

Reported as MegaManX6Recomp#14: the WARNING screen self-advances and load
spinners run fast, with Turbo confirmed off in Mods. Tomba 2 hit the same
defect (fixed per-title), and MMX5 is also unmigrated. Third occurrence of
one config default, so fix the class instead of the titles.

Both keys are still PARSED, so existing configs load without error, but
neither is honoured:

  * offer_turbo_loads defaults false and turbo_loads_offered becomes a
    constexpr false, matching how ws_offered / skip_fmv_offered /
    frame_interpolation_offered already model mod-owned features. No title
    can offer the generic switch, so forgetting to migrate is no longer
    punished.
  * game.toml turbo_loads logs a deprecation line naming the Fast Loading
    mod and enables nothing.
  * settings.toml [video] turbo_loads is neither restored nor written back
    out, so the stale row is dropped on the first save — same write-only
    latch reasoning already documented for fast_boot, which bit harder here
    because there was no UI control at all.

Also fixes a related hole found while auditing: the in-game Settings apply
path wrote both g_turbo_loads_enabled and g_auto_skip_fmv from a launcher
snapshot taken BEFORE mod_runtime_activate_plugins() ran, so the first
in-game Apply silently turned a player's enabled Fast Loading or Tweaks FMV
feature back off. Both are now gated on their offered flags.

The supported surfaces are unchanged: the Fast Loading / CD Speed mod
plugins still enable acceleration (verified: "mod selected 8x load
acceleration"), and the `turbo_loads` TCP debug command still toggles it
for development.

Verified against MMX6 built on this framework: with game.toml
`turbo_loads = true` AND `offer_turbo_loads = true` AND a stale
settings.toml `turbo_loads = true`, both deprecation lines fire and the
debug server reports enabled=0, turbo_frames=0. With the keys removed and
no mods enabled, it boots silently with enabled=0.

test_mod_load_acceleration.py is updated to pin the new contract; it also
had a stale assertion on the old 2..16 multiplier range, which is now
pinned to the symbolic PSX_MOD_LOAD_ACCEL_MAX bound. The guard-test suite
goes from 9 pre-existing failures to 8 (no new failures; this one fixed).

Refs: beads-eio.3.26, MegaManX6Recomp#14

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-10 18:52:16 -07:00
Alex Vanderveen 2c1942b569 project migration tools 2026-08-10 20:44:55 -04:00
Alex Vanderveen 61279a9d01 bios select and rematch pathing fix 2026-08-10 20:44:18 -04:00
Matthew Stanley a3b7f47d17 tools: add stall_report.py, one-command interp/stall attribution
Diagnosing "why is this title spending its time in the interpreter" currently
means issuing eight TCP commands by hand and correlating their JSON. That is
enough friction that it does not get done, and when it is done by someone
without the runtime's internals in their head the numbers get misread -- #72
is a live example: an empty phase_hot was read as a possible bad query when it
in fact meant nothing native was executing at all.

stall_report.py collapses that into one command and one pasteable report,
usable against any title on any port:

  [1] Is the overlay cache actually BEING USED, or just present on disk?
      dispatch_native vs dispatch_interp_fallback, stale_blocked, the
      autocompile degraded channel, and shard ok/fail/skipped counts.
  [2] When code IS interpreted, is it chaining or thrashing?
      dirty_ram insns_run/blocks_run = instructions per dispatcher
      round-trip, with the kernel-window-is-per-block-by-design caveat
      stated inline so a low ratio there is not misread as a bug.
  [3] Where did the wall-clock actually go?
      The largest host_us gaps in the always-on PC-sample ring, each with
      the guest cycles that advanced across it. That ratio separates three
      failure shapes that look identical in a frame-time graph: CPU kept up
      (gap is GPU/present/vsync), CPU-bound but executing, and emu thread
      not running at all.
  [4]-[6] phase shares, hottest interpreted PCs tagged kernel vs
      above-floor, and phase_hot deltas for both the native and static sets.

PASSIVE RING CONSUMER by construction, per the project's observability rule:
it never arms a trace, never pauses, never single-steps. Everything is a
cumulative counter (two snapshots subtract to a window) or a read of a ring
that has been recording since process start, so attaching late still sees the
event. `snap` reports cumulative; `run --secs N` reports deltas.

Two caveats are printed in the output rather than left to be rediscovered:
current_func is a STATIC dispatch stamp and localizes without proving
interpretation, and an empty native phase_hot means nothing native ran rather
than a malformed query.

Validated against a live Tomba 2 debug build (Release + PSX_DEBUG_TOOLS=ON,
port 4515), both modes and the --out JSON artifact. Representative real
output: dispatch_native 3,253,132 (97.16%) vs interp_fallback 95,047 (2.84%),
16,329 instructions per dispatcher round-trip, and one 68 ms gap at 0.46x
realtime flagged in-exception. Development of the tool caught two defects in
itself that way -- snap mode subtracted a snapshot from itself and reported
zeros for everything, and non-ASCII output mojibaked on a cp1252 console --
both fixed before commit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-10 12:58:23 -07:00
Matthew Stanley e3ecd67bd4 recompiler: resolve the BIOS profile against --project-root, not the CWD
compile_overlays.py spawns psxrecomp-game with cwd = dirname(game.toml),
because the seeds and capture paths in the config are relative to it. That
cwd is also where the recompiler probes for bios/SCPH1001.toml when the
config carries no explicit [recompiler] bios_config -- and --ws-config, the
only config channel overlay compiles use, deliberately does not adopt the
config's paths, so bios_config is never consulted for them.

For a PACKAGED game.toml (packaging/release/game.toml) that directory holds
neither bios/SCPH1001.toml nor a vendored framework one level down. Every
shard then died with "FATAL: no BIOS profile found", ok=0, and the overlay
cache silently failed to build. The run still exits, so the only symptom is
that the title ships with no cache and every player's first session runs
interpreted. Reported as issue #72, and it is what the recipe printed by the
game repos' package_release.ps1 told people to run.

Fix:

- psxrecomp-game takes --project-root <dir> and resolves the profile against
  it: the direct bios/SCPH1001.toml probe, the one-level vendored-framework
  probe, and a relative [recompiler] bios_config (documented as relative to
  the game project root, previously resolved against the CWD). Absent the
  flag, behaviour is unchanged.

- Every "no BIOS profile found" / bios_config failure now names the absolute
  directory it searched. Without it the message reads as a config error when
  it is a CWD error, which is what cost two vault parses on the Tomba 2
  v0.0.8 cut.

- compile_overlays.py forwards --project-root to all three recompiler spawn
  sites, defaulting it to the framework root derived from the required
  --runtime-include. The derivation is used ONLY when it actually locates a
  profile, so it can repair a broken invocation but never alter one that
  already worked -- and the recipe the packager prints now works as written,
  with no game-repo change. Every attribute lookup degrades to "pass no
  flag" so the in-process callers that build a partial args object keep
  working.

This also un-breaks the framework's own overlay test suite, which was RED on
master for the same reason: test_aot_overlay_discovery.py compiles against
tools/cycle_testrom/game.toml, so the recompiler probed
tools/cycle_testrom/ -- which has no BIOS profile -- and every shard failed.
Measured on this tree with one recompiler binary, changing only the tool and
tests: master exits 1 at check_real_batched_fragment_publication; this commit
reaches ALL PASS.

Two test repairs were needed to get there, both pre-existing and both masked
by the profile failure that stopped the suite before it could reach them:

- check_full_candidate_cli_fastpath stages a SYNTHETIC runtime_include in a
  temp dir, so the framework root is not derivable from it and the root must
  be named explicitly.
- the same test staged its cache prefill under cg<ver>_<hash>, missing the
  _gc<config-hash> component the cache path gained. A prefill one directory
  off is not found, so the run compiled for real instead of taking the fast
  path the test exists to assert.

The cache tag is unaffected: main_psx.cpp is not in codegen_hash_sources.cmake
(verified -- the baked hash is fbb44d49 before and after), and
--overlay-config-hash returns before any of this code runs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-10 12:44:22 -07:00
Alex Vanderveen 272c843ba3 update CI workflow for fast update packages that reuse local c 2026-08-10 00:29:02 -04:00
Alex Vanderveen 47d1bf147b stomp mods in netplay 2026-08-09 22:24:48 -04:00
Alex Vanderveen d3f979154a bumpt 2026-08-08 20:25:32 -04:00
Alex Vanderveen 7f3a77ecc7 Merge pull request #116 from mstan/integrate/game-codegen-hooks-into-rollback
Integrate/game codegen hooks into rollback
2026-08-08 19:39:17 -04:00
Alex Vanderveen 4fb1715425 update new project scripts 2026-08-08 15:12:35 -04:00
Alex Vanderveen c31eb12dc1 setup wizard and launcher support 2026-08-08 14:10:49 -04:00
Alex Vanderveen d1d063d293 codegen + bios launcher patch 2026-08-08 14:10:06 -04:00
Alex Vanderveen 02b08dae54 fix CTR graphics 2026-08-08 12:28:05 -04:00
Alex Vanderveen 81e0e46b8c gating flush mem technique 2026-08-08 02:10:49 -04:00
Alex Vanderveen 2e3e7365db CI hardening 2026-08-07 16:13:55 -04:00
Alex Vanderveen 5748a228a4 hardening toolchain and build 2026-08-07 14:53:56 -04:00
Alex Vanderveen 346e627f3e toolchain + CI + wizard hardening 2026-08-07 14:33:43 -04:00
Alex Vanderveen 4aa919a06f setup wizard hardening 2026-08-07 14:06:23 -04:00
Alex Vanderveen 6a62730141 CI hardening 2026-08-07 12:57:28 -04:00
Alex Vanderveen 162a930512 codegen + bios launcher patch 2026-08-07 12:36:28 -04:00
Alex Vanderveen 11b82c23e8 toolchain patch 2026-08-07 11:29:44 -04:00
Alex Vanderveen 4cdccf58c1 multitap enhancements 2026-08-07 10:19:12 -04:00
Alex Vanderveen 33c9901497 buiild with ICE 2026-08-07 03:56:32 -04:00
Alex Vanderveen 7940137d0d bump setup script 2026-08-07 03:42:37 -04:00
Alex Vanderveen 03a187374c GH & CI patch automation 2026-08-07 03:25:11 -04:00
Alex Vanderveen bea16e3ad2 -DPSXRECOMP_ALLOW_NO_BIOS=ON 2026-08-07 03:24:34 -04:00
Alex Vanderveen 09d94214af GH reorder 2026-08-07 03:08:40 -04:00
Alex Vanderveen a79619462e update script 2026-08-07 02:04:55 -04:00
Alex Vanderveen 480fcad652 new build wizard 2026-08-07 01:43:04 -04:00
Alex Vanderveen 94cb3807a9 Merge origin/master into integrate/game-codegen-hooks-into-rollback
Keep rollback/netplay multiplayer routing, dual-raster GL present, and TOC
fingerprints while taking master's CHD support, mod load acceleration,
adaptive widescreen, and geometry/perspective APIs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 22:50:38 -04:00
Alex Vanderveen 9b72328afa SFU preferred 2026-08-06 22:08:09 -04:00
Alex Vanderveen 4073e2311c rollback + fmv + connectivity 2026-08-06 20:34:50 -04:00
Alex Vanderveen 652be7ba02 rollback FMV patches and overlay 2026-08-06 00:52:14 -04:00