feat(tools): add a graphical launcher #3786

Closed
Techx3 wants to merge 9 commits from upstream-pr/3786 into main
Techx3 commented 2026-10-11 16:42:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Techx3 on 2026-10-11T16:42:24Z.


tools/launcher/anyps5_launcher.py is a Tkinter front end (Python standard library only) that lists the games in a folder, converts each one with the relinker on first run (decrypted ELF dumps only; a SELF is rejected with a message; hard-linking the game files into app0/ and copying the built .prx libraries), caches the result by a fingerprint of its inputs and runs it with the output in a log pane. It can also build AnyPS5 (submodules, configure, build, libs) and start another emulator on the selected game. Usage is documented in docs/user/USAGE.md.

Claude-Session: https://claude.ai/code/session_017Dqgm9nUKygsXzr6poJsHJ

What

An optional graphical front end, tools/launcher/anyps5_launcher.py (Python 3.8+, standard library and Tkinter only), documented in docs/user/USAGE.md:

  • Lists the games in a folder (name, title ID and icon from sce_sys/).
  • Play converts a game on the first run (takes decrypted ELF dumps only and rejects a SELF with a message; runs relinker [--windows] <eboot.elf> app.exe, hard-links the game files into app0/, copies the built .prx libraries and, on Windows, the MinGW runtime DLLs), caches it by a fingerprint of its inputs and runs it with the output in a log pane and last_run.log.
  • Build AnyPS5 (submodules, configure, build, libs), Reconvert, Run with emulator (command template with {elf}, {dir}, {id}), and an optional env.txt for APS5_* switches.

It does not change AnyPS5 itself; game folders are never modified.

Tested

Windows 11 with PPSA15552 (Dead Cells) and Dreaming Sarah: listing, conversion, cached reruns, library refresh after rebuilds, env.txt. Linux: scanning and status on a sample folder.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes (Claude)

Thanks for the reviews and the Windows run. Changes since:

Review (@adriadam10)

  • Docstrings removed.
  • build() no longer touches Tk from the worker: it posts a refresh message that poll() handles on the Tk thread.
  • Tests: tools/tests/test_launcher.py, registered in ctest (launcher), covering scan_games (param.json, nested folders, SELF detection), extra_module_dirs/module_dirs, fingerprint, stage_source, build_compiler/mingw_dirs and emulator_command.

SELF (@oneandonlydean)

  • unself and its calls are gone; the launcher takes decrypted ELF dumps only and rejects a SELF executable or module with a message.

Windows run (@tezzgod74)

  1. MinGW DLLs: looked up next to the compiler in build/CMakeCache.txt, then PATH; a missing DLL now fails the run with a message instead of a warning and 0xC0000135.
  2. tools/launcher/config.json is ignored explicitly.
  3. unself dropped (above).
  4. download0/: the launcher does not create it.
  5. The cache is keyed by title ID plus a hash of the game folder, so two copies of a title no longer share one cache folder.

Also new: folders outside sce_module/ that hold .prx modules (Unity Media/Modules, Media/Plugins) are passed with --module-dir.

Docs updated in docs/user/USAGE.md. Rebased on current main; conventions check and test_launcher.py pass.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4820642714 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3786). Originally posted by [Techx3](https://github.com/Techx3) on 2026-10-11T16:42:24Z. --- tools/launcher/anyps5_launcher.py is a Tkinter front end (Python standard library only) that lists the games in a folder, converts each one with the relinker on first run (decrypted ELF dumps only; a SELF is rejected with a message; hard-linking the game files into app0/ and copying the built .prx libraries), caches the result by a fingerprint of its inputs and runs it with the output in a log pane. It can also build AnyPS5 (submodules, configure, build, libs) and start another emulator on the selected game. Usage is documented in docs/user/USAGE.md. Claude-Session: https://claude.ai/code/session_017Dqgm9nUKygsXzr6poJsHJ ### What An optional graphical front end, `tools/launcher/anyps5_launcher.py` (Python 3.8+, standard library and Tkinter only), documented in `docs/user/USAGE.md`: - Lists the games in a folder (name, title ID and icon from `sce_sys/`). - **Play** converts a game on the first run (takes decrypted ELF dumps only and rejects a SELF with a message; runs `relinker [--windows] <eboot.elf> app.exe`, hard-links the game files into `app0/`, copies the built `.prx` libraries and, on Windows, the MinGW runtime DLLs), caches it by a fingerprint of its inputs and runs it with the output in a log pane and `last_run.log`. - **Build AnyPS5** (submodules, configure, build, `libs`), **Reconvert**, **Run with emulator** (command template with `{elf}`, `{dir}`, `{id}`), and an optional `env.txt` for `APS5_*` switches. It does not change AnyPS5 itself; game folders are never modified. ### Tested Windows 11 with PPSA15552 (Dead Cells) and Dreaming Sarah: listing, conversion, cached reruns, library refresh after rebuilds, `env.txt`. Linux: scanning and status on a sample folder. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes (Claude) Thanks for the reviews and the Windows run. Changes since: **Review (@adriadam10)** - Docstrings removed. - `build()` no longer touches Tk from the worker: it posts a `refresh` message that `poll()` handles on the Tk thread. - Tests: `tools/tests/test_launcher.py`, registered in ctest (`launcher`), covering `scan_games` (param.json, nested folders, SELF detection), `extra_module_dirs`/`module_dirs`, `fingerprint`, `stage_source`, `build_compiler`/`mingw_dirs` and `emulator_command`. **SELF (@oneandonlydean)** - `unself` and its calls are gone; the launcher takes decrypted ELF dumps only and rejects a SELF executable or module with a message. **Windows run (@tezzgod74)** 1. MinGW DLLs: looked up next to the compiler in `build/CMakeCache.txt`, then `PATH`; a missing DLL now fails the run with a message instead of a warning and `0xC0000135`. 2. `tools/launcher/config.json` is ignored explicitly. 3. `unself` dropped (above). 4. `download0/`: the launcher does not create it. 5. The cache is keyed by title ID plus a hash of the game folder, so two copies of a title no longer share one cache folder. Also new: folders outside `sce_module/` that hold `.prx` modules (Unity `Media/Modules`, `Media/Plugins`) are passed with `--module-dir`. Docs updated in `docs/user/USAGE.md`. Rebased on current main; conventions check and `test_launcher.py` pass.
adriadam10 commented 2026-10-11 16:49:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T16:49:13Z.

Review: CHANGES_REQUESTED


Thanks for this. I checked that scan_games finds the title/ID on a real dump, that unself yields an ELF the relinker accepts (it rejects the raw SELF), and that the output layout matches docs/user/USAGE.md. Three things to fix:

  • No code comments (CONTRIBUTING / CONVENTIONS): the docstrings at tools/launcher/anyps5_launcher.py lines 2-3, 195, 230 and 275-276 count; please remove them (the checklist item is ticked).
  • Tk is used from a worker thread: build() runs self.refresh() inside the worker (line 598), and refresh() calls self.dir_var.get() and writes the config (lines 513-514). Run the refresh from the Tk thread (e.g. post a message to the queue and handle it in poll).
  • Tests: unself, scan_games, fingerprint and emulator_command are pure functions with no coverage, and unself parses a binary format. Please add a Python test next to the tool (registered in ctest, see tools/check_test_registration.py) with a small synthetic SELF (valid, encrypted segment, compressed segment, bad program header index) and a game folder with param.json.

Windows conversion and running can't be exercised on our side; please attach a last_run.log or a console log of a Windows run so it is on record.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5484114477 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3786#pullrequestreview-5484114477). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T16:49:13Z. **Review:** CHANGES_REQUESTED --- Thanks for this. I checked that `scan_games` finds the title/ID on a real dump, that `unself` yields an ELF the relinker accepts (it rejects the raw SELF), and that the output layout matches `docs/user/USAGE.md`. Three things to fix: - No code comments (CONTRIBUTING / CONVENTIONS): the docstrings at `tools/launcher/anyps5_launcher.py` lines 2-3, 195, 230 and 275-276 count; please remove them (the checklist item is ticked). - Tk is used from a worker thread: `build()` runs `self.refresh()` inside the worker (line 598), and `refresh()` calls `self.dir_var.get()` and writes the config (lines 513-514). Run the refresh from the Tk thread (e.g. post a message to the queue and handle it in `poll`). - Tests: `unself`, `scan_games`, `fingerprint` and `emulator_command` are pure functions with no coverage, and `unself` parses a binary format. Please add a Python test next to the tool (registered in ctest, see `tools/check_test_registration.py`) with a small synthetic SELF (valid, encrypted segment, compressed segment, bad program header index) and a game folder with `param.json`. Windows conversion and running can't be exercised on our side; please attach a `last_run.log` or a console log of a Windows run so it is on record.
oneandonlydean commented 2026-10-11 23:16:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:16:53Z.


Please drop the SELF extraction: unself (tools/launcher/anyps5_launcher.py:194-227) and its two calls in stage_source (lines 236, 251). The owner turned that down on #173 ("such tools already exist"), so the launcher should take ELF dumps only and reject a SELF with a message. That also removes the synthetic-SELF test asked for above; the other points stand.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6115004331 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3786#issuecomment-6115004331). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-11T23:16:53Z. --- Please drop the SELF extraction: `unself` (`tools/launcher/anyps5_launcher.py:194-227`) and its two calls in `stage_source` (lines 236, 251). The owner turned that down on #173 ("such tools already exist"), so the launcher should take ELF dumps only and reject a SELF with a message. That also removes the synthetic-SELF test asked for above; the other points stand.
tezzgod74 commented 2026-10-12 05:54:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tezzgod74 on 2026-10-12T05:54:50Z.


Windows run, as asked above. Windows 11 Pro 10.0.26300, MinGW-w64 GCC 15.2.0 (WinLibs r7), Python 3.13, main b42ef24e0 built with -DANYPS5_ENABLE_SPIRV_TOOLS=ON, this PR at e95e9581. Title: DOOM Shareware homebrew (lowbit/ps5-doom v1.1.1, PPSA99666), the release folder as extracted (SELF eboot.bin, fSELF sce_module/libc.prx). I drove the launcher's own functions (scan_games, game_status, ensure_converted, launch) from a script rather than clicking the Tk window, with the cache outside the repository.

Step Result
scan_games finds the title, name and ID from param.json
ensure_converted, first run extracts both SELFs, relinks (171 imports, libc.prx as a guest module), lays out app0/ and libs/: 1.0 s
launch, WinLibs not on PATH the three MinGW DLLs are only warned about; the game exits with 0xC0000135 and last_run.log holds GetLastError: 126 - The specified module could not be found.
launch, WinLibs on PATH "Already converted", DLLs copied; DOOM reaches its init (WAD, audio at 48000 Hz, swapchain, Xbox One controller) on both the RX 9060 XT (RDNA 4, 32.0.31041.1004) and the Ryzen 9 7950X iGPU (RDNA 2, 32.0.21045.5002) with ANYPS5_GPU. I stopped each after 40 s.

The same title converted by hand plays on both GPUs (menus, a new game, E1M1), see #4312.

Points from the run:

  1. MinGW DLLs on Windows. sync_libs looks for them next to shutil.which("g++"). When WinLibs is on PATH only in the shell used for the build (here) and not in the launcher's environment, Play fails as above. build/CMakeCache.txt already records the full path (CMAKE_CXX_COMPILER:STRING=F:/.../mingw64/bin/g++.exe); reading it, or failing the conversion with a clear message instead of a warning, would avoid the silent 0xC0000135.
  2. config.json is not ignored. save_config writes tools/launcher/config.json, but .gitignore lists only cache/, env.txt and __pycache__/, so the first Browse or Settings leaves an untracked file in the repository.
  3. unself (for the record, since it is to be dropped). Its ELF differs from one where PT_SCE_VERSION is taken from the container's tail only inside that segment (0xef528-0xef795 in eboot.elf), which it leaves as zeros. DOOM runs with either.
  4. download0/ doesn't need to be created by the launcher: DOOM created it on the first run.
  5. The cache is keyed by title ID, so two copies of one title (e.g. two versions) share cache/<title id>/ and reconvert over each other.
last_run.log (iGPU run, 89 lines)
[time] scheduler tick raised to 0.5 ms (was 0.50 ms, now 0.50 ms, timed waits fine)
Transferring control to ELF entry point
[src/Open.cpp:219 sceKernelOpen] path=/download0/doom.log flags=0x601 nativeFlags=0x8301 mode=0644
[src/Thread.cpp:385 RunThread] RunThread entry=0x7ff79470f530 arg=0000000000000004 self=0000000000aec690
[debug:0] ps5: user 268435456
[src/Open.cpp:219 sceKernelOpen] path=/app0/test.cfg flags=0x0 nativeFlags=0x8000 mode=01
[debug:0] pad: open
[src/Open.cpp:219 sceKernelOpen] path=/app0/wads flags=0x20000 nativeFlags=0x8000 mode=00
[src/Open.cpp:219 sceKernelOpen] path=/app0/wads/doom1.wad flags=0x0 nativeFlags=0x8000 mode=0165060
[src/Open.cpp:219 sceKernelOpen] path=/download0 flags=0x20000 nativeFlags=0x8000 mode=00
[src/Open.cpp:219 sceKernelOpen] path=/app0/wads/doom1.wad flags=0x0 nativeFlags=0x8000 mode=00
[src/VulkanDevice.cpp:876 VulkanDevice] VulkanDevice constructor window=000000000633fac0
[src/VulkanDevice.cpp:885 VulkanDevice] Vulkan loader loaded library=00007fffd3930000
[src/VulkanDevice.cpp:901 VulkanDevice] Presentation window context=0000000000bb9060 extent=1920x1080 extensions=2
[src/VulkanDevice.cpp:919 VulkanDevice] Vulkan instance created instance=00000000064aca30
[src/VulkanDevice.cpp:924 VulkanDevice] Vulkan surface created surface=00000000034b40e0 window=0000000000bb9060
[src/VulkanDevice.cpp:930 VulkanDevice] Physical device count=2
[src/VulkanDevice.cpp:963 VulkanDevice] Physical device candidate=00000000034bd8b0 name=AMD Radeon RX 9060 XT api=0x40415d type=2
[src/VulkanDevice.cpp:963 VulkanDevice] Physical device candidate=00000000034bda30 name=AMD Radeon(TM) Graphics api=0x40413b type=1
[src/VulkanDevice.cpp:1010 VulkanDevice] Physical device selected physical=00000000034bda30 queueFamily=0
[src/VulkanDevice.cpp:1023 VulkanDevice] Selected GPU name=AMD Radeon(TM) Graphics vendor=0x1002 device=0x164e subgroup=64
[src/VulkanDevice.cpp:1025 VulkanDevice] Memory heap 0 size=16166.6 MiB flags=0x0
[src/VulkanDevice.cpp:1025 VulkanDevice] Memory heap 1 size=32333.2 MiB flags=0x3
[src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 0 heap=1 flags=0x1
[src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 1 heap=0 flags=0x6
[src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 2 heap=1 flags=0x7
[src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 3 heap=0 flags=0xe
[src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 4 heap=1 flags=0xc1
[src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 5 heap=0 flags=0xc6
[src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 6 heap=1 flags=0xc7
[src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 7 heap=0 flags=0xce
[src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 8 heap=1 flags=0x1
[src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 9 heap=0 flags=0x6
[src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 10 heap=1 flags=0x7
[src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 11 heap=0 flags=0xe
[src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 12 heap=1 flags=0xc1
[src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 13 heap=0 flags=0xc6
[src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 14 heap=1 flags=0xc7
[src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 15 heap=0 flags=0xce
[src/VulkanDevice.cpp:1083 VulkanDevice] Shader clock driver=1 narrowSubgroupClock=0
[src/VulkanDevice.cpp:1312 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=0 depthClip=1 depthRangeUnrestricted=1 pipelineLibrary=1
[src/VulkanDevice.cpp:1495 VulkanDevice] Wave32 programs run on subgroups of 32: compute 1, mesh 0
[src/VulkanDevice.cpp:1543 VulkanDevice] Vulkan device ready device=00000000035340e0 queue=000000000350b6b0 family=0
[write-watch] Windows direct host imports use comparisons; separate shared aliases retain guest write tracking
[src/VulkanDevice.cpp:1581 VulkanDevice] Surface capabilities drawable=1536x864 min=1536x864 max=1536x864 minImages=2 maxImages=16 usage=0x9f
[src/VulkanDevice.cpp:1618 VulkanDevice] Swapchain created swapchain=00000000544be7c0 extent=1536x864 images=2
[src/PadInput.cpp:50 openController] Pad: connected game controller: Xbox One Controller (type 2, sensors accel=0 gyro=0, touchpads=0, led=0, trigger rumble=0)
[debug:0] gpu: AGC ready, kernel at 0x202a81800
[debug:0] video: AGC compute presentation
[src/Open.cpp:219 sceKernelOpen] path=/app0/wads/.write-test flags=0x601 nativeFlags=0x8301 mode=0644
[debug:0] launcher: imports go to /app0/wads
[Shaders/ShaderRegistry.cpp:368 ReportPreparedAtUse] Compute shader 0x202a81800 was not registered; preparing its artifact at dispatch
[shader-disk-cache] F:\aiprograms\ps5-games\launcher-cache\PPSA99666\shader_cache\be6153bf821e8fca (source version be6153bf821e8fca, format 27)
[debug:0] launcher: starting DOOM SHAREWARE: EPISODE 1 from /app0/wads/doom1.wad
[debug:0]                             DOOM Shareware Startup v1.10                           
[debug:0] V_Init: allocate screens.
[debug:0] M_LoadDefaults: Load system defaults.
[debug:0] Z_Init: Init zone memory allocation daemon. [debug:0] 
[debug:0] W_Init: Init WADfiles.[src/Open.cpp:219 sceKernelOpen] path=/app0/wads/doom1.wad flags=0x0 nativeFlags=0x8000 mode=00
[debug:0] 
[debug:0]  adding /app0/wads/doom1.wad[debug:0] 
[debug:0] ===========================================================================
[debug:0]                                 Shareware!
[debug:0] ===========================================================================
[debug:0] M_Init: Init miscellaneous info.
[debug:0] R_Init: Init DOOM refresh daemon - [debug:0] [                   ]..[debug:0] 
[debug:0] InitTexture[debug:0] s
[debug:0] InitFlats.[debug:0] .[debug:0] .[debug:0] .[debug:0] .[debug:0] .[debug:0] .[debug:0] .[debug:0] 
[debug:0] InitSprites[debug:0] 
[debug:0] InitColormaps
[debug:0] R_InitData
[debug:0] R_InitPointToAngle
[debug:0] R_InitTables
[debug:0] R_InitPlanes
[debug:0] R_InitLightTables
[debug:0] R_InitSkyMap
[debug:0] R_InitTranslationsTables
[debug:0] P_Init: Init Playloop state.
[debug:0] I_Init: Setting up machine state.
[debug:0] audio: output open at 48000 Hz
[src/Thread.cpp:385 RunThread] RunThread entry=0x7ff79470d6f0 arg=0000000000000000 self=0000000000aebd90
[debug:0] D_CheckNetGame: Checking network game status.
[debug:0] startskill 2  deathmatch: 0  startmap: 1  startepisode: 1
[debug:0] player 1 of 1 (1 nodes)
[debug:0] S_Init: Setting up sound.
[debug:0] S_Init: default sfx volume 8
[debug:0] HU_Init: Setting up heads up display.
[debug:0] ST_Init: Init status bar.
[shader-disk-cache] (10 s): 0 hits, 1 misses, 1 writes (0.1 MiB), 0 load failures, 0 write failures; 0.0 MiB read in 0.1 ms (totals: 0 hits, 1 misses, 1 writes)

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6118606203 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3786#issuecomment-6118606203). Originally posted by [tezzgod74](https://github.com/tezzgod74) on 2026-10-12T05:54:50Z. --- Windows run, as asked above. Windows 11 Pro 10.0.26300, MinGW-w64 GCC 15.2.0 (WinLibs r7), Python 3.13, `main` b42ef24e0 built with `-DANYPS5_ENABLE_SPIRV_TOOLS=ON`, this PR at e95e9581. Title: DOOM Shareware homebrew (lowbit/ps5-doom v1.1.1, PPSA99666), the release folder as extracted (SELF `eboot.bin`, fSELF `sce_module/libc.prx`). I drove the launcher's own functions (`scan_games`, `game_status`, `ensure_converted`, `launch`) from a script rather than clicking the Tk window, with the cache outside the repository. | Step | Result | |---|---| | `scan_games` | finds the title, name and ID from `param.json` | | `ensure_converted`, first run | extracts both SELFs, relinks (171 imports, `libc.prx` as a guest module), lays out `app0/` and `libs/`: 1.0 s | | `launch`, WinLibs **not** on `PATH` | the three MinGW DLLs are only warned about; the game exits with `0xC0000135` and `last_run.log` holds `GetLastError: 126 - The specified module could not be found.` | | `launch`, WinLibs on `PATH` | "Already converted", DLLs copied; DOOM reaches its init (WAD, audio at 48000 Hz, swapchain, Xbox One controller) on both the RX 9060 XT (RDNA 4, 32.0.31041.1004) and the Ryzen 9 7950X iGPU (RDNA 2, 32.0.21045.5002) with `ANYPS5_GPU`. I stopped each after 40 s. | The same title converted by hand plays on both GPUs (menus, a new game, E1M1), see #4312. Points from the run: 1. **MinGW DLLs on Windows.** `sync_libs` looks for them next to `shutil.which("g++")`. When WinLibs is on `PATH` only in the shell used for the build (here) and not in the launcher's environment, Play fails as above. `build/CMakeCache.txt` already records the full path (`CMAKE_CXX_COMPILER:STRING=F:/.../mingw64/bin/g++.exe`); reading it, or failing the conversion with a clear message instead of a warning, would avoid the silent `0xC0000135`. 2. **`config.json` is not ignored.** `save_config` writes `tools/launcher/config.json`, but `.gitignore` lists only `cache/`, `env.txt` and `__pycache__/`, so the first Browse or Settings leaves an untracked file in the repository. 3. **`unself` (for the record, since it is to be dropped).** Its ELF differs from one where `PT_SCE_VERSION` is taken from the container's tail only inside that segment (`0xef528`-`0xef795` in `eboot.elf`), which it leaves as zeros. DOOM runs with either. 4. `download0/` doesn't need to be created by the launcher: DOOM created it on the first run. 5. The cache is keyed by title ID, so two copies of one title (e.g. two versions) share `cache/<title id>/` and reconvert over each other. <details><summary><code>last_run.log</code> (iGPU run, 89 lines)</summary> ``` [time] scheduler tick raised to 0.5 ms (was 0.50 ms, now 0.50 ms, timed waits fine) Transferring control to ELF entry point [src/Open.cpp:219 sceKernelOpen] path=/download0/doom.log flags=0x601 nativeFlags=0x8301 mode=0644 [src/Thread.cpp:385 RunThread] RunThread entry=0x7ff79470f530 arg=0000000000000004 self=0000000000aec690 [debug:0] ps5: user 268435456 [src/Open.cpp:219 sceKernelOpen] path=/app0/test.cfg flags=0x0 nativeFlags=0x8000 mode=01 [debug:0] pad: open [src/Open.cpp:219 sceKernelOpen] path=/app0/wads flags=0x20000 nativeFlags=0x8000 mode=00 [src/Open.cpp:219 sceKernelOpen] path=/app0/wads/doom1.wad flags=0x0 nativeFlags=0x8000 mode=0165060 [src/Open.cpp:219 sceKernelOpen] path=/download0 flags=0x20000 nativeFlags=0x8000 mode=00 [src/Open.cpp:219 sceKernelOpen] path=/app0/wads/doom1.wad flags=0x0 nativeFlags=0x8000 mode=00 [src/VulkanDevice.cpp:876 VulkanDevice] VulkanDevice constructor window=000000000633fac0 [src/VulkanDevice.cpp:885 VulkanDevice] Vulkan loader loaded library=00007fffd3930000 [src/VulkanDevice.cpp:901 VulkanDevice] Presentation window context=0000000000bb9060 extent=1920x1080 extensions=2 [src/VulkanDevice.cpp:919 VulkanDevice] Vulkan instance created instance=00000000064aca30 [src/VulkanDevice.cpp:924 VulkanDevice] Vulkan surface created surface=00000000034b40e0 window=0000000000bb9060 [src/VulkanDevice.cpp:930 VulkanDevice] Physical device count=2 [src/VulkanDevice.cpp:963 VulkanDevice] Physical device candidate=00000000034bd8b0 name=AMD Radeon RX 9060 XT api=0x40415d type=2 [src/VulkanDevice.cpp:963 VulkanDevice] Physical device candidate=00000000034bda30 name=AMD Radeon(TM) Graphics api=0x40413b type=1 [src/VulkanDevice.cpp:1010 VulkanDevice] Physical device selected physical=00000000034bda30 queueFamily=0 [src/VulkanDevice.cpp:1023 VulkanDevice] Selected GPU name=AMD Radeon(TM) Graphics vendor=0x1002 device=0x164e subgroup=64 [src/VulkanDevice.cpp:1025 VulkanDevice] Memory heap 0 size=16166.6 MiB flags=0x0 [src/VulkanDevice.cpp:1025 VulkanDevice] Memory heap 1 size=32333.2 MiB flags=0x3 [src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 0 heap=1 flags=0x1 [src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 1 heap=0 flags=0x6 [src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 2 heap=1 flags=0x7 [src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 3 heap=0 flags=0xe [src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 4 heap=1 flags=0xc1 [src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 5 heap=0 flags=0xc6 [src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 6 heap=1 flags=0xc7 [src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 7 heap=0 flags=0xce [src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 8 heap=1 flags=0x1 [src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 9 heap=0 flags=0x6 [src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 10 heap=1 flags=0x7 [src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 11 heap=0 flags=0xe [src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 12 heap=1 flags=0xc1 [src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 13 heap=0 flags=0xc6 [src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 14 heap=1 flags=0xc7 [src/VulkanDevice.cpp:1026 VulkanDevice] Memory type 15 heap=0 flags=0xce [src/VulkanDevice.cpp:1083 VulkanDevice] Shader clock driver=1 narrowSubgroupClock=0 [src/VulkanDevice.cpp:1312 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=0 depthClip=1 depthRangeUnrestricted=1 pipelineLibrary=1 [src/VulkanDevice.cpp:1495 VulkanDevice] Wave32 programs run on subgroups of 32: compute 1, mesh 0 [src/VulkanDevice.cpp:1543 VulkanDevice] Vulkan device ready device=00000000035340e0 queue=000000000350b6b0 family=0 [write-watch] Windows direct host imports use comparisons; separate shared aliases retain guest write tracking [src/VulkanDevice.cpp:1581 VulkanDevice] Surface capabilities drawable=1536x864 min=1536x864 max=1536x864 minImages=2 maxImages=16 usage=0x9f [src/VulkanDevice.cpp:1618 VulkanDevice] Swapchain created swapchain=00000000544be7c0 extent=1536x864 images=2 [src/PadInput.cpp:50 openController] Pad: connected game controller: Xbox One Controller (type 2, sensors accel=0 gyro=0, touchpads=0, led=0, trigger rumble=0) [debug:0] gpu: AGC ready, kernel at 0x202a81800 [debug:0] video: AGC compute presentation [src/Open.cpp:219 sceKernelOpen] path=/app0/wads/.write-test flags=0x601 nativeFlags=0x8301 mode=0644 [debug:0] launcher: imports go to /app0/wads [Shaders/ShaderRegistry.cpp:368 ReportPreparedAtUse] Compute shader 0x202a81800 was not registered; preparing its artifact at dispatch [shader-disk-cache] F:\aiprograms\ps5-games\launcher-cache\PPSA99666\shader_cache\be6153bf821e8fca (source version be6153bf821e8fca, format 27) [debug:0] launcher: starting DOOM SHAREWARE: EPISODE 1 from /app0/wads/doom1.wad [debug:0] DOOM Shareware Startup v1.10 [debug:0] V_Init: allocate screens. [debug:0] M_LoadDefaults: Load system defaults. [debug:0] Z_Init: Init zone memory allocation daemon. [debug:0] [debug:0] W_Init: Init WADfiles.[src/Open.cpp:219 sceKernelOpen] path=/app0/wads/doom1.wad flags=0x0 nativeFlags=0x8000 mode=00 [debug:0] [debug:0] adding /app0/wads/doom1.wad[debug:0] [debug:0] =========================================================================== [debug:0] Shareware! [debug:0] =========================================================================== [debug:0] M_Init: Init miscellaneous info. [debug:0] R_Init: Init DOOM refresh daemon - [debug:0] [ ]..[debug:0] [debug:0] InitTexture[debug:0] s [debug:0] InitFlats.[debug:0] .[debug:0] .[debug:0] .[debug:0] .[debug:0] .[debug:0] .[debug:0] .[debug:0] [debug:0] InitSprites[debug:0] [debug:0] InitColormaps [debug:0] R_InitData [debug:0] R_InitPointToAngle [debug:0] R_InitTables [debug:0] R_InitPlanes [debug:0] R_InitLightTables [debug:0] R_InitSkyMap [debug:0] R_InitTranslationsTables [debug:0] P_Init: Init Playloop state. [debug:0] I_Init: Setting up machine state. [debug:0] audio: output open at 48000 Hz [src/Thread.cpp:385 RunThread] RunThread entry=0x7ff79470d6f0 arg=0000000000000000 self=0000000000aebd90 [debug:0] D_CheckNetGame: Checking network game status. [debug:0] startskill 2 deathmatch: 0 startmap: 1 startepisode: 1 [debug:0] player 1 of 1 (1 nodes) [debug:0] S_Init: Setting up sound. [debug:0] S_Init: default sfx volume 8 [debug:0] HU_Init: Setting up heads up display. [debug:0] ST_Init: Init status bar. [shader-disk-cache] (10 s): 0 hits, 1 misses, 1 writes (0.1 MiB), 0 load failures, 0 write failures; 0.0 MiB read in 0.1 ms (totals: 0 hits, 1 misses, 1 writes) ``` </details> AI-assisted: yes
Techx3 commented 2026-10-13 14:57:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Techx3 on 2026-10-13T14:57:30Z.


Windows test of the latest branch (7b75adc86), Windows 11, MinGW build from tools/mingw64, games folder with mixed dumps.

Fixes found while testing on a real library, all pushed with tests (10 launcher tests pass, check_conventions.py clean):

  • 19e273cbb / 7b75adc86: the MinGW runtime is found even when CMAKE_CXX_COMPILER is a bare g++ and pyw has no MinGW on PATH (falls back to the archiver path from CMakeCache.txt).
  • cf216374c / 045a532c4: when a folder holds a SELF eboot.bin plus a decrypted dump in a subfolder (decrypted/), the launcher uses the decrypted ELF and its sce_module/prx.
  • f37b8e44d: nested dumps are no longer passed as --module-dir (relinker exited with code 2), the conversion output is kept in convert.log, and the action bar and log stay visible when the window is small.

Result with Quake II (PPSA09477, decrypted dump): conversion succeeds, the runtime layout is staged and app.exe starts; it then stops on an unresolved libSceNpWebApi2 import, which is missing on main as well and not related to the launcher.

last_run.log
Converting Quake II (first run only)...
$ F:\APPs_IA\AnyPs5\build\core\relinker\relinker.exe --windows ...\cache\PPSA09477-3ea1c30d\src\eboot.elf ...\cache\PPSA09477-3ea1c30d\app.exe
System: Windows; unused-filter=0
sce_module/*.prx processing: enabled
NID total: 2839 -> 2839; filtered=0
Guest module: ...\app0/sce_module\libc.prx.guest.prx
Guest module: ...\app0/prx\libPlayFabMultiplayer.prx.guest.prx
Guest module: ...\app0/prx\party.prx.guest.prx
Guest module: ...\app0/sce_module\libSceNpCppWebApi.prx.guest.prx
Output file: ...\cache\PPSA09477-3ea1c30d\app.exe
Conversion done.
Running app.exe...
[time] scheduler tick raised to 0.5 ms (was 0.50 ms, now 0.50 ms, timed waits fine)
FAIL: unresolved ELF import 1OLgvahaSco from libSceNpWebApi2.prx
GetLastError: 127 - The specified procedure could not be found.
Process exited with code 3221225785.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6148453231 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3786#issuecomment-6148453231). Originally posted by [Techx3](https://github.com/Techx3) on 2026-10-13T14:57:30Z. --- Windows test of the latest branch (`7b75adc86`), Windows 11, MinGW build from `tools/mingw64`, games folder with mixed dumps. Fixes found while testing on a real library, all pushed with tests (10 launcher tests pass, `check_conventions.py` clean): - `19e273cbb` / `7b75adc86`: the MinGW runtime is found even when `CMAKE_CXX_COMPILER` is a bare `g++` and `pyw` has no MinGW on `PATH` (falls back to the archiver path from `CMakeCache.txt`). - `cf216374c` / `045a532c4`: when a folder holds a SELF `eboot.bin` plus a decrypted dump in a subfolder (`decrypted/`), the launcher uses the decrypted ELF and its `sce_module`/`prx`. - `f37b8e44d`: nested dumps are no longer passed as `--module-dir` (relinker exited with code 2), the conversion output is kept in `convert.log`, and the action bar and log stay visible when the window is small. Result with Quake II (PPSA09477, decrypted dump): conversion succeeds, the runtime layout is staged and `app.exe` starts; it then stops on an unresolved `libSceNpWebApi2` import, which is missing on `main` as well and not related to the launcher. <details><summary>last_run.log</summary> ``` Converting Quake II (first run only)... $ F:\APPs_IA\AnyPs5\build\core\relinker\relinker.exe --windows ...\cache\PPSA09477-3ea1c30d\src\eboot.elf ...\cache\PPSA09477-3ea1c30d\app.exe System: Windows; unused-filter=0 sce_module/*.prx processing: enabled NID total: 2839 -> 2839; filtered=0 Guest module: ...\app0/sce_module\libc.prx.guest.prx Guest module: ...\app0/prx\libPlayFabMultiplayer.prx.guest.prx Guest module: ...\app0/prx\party.prx.guest.prx Guest module: ...\app0/sce_module\libSceNpCppWebApi.prx.guest.prx Output file: ...\cache\PPSA09477-3ea1c30d\app.exe Conversion done. Running app.exe... [time] scheduler tick raised to 0.5 ms (was 0.50 ms, now 0.50 ms, timed waits fine) FAIL: unresolved ELF import 1OLgvahaSco from libSceNpWebApi2.prx GetLastError: 127 - The specified procedure could not be found. Process exited with code 3221225785. ``` </details> AI-assisted: yes
simonbronk commented 2026-10-15 08:11:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-15T08:11:06Z.


Small cache-invalidation fix for head 7b75adc8685edbffaa771e0d436543eaae694b8f (AI-assisted).

fingerprint() truncates st_mtime to whole seconds. If an executable, guest module or relinker is replaced with different contents of the same size within that second, its fingerprint stays equal. game_status() uses that fingerprint to choose Ready vs Outdated, so it can keep a stale conversion.

The production fix is one line: keep the available timestamp precision with st_mtime_ns. This retains the existing metadata-based cache policy; it does not detect changes that also preserve the exact timestamp.

--- a/tools/launcher/anyps5_launcher.py
+++ b/tools/launcher/anyps5_launcher.py
@@ -202,7 +202,7 @@
 
     def add(p):
         st = p.stat()
-        h.update(f"{p}|{st.st_size}|{int(st.st_mtime)}\n".encode())
+        h.update(f"{p}|{st.st_size}|{st.st_mtime_ns}\n".encode())
 
     add(game.elf)
     for m in module_dirs(game):

Regression to add to the existing LauncherTests in tools/tests/test_launcher.py:

    def test_fingerprint_tracks_same_size_subsecond_updates(self):
        for kind in ("executable", "module", "relinker"):
            with self.subTest(kind=kind):
                folder = self.game("subsecond-" + kind, modules=("libc.prx",))
                game = next(g for g in launcher.scan_games(self.root / "games") if g.path == folder)
                relinker = self.root / ("relinker-" + kind)
                write(relinker, b"relinker")
                target = {"executable": game.elf, "module": folder / "sce_module/libc.prx", "relinker": relinker}[kind]
                before_ns = 1700000000100000000
                after_ns = 1700000000900000000
                os.utime(target, ns=(before_ns, before_ns))
                before = target.stat()
                original = launcher.fingerprint(game, {"extra_args": ""}, relinker)
                contents = target.read_bytes()
                target.write_bytes(contents[:-1] + bytes([contents[-1] ^ 1]))
                os.utime(target, ns=(after_ns, after_ns))
                after = target.stat()
                self.assertEqual(before.st_size, after.st_size)
                self.assertEqual(int(before.st_mtime), int(after.st_mtime))
                self.assertNotEqual(before.st_mtime_ns, after.st_mtime_ns)
                self.assertNotEqual(original, launcher.fingerprint(game, {"extra_args": ""}, relinker))

Windows 11, CPython 3.12.14, temporary local files: unchanged production plus this regression runs 11 tests and fails all three new subcases, with no errors; the one-line change passes 11/11, no skips (0.399 s). The test explicitly verifies equal size and whole-second timestamps while the subsecond timestamps differ. Original ten tests retained.

This used exact extracted PR tool/test files. No launcher GUI/window created, converted executable launched, game/GPU/native build, CMake/CTest or current-main composition tested. No separate PR opened or push to your branch.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6187567141 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3786#issuecomment-6187567141). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-15T08:11:06Z. --- Small cache-invalidation fix for head `7b75adc8685edbffaa771e0d436543eaae694b8f` (AI-assisted). `fingerprint()` truncates `st_mtime` to whole seconds. If an executable, guest module or relinker is replaced with different contents of the same size within that second, its fingerprint stays equal. `game_status()` uses that fingerprint to choose Ready vs Outdated, so it can keep a stale conversion. The production fix is one line: keep the available timestamp precision with `st_mtime_ns`. This retains the existing metadata-based cache policy; it does not detect changes that also preserve the exact timestamp. ```diff --- a/tools/launcher/anyps5_launcher.py +++ b/tools/launcher/anyps5_launcher.py @@ -202,7 +202,7 @@ def add(p): st = p.stat() - h.update(f"{p}|{st.st_size}|{int(st.st_mtime)}\n".encode()) + h.update(f"{p}|{st.st_size}|{st.st_mtime_ns}\n".encode()) add(game.elf) for m in module_dirs(game): ``` Regression to add to the existing `LauncherTests` in `tools/tests/test_launcher.py`: ```python def test_fingerprint_tracks_same_size_subsecond_updates(self): for kind in ("executable", "module", "relinker"): with self.subTest(kind=kind): folder = self.game("subsecond-" + kind, modules=("libc.prx",)) game = next(g for g in launcher.scan_games(self.root / "games") if g.path == folder) relinker = self.root / ("relinker-" + kind) write(relinker, b"relinker") target = {"executable": game.elf, "module": folder / "sce_module/libc.prx", "relinker": relinker}[kind] before_ns = 1700000000100000000 after_ns = 1700000000900000000 os.utime(target, ns=(before_ns, before_ns)) before = target.stat() original = launcher.fingerprint(game, {"extra_args": ""}, relinker) contents = target.read_bytes() target.write_bytes(contents[:-1] + bytes([contents[-1] ^ 1])) os.utime(target, ns=(after_ns, after_ns)) after = target.stat() self.assertEqual(before.st_size, after.st_size) self.assertEqual(int(before.st_mtime), int(after.st_mtime)) self.assertNotEqual(before.st_mtime_ns, after.st_mtime_ns) self.assertNotEqual(original, launcher.fingerprint(game, {"extra_args": ""}, relinker)) ``` Windows 11, CPython 3.12.14, temporary local files: unchanged production plus this regression runs 11 tests and fails all three new subcases, with no errors; the one-line change passes 11/11, no skips (0.399 s). The test explicitly verifies equal size and whole-second timestamps while the subsecond timestamps differ. Original ten tests retained. This used exact extracted PR tool/test files. No launcher GUI/window created, converted executable launched, game/GPU/native build, CMake/CTest or current-main composition tested. No separate PR opened or push to your branch.
simonbronk commented 2026-10-15 12:16:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-15T12:16:56Z.


Another small, independent fix for head 7b75adc8685edbffaa771e0d436543eaae694b8f (AI-assisted): one non-object sce_sys/param.json aborts the entire scan_games() call. JSON such as null or [] parses successfully, then read_param() raises AttributeError on data.get. The refresh worker logs the error without posting the game list, so other valid folders are lost from that refresh too.

The two-line guard below applies the existing missing/invalid-JSON fallback (empty title ID, folder name) to non-object JSON as well:

--- a/tools/launcher/anyps5_launcher.py
+++ b/tools/launcher/anyps5_launcher.py
@@
     except (OSError, ValueError):
         return "", ""
+    if not isinstance(data, dict):
+        return "", ""
     tid = str(data.get("titleId") or data.get("title_id") or "")

Regression for the existing LauncherTests in tools/tests/test_launcher.py:

    def test_scan_handles_non_object_params(self):
        self.game("valid", title=("PPSA00001", "Game A"))
        folder = self.game("invalid")
        for value in (None, [], "title", 42, True):
            with self.subTest(value=value):
                write(folder / "sce_sys" / "param.json", json.dumps(value).encode())
                games = {g.path.name: g for g in launcher.scan_games(self.root / "games")}
                self.assertEqual(len(games), 2)
                self.assertEqual((games[folder.name].title_id, games[folder.name].name), ("", folder.name))
                self.assertEqual((games["valid"].title_id, games["valid"].name), ("PPSA00001", "Game A"))

Windows 11, CPython 3.12.14, synthetic folders and ELF headers: original ten tests plus this regression run 11 tests with five AttributeError subcase errors before the guard; with the guard, 11/11 pass, no skips (0.362 s). Each subcase rewrites the same invalid file and rescans alongside a valid title. Exact extracted PR tool/test files; tested independently of my earlier fingerprint fix. No GUI window, conversion, game/GPU, native build, CMake/CTest or current-main composition tested. No new PR or push to your branch.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191836952 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3786#issuecomment-6191836952). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-15T12:16:56Z. --- Another small, independent fix for head `7b75adc8685edbffaa771e0d436543eaae694b8f` (AI-assisted): one non-object `sce_sys/param.json` aborts the entire `scan_games()` call. JSON such as `null` or `[]` parses successfully, then `read_param()` raises `AttributeError` on `data.get`. The refresh worker logs the error without posting the game list, so other valid folders are lost from that refresh too. The two-line guard below applies the existing missing/invalid-JSON fallback (empty title ID, folder name) to non-object JSON as well: ```diff --- a/tools/launcher/anyps5_launcher.py +++ b/tools/launcher/anyps5_launcher.py @@ except (OSError, ValueError): return "", "" + if not isinstance(data, dict): + return "", "" tid = str(data.get("titleId") or data.get("title_id") or "") ``` Regression for the existing `LauncherTests` in `tools/tests/test_launcher.py`: ```python def test_scan_handles_non_object_params(self): self.game("valid", title=("PPSA00001", "Game A")) folder = self.game("invalid") for value in (None, [], "title", 42, True): with self.subTest(value=value): write(folder / "sce_sys" / "param.json", json.dumps(value).encode()) games = {g.path.name: g for g in launcher.scan_games(self.root / "games")} self.assertEqual(len(games), 2) self.assertEqual((games[folder.name].title_id, games[folder.name].name), ("", folder.name)) self.assertEqual((games["valid"].title_id, games["valid"].name), ("PPSA00001", "Game A")) ``` Windows 11, CPython 3.12.14, synthetic folders and ELF headers: original ten tests plus this regression run 11 tests with five `AttributeError` subcase errors before the guard; with the guard, 11/11 pass, no skips (0.362 s). Each subcase rewrites the same invalid file and rescans alongside a valid title. Exact extracted PR tool/test files; tested independently of my earlier fingerprint fix. No GUI window, conversion, game/GPU, native build, CMake/CTest or current-main composition tested. No new PR or push to your branch.
simonbronk commented 2026-10-15 12:21:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-15T12:21:59Z.


One-line library refresh fix for head 7b75adc8685edbffaa771e0d436543eaae694b8f (AI-assisted). sync_libs() only refreshes an existing same-sized .prx when the source mtime is newer. Selecting an older build or restoring libraries from a timestamp-preserving archive can therefore leave the previously cached implementation in use, even though the configured library directory now contains different bytes. The cached ensure_converted() path calls this function before launching.

Compare timestamps for inequality instead of ordering, preserving available precision:

-        if not d.exists() or d.stat().st_size != f.stat().st_size or d.stat().st_mtime < f.stat().st_mtime:
+        if not d.exists() or d.stat().st_size != f.stat().st_size or d.stat().st_mtime_ns != f.stat().st_mtime_ns:
             shutil.copy2(f, d)

Regression for LauncherTests (tools/tests/test_launcher.py), adding from unittest.mock import patch to the imports:

    def test_sync_libs_refreshes_same_size_rollback(self):
        for source_time, cached_time in ((100, 200), (200, 100)):
            with self.subTest(source_time=source_time):
                out = self.root / ("cache-" + str(source_time))
                source = self.root / "built" / "libSceExample.prx"
                cached = out / "libs" / source.name
                write(source, b"selected")
                write(cached, b"previous")
                os.utime(source, (source_time, source_time))
                os.utime(cached, (cached_time, cached_time))
                self.assertEqual(source.stat().st_size, cached.stat().st_size)
                with patch.object(launcher, "IS_WIN", False):
                    launcher.sync_libs(out, {"libs_dir": str(source.parent)}, lambda line: None)
                self.assertEqual(cached.read_bytes(), source.read_bytes())
                self.assertEqual(cached.stat().st_mtime_ns, source.stat().st_mtime_ns)

Windows 11 / CPython 3.12.14, exact extracted PR files: original ten tests plus this regression run 11 tests; baseline fails the rollback subcase (previous remains instead of selected), while the newer-source control passes. With the one-line fix, 11/11 pass, no skips (0.341 s). Temporary synthetic files only; IS_WIN=False isolates the platform-independent PRX copy loop from MinGW DLL discovery. No native library loading, GUI, game/GPU, full build, CMake/CTest, current-main composition or combination with my previous two fixes tested. This retains metadata-based comparison: equal size and identical timestamps still do not detect content changes. MinGW DLL refresh and removal of obsolete libraries are outside this change. No new PR or push to your branch.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191928127 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3786#issuecomment-6191928127). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-15T12:21:59Z. --- One-line library refresh fix for head `7b75adc8685edbffaa771e0d436543eaae694b8f` (AI-assisted). `sync_libs()` only refreshes an existing same-sized `.prx` when the source mtime is newer. Selecting an older build or restoring libraries from a timestamp-preserving archive can therefore leave the previously cached implementation in use, even though the configured library directory now contains different bytes. The cached `ensure_converted()` path calls this function before launching. Compare timestamps for inequality instead of ordering, preserving available precision: ```diff - if not d.exists() or d.stat().st_size != f.stat().st_size or d.stat().st_mtime < f.stat().st_mtime: + if not d.exists() or d.stat().st_size != f.stat().st_size or d.stat().st_mtime_ns != f.stat().st_mtime_ns: shutil.copy2(f, d) ``` Regression for `LauncherTests` (`tools/tests/test_launcher.py`), adding `from unittest.mock import patch` to the imports: ```python def test_sync_libs_refreshes_same_size_rollback(self): for source_time, cached_time in ((100, 200), (200, 100)): with self.subTest(source_time=source_time): out = self.root / ("cache-" + str(source_time)) source = self.root / "built" / "libSceExample.prx" cached = out / "libs" / source.name write(source, b"selected") write(cached, b"previous") os.utime(source, (source_time, source_time)) os.utime(cached, (cached_time, cached_time)) self.assertEqual(source.stat().st_size, cached.stat().st_size) with patch.object(launcher, "IS_WIN", False): launcher.sync_libs(out, {"libs_dir": str(source.parent)}, lambda line: None) self.assertEqual(cached.read_bytes(), source.read_bytes()) self.assertEqual(cached.stat().st_mtime_ns, source.stat().st_mtime_ns) ``` Windows 11 / CPython 3.12.14, exact extracted PR files: original ten tests plus this regression run 11 tests; baseline fails the rollback subcase (`previous` remains instead of `selected`), while the newer-source control passes. With the one-line fix, 11/11 pass, no skips (0.341 s). Temporary synthetic files only; `IS_WIN=False` isolates the platform-independent PRX copy loop from MinGW DLL discovery. No native library loading, GUI, game/GPU, full build, CMake/CTest, current-main composition or combination with my previous two fixes tested. This retains metadata-based comparison: equal size and identical timestamps still do not detect content changes. MinGW DLL refresh and removal of obsolete libraries are outside this change. No new PR or push to your branch.
Techx3 commented 2026-10-15 16:55:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Techx3 on 2026-10-15T16:55:30Z.


One-line library refresh fix for head 7b75adc8685edbffaa771e0d436543eaae694b8f (AI-assisted). sync_libs() only refreshes an existing same-sized .prx when the source mtime is newer. Selecting an older build or restoring libraries from a timestamp-preserving archive can therefore leave the previously cached implementation in use, even though the configured library directory now contains different bytes. The cached ensure_converted() path calls this function before launching.

Compare timestamps for inequality instead of ordering, preserving available precision:

-        if not d.exists() or d.stat().st_size != f.stat().st_size or d.stat().st_mtime < f.stat().st_mtime:
+        if not d.exists() or d.stat().st_size != f.stat().st_size or d.stat().st_mtime_ns != f.stat().st_mtime_ns:
             shutil.copy2(f, d)

Regression for LauncherTests (tools/tests/test_launcher.py), adding from unittest.mock import patch to the imports:

    def test_sync_libs_refreshes_same_size_rollback(self):
        for source_time, cached_time in ((100, 200), (200, 100)):
            with self.subTest(source_time=source_time):
                out = self.root / ("cache-" + str(source_time))
                source = self.root / "built" / "libSceExample.prx"
                cached = out / "libs" / source.name
                write(source, b"selected")
                write(cached, b"previous")
                os.utime(source, (source_time, source_time))
                os.utime(cached, (cached_time, cached_time))
                self.assertEqual(source.stat().st_size, cached.stat().st_size)
                with patch.object(launcher, "IS_WIN", False):
                    launcher.sync_libs(out, {"libs_dir": str(source.parent)}, lambda line: None)
                self.assertEqual(cached.read_bytes(), source.read_bytes())
                self.assertEqual(cached.stat().st_mtime_ns, source.stat().st_mtime_ns)

Windows 11 / CPython 3.12.14, exact extracted PR files: original ten tests plus this regression run 11 tests; baseline fails the rollback subcase (previous remains instead of selected), while the newer-source control passes. With the one-line fix, 11/11 pass, no skips (0.341 s). Temporary synthetic files only; IS_WIN=False isolates the platform-independent PRX copy loop from MinGW DLL discovery. No native library loading, GUI, game/GPU, full build, CMake/CTest, current-main composition or combination with my previous two fixes tested. This retains metadata-based comparison: equal size and identical timestamps still do not detect content changes. MinGW DLL refresh and removal of obsolete libraries are outside this change. No new PR or push to your branch.

Thanks @simonbronk, all three applied with your regressions in dcea9d4c0: st_mtime_ns in fingerprint(), the non-object param.json guard in read_param(), and the inequality check in sync_libs(). Rebased on current main; 13 launcher tests and check_conventions.py pass.

@adriadam10 the three points from your review (docstrings, Tk from the worker, tests) and the Windows log are addressed above; could you take another look when you have time?

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6197551495 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3786#issuecomment-6197551495). Originally posted by [Techx3](https://github.com/Techx3) on 2026-10-15T16:55:30Z. --- > One-line library refresh fix for head `7b75adc8685edbffaa771e0d436543eaae694b8f` (AI-assisted). `sync_libs()` only refreshes an existing same-sized `.prx` when the source mtime is newer. Selecting an older build or restoring libraries from a timestamp-preserving archive can therefore leave the previously cached implementation in use, even though the configured library directory now contains different bytes. The cached `ensure_converted()` path calls this function before launching. > > Compare timestamps for inequality instead of ordering, preserving available precision: > > ```diff > - if not d.exists() or d.stat().st_size != f.stat().st_size or d.stat().st_mtime < f.stat().st_mtime: > + if not d.exists() or d.stat().st_size != f.stat().st_size or d.stat().st_mtime_ns != f.stat().st_mtime_ns: > shutil.copy2(f, d) > ``` > > Regression for `LauncherTests` (`tools/tests/test_launcher.py`), adding `from unittest.mock import patch` to the imports: > > ```python > def test_sync_libs_refreshes_same_size_rollback(self): > for source_time, cached_time in ((100, 200), (200, 100)): > with self.subTest(source_time=source_time): > out = self.root / ("cache-" + str(source_time)) > source = self.root / "built" / "libSceExample.prx" > cached = out / "libs" / source.name > write(source, b"selected") > write(cached, b"previous") > os.utime(source, (source_time, source_time)) > os.utime(cached, (cached_time, cached_time)) > self.assertEqual(source.stat().st_size, cached.stat().st_size) > with patch.object(launcher, "IS_WIN", False): > launcher.sync_libs(out, {"libs_dir": str(source.parent)}, lambda line: None) > self.assertEqual(cached.read_bytes(), source.read_bytes()) > self.assertEqual(cached.stat().st_mtime_ns, source.stat().st_mtime_ns) > ``` > > Windows 11 / CPython 3.12.14, exact extracted PR files: original ten tests plus this regression run 11 tests; baseline fails the rollback subcase (`previous` remains instead of `selected`), while the newer-source control passes. With the one-line fix, 11/11 pass, no skips (0.341 s). Temporary synthetic files only; `IS_WIN=False` isolates the platform-independent PRX copy loop from MinGW DLL discovery. No native library loading, GUI, game/GPU, full build, CMake/CTest, current-main composition or combination with my previous two fixes tested. This retains metadata-based comparison: equal size and identical timestamps still do not detect content changes. MinGW DLL refresh and removal of obsolete libraries are outside this change. No new PR or push to your branch. Thanks @simonbronk, all three applied with your regressions in `dcea9d4c0`: `st_mtime_ns` in `fingerprint()`, the non-object `param.json` guard in `read_param()`, and the inequality check in `sync_libs()`. Rebased on current `main`; 13 launcher tests and `check_conventions.py` pass. @adriadam10 the three points from your review (docstrings, Tk from the worker, tests) and the Windows log are addressed above; could you take another look when you have time? AI-assisted: yes
jotitadev commented 2026-10-19 01:37:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-19T01:37:54Z.

Review: COMMENTED


macOS host check of head dcea9d4c0 (Apple M2 Max, macOS 27.2, Xcode /usr/bin/python3 3.9.6 with Tk 8.5), relinker-only build of main b5be95ff0.

  • tools/tests/test_launcher.py: 13/13 pass on Python 3.9.6, both native arm64 and x86_64 under Rosetta.
  • On a macOS host the launcher converts without an output-format flag (IS_WIN is the only switch), so it writes a Linux ELF and cannot start it. I drove scan_games → ensure_converted → launch from a script on a synthetic game folder (the relinker's main_fixture() ELF as eboot.elf, extra_args = --skip-sce-module):
$ .../relinker --skip-sce-module .../src/eboot.elf .../app.elf
output app.elf b'\x7fELF'
launch: OSError 8 Exec format error

launch() lets that OSError escape. With extra_args = --macos --to-rosetta the same path writes a Mach-O (cf fa ed fe), so the workaround is the Settings field. The fix would be to pass --macos when sys.platform == "darwin", next to --windows (with --to-rosetta on Apple silicon, --to-intel on Intel Macs, as USAGE.md describes), and to note the default in USAGE.md. Not urgent: main's runtime libraries don't build on macOS yet, so a macOS user can't run a converted game with this launcher today anyway.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5566113752 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3786#pullrequestreview-5566113752). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-19T01:37:54Z. **Review:** COMMENTED --- macOS host check of head `dcea9d4c0` (Apple M2 Max, macOS 27.2, Xcode `/usr/bin/python3` 3.9.6 with Tk 8.5), relinker-only build of `main` `b5be95ff0`. - `tools/tests/test_launcher.py`: 13/13 pass on Python 3.9.6, both native arm64 and x86_64 under Rosetta. - On a macOS host the launcher converts without an output-format flag (`IS_WIN` is the only switch), so it writes a Linux ELF and cannot start it. I drove `scan_games` → `ensure_converted` → `launch` from a script on a synthetic game folder (the relinker's `main_fixture()` ELF as `eboot.elf`, `extra_args` = `--skip-sce-module`): ``` $ .../relinker --skip-sce-module .../src/eboot.elf .../app.elf output app.elf b'\x7fELF' launch: OSError 8 Exec format error ``` `launch()` lets that `OSError` escape. With `extra_args` = `--macos --to-rosetta` the same path writes a Mach-O (`cf fa ed fe`), so the workaround is the Settings field. The fix would be to pass `--macos` when `sys.platform == "darwin"`, next to `--windows` (with `--to-rosetta` on Apple silicon, `--to-intel` on Intel Macs, as `USAGE.md` describes), and to note the default in `USAGE.md`. Not urgent: `main`'s runtime libraries don't build on macOS yet, so a macOS user can't run a converted game with this launcher today anyway. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
tezzgod74 commented 2026-10-19 02:09:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tezzgod74 on 2026-10-19T02:09:47Z.


Re-checked dcea9d4c against the review and my earlier Windows report. Windows 11 Pro 10.0.26300, MinGW-w64 GCC 15.2.0 (WinLibs r7), Python 3.13, main 324e0e48e. The launcher's functions were driven from a script with the cache outside the repository, as before.

Review points, in the code at dcea9d4c:

Request Status
no docstrings or comments only the #! line
no Tk calls from the worker build() posts ("refresh",) and poll() runs refresh() on the Tk thread
tests registered in ctest tools/tests/test_launcher.py, 13 tests, pass
no SELF extraction (#173) a SELF eboot.bin is rejected: eboot.bin is a SELF; the launcher takes decrypted ELF dumps only.

Windows run with DOOM Shareware (lowbit/ps5-doom v1.1.1, PPSA99666), unwrapped with tools/unwrap_self.py from main, WinLibs not on PATH:

  • scan_games finds it as an ELF dump; ensure_converted relinks it (libc.prx as a guest module) and writes convert.log.
  • The three MinGW DLLs are found and copied without PATH, which resolves point 1 of my earlier report (0xC0000135 before). config.json is ignored and the cache key is the title ID plus a hash (points 2 and 5).
  • On both the Ryzen 9 7950X iGPU (RDNA 2) and the RX 9060 XT (RDNA 4), launch starts the game: it opens /app0/wads/doom1.wad, creates its swapchain and is still running when stopped after 40 s, with last_run.log written. On c4c2b3aa7 it aborted at start-up with Thread destructor callback is already registered, by hand as well as through the launcher. That was #7636, reverted by #7646, and is not the launcher's.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6258147379 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3786#issuecomment-6258147379). Originally posted by [tezzgod74](https://github.com/tezzgod74) on 2026-10-19T02:09:47Z. --- Re-checked dcea9d4c against the review and my earlier Windows report. Windows 11 Pro 10.0.26300, MinGW-w64 GCC 15.2.0 (WinLibs r7), Python 3.13, `main` 324e0e48e. The launcher's functions were driven from a script with the cache outside the repository, as before. Review points, in the code at dcea9d4c: | Request | Status | |---|---| | no docstrings or comments | only the `#!` line | | no Tk calls from the worker | `build()` posts `("refresh",)` and `poll()` runs `refresh()` on the Tk thread | | tests registered in ctest | `tools/tests/test_launcher.py`, 13 tests, pass | | no SELF extraction (#173) | a SELF `eboot.bin` is rejected: `eboot.bin is a SELF; the launcher takes decrypted ELF dumps only.` | Windows run with DOOM Shareware (lowbit/ps5-doom v1.1.1, PPSA99666), unwrapped with `tools/unwrap_self.py` from `main`, WinLibs **not** on `PATH`: - `scan_games` finds it as an ELF dump; `ensure_converted` relinks it (`libc.prx` as a guest module) and writes `convert.log`. - The three MinGW DLLs are found and copied without `PATH`, which resolves point 1 of my earlier report (`0xC0000135` before). `config.json` is ignored and the cache key is the title ID plus a hash (points 2 and 5). - On both the Ryzen 9 7950X iGPU (RDNA 2) and the RX 9060 XT (RDNA 4), `launch` starts the game: it opens `/app0/wads/doom1.wad`, creates its swapchain and is still running when stopped after 40 s, with `last_run.log` written. On c4c2b3aa7 it aborted at start-up with `Thread destructor callback is already registered`, by hand as well as through the launcher. That was #7636, reverted by #7646, and is not the launcher's. AI-assisted: yes
oneandonlydean commented 2026-10-20 15:15:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T15:15:40Z.


@adriadam10 could you take another look when you have time? We went through your three points from 10-11 against the current head dcea9d4c01, and each looks addressed to us. The launcher tests pass locally (13/13), and the cleanup path is now sanitised before rmtree. Your change request is still open, so it's yours to re-review or dismiss. Whether the project wants a graphical launcher at all is also your call.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6294258459 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3786#issuecomment-6294258459). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-20T15:15:40Z. --- @adriadam10 could you take another look when you have time? We went through your three points from 10-11 against the current head `dcea9d4c01`, and each looks addressed to us. The launcher tests pass locally (13/13), and the cleanup path is now sanitised before `rmtree`. Your change request is still open, so it's yours to re-review or dismiss. Whether the project wants a graphical launcher at all is also your call.
THEMANnt commented 2026-10-24 23:57:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-24T23:57:51Z.

Review: APPROVED


Reviewed dcea9d4c01311ffdff4046a4df2527898543e214 against a5e2a80c6bc3a460404267fe600e7e28d0664438. No actionable findings in this focused review.

Source review: Inspected the complete launcher, CMake registration and usage documentation. Checked decrypted-ELF/SELF selection, module staging, cache identity and nanosecond fingerprints, refreshed library copies, subprocess argument construction and the worker-to-Tk queue boundary. Conversion errors are reported before marking a cache ready.

Validation: Windows, Python 3.11: python -X utf8 tools/tests/test_launcher.py -v ran 13 tests: 13 passed, 0 skipped. Conventions and whitespace passed. This is a new tool, so baseline has no launcher; the grafted suite's missing-module error is an absence check, not proof of regression sensitivity. The older registration checker does not support --scripts; its unsupported-option exit is a harness limitation. The new CMake add_test entry was inspected directly. Hosted relinker jobs succeeded on Windows, Linux and macOS; full-product jobs were skipped.

Scope: Approval covers inspected Python logic and documented wiring. GUI interaction, real title conversion/play and full application builds were not exercised locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5640669217 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3786#pullrequestreview-5640669217). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-24T23:57:51Z. **Review:** APPROVED --- Reviewed `dcea9d4c01311ffdff4046a4df2527898543e214` against `a5e2a80c6bc3a460404267fe600e7e28d0664438`. No actionable findings in this focused review. **Source review:** Inspected the complete launcher, CMake registration and usage documentation. Checked decrypted-ELF/SELF selection, module staging, cache identity and nanosecond fingerprints, refreshed library copies, subprocess argument construction and the worker-to-Tk queue boundary. Conversion errors are reported before marking a cache ready. **Validation:** Windows, Python 3.11: `python -X utf8 tools/tests/test_launcher.py -v` ran 13 tests: 13 passed, 0 skipped. Conventions and whitespace passed. This is a new tool, so baseline has no launcher; the grafted suite's missing-module error is an absence check, not proof of regression sensitivity. The older registration checker does not support `--scripts`; its unsupported-option exit is a harness limitation. The new CMake add_test entry was inspected directly. Hosted relinker jobs succeeded on Windows, Linux and macOS; full-product jobs were skipped. **Scope:** Approval covers inspected Python logic and documented wiring. GUI interaction, real title conversion/play and full application builds were not exercised locally.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!3786
No description provided.