mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 02:11:36 -04:00
e3ecd67bd4
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>