Commit Graph

501 Commits

Author SHA1 Message Date
boykopovar 87633fc4e8
chore(tools): move progress.py description from repo to pr 2026-09-28 18:42:44 +03:00
boykopovar 417b66323f
chore(readme): remove dup progress map info from readme 2026-09-28 18:39:17 +03:00
adriadam10 e73cd7dec3 feat(tools): report progress changes on pull requests
progress.py stores the names of implemented and pending items, can
measure another source tree with --root and prints a Markdown diff of
two runs with --compare. The Progress report workflow compares every
pull request with its base, and Progress comment posts the result as a
single comment, updated on every push and removed when progress no
longer changes. Commenting runs as a separate workflow_run so pull
requests from forks never run with write permissions.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 18:47:32 +02:00
adriadam10 3c6b0af6f7 feat(tools): add progress map for system libraries and shader instructions
tools/progress.py counts implemented prx functions and RDNA instructions
recognized by the shader recompiler, and renders treemaps, badges and an
index page. The Progress workflow deploys them to GitHub Pages on every
push to main, so nothing generated is committed to the repository.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 18:21:34 +02:00
boykopovar 9958d26f4f
Merge pull request #31 from Pouare514/idea/prx-renoir
libs: add libRenoirCore.PS5 stub prx (23 NIDs)
2026-09-27 18:12:16 +03:00
Pouare514 b6dea0b51b Renoir stubs throw with NID name for progress monitoring 2026-09-27 15:53:27 +02:00
Pouare514 a719359cd1 prx: make libRenoirCore.PS5 stubs throw NotImplemented 2026-09-27 15:49:18 +02:00
boykopovar e06dbff7d6
Merge pull request #10 from boykopovar/feat/sce-module-load
Feat/sce module load
The game can expect its modified prx from the `sce_module`/`sce_modules` folder. The relinker now converts PRX files from sce_module to `dll`/`so` format with `.guest.prx` postfix. During linking, libraries from `sce_module` are given priority. If a library from `sce_module` fails to import a symbol or contains a syscall, an exception will be thrown.

This made it possible to remove the GuestLocale formats that were customized for specific guests. Launched apps now use their own PRX files from the `sce_module` folder.
Locale handling functions now use `std::locale`.

Added a lot of posix functions to `libkernel` (they are thin wrappers and do what the existing non-posix versions do)
2026-09-27 15:47:36 +03:00
boykopovar 179841caff feat(relinker): report full module path when windows loading fails 2026-09-27 13:10:06 +03:00
Pouare514 0722f3e5fc prx: add libRenoirCore.PS5 replacement with 23 Renoir stubs for libcohtml
Minecraft Legends' libcohtml.Prospero.prx imports 23 NIDs from lib
libRenoirCore.PS5_v1 (docs/legends-unresolved-nids.json). Clear names are
unknown, so each export is exposed under its raw NID via APS5_EXPORT
alias (<NID>_nid_no_patch_cut), which nid_patcher strips to the
literal NID instead of hashing.

Stubs follow KytyPS5 UnresolvedImportStub policy (log call + return 0)
via APS5_LOG_OUT rather than throwing NotImplemented.
2026-09-27 11:57:54 +02:00
boykopovar 43d2e8b4dc fix(codegen): decode xadd byte and popcnt instruction lengths fix 2026-09-27 12:49:46 +03:00
boykopovar e3dc9a6acc fix(relinker): accept zero alignment for empty tls segments 2026-09-27 12:41:52 +03:00
boykopovar 52b683d208 fix(relinker): skip generated guest prx files during sce module scan 2026-09-27 11:43:42 +03:00
boykopovar e526f1f528 feat(libc): replace guest locale implementation with std::locale 2026-09-27 11:43:42 +03:00
boykopovar bfa1ac0751 fix(relinker): scan complete function ranges for windows tls accesses 2026-09-27 11:43:41 +03:00
boykopovar 9cc36a02fe feat(libkernel): add __progname str value 2026-09-27 11:43:40 +03:00
boykopovar f5ea673c10 feat(libkernel): impl posix stdio wrappers, reusing sceKernel file ops 2026-09-27 11:43:40 +03:00
boykopovar 7a925c68e5 fix(libkernel): handle clock_second 13 in clock_gettime and clock_getres 2026-09-27 11:43:39 +03:00
boykopovar 13c648bebb feat(libkernel): impl file, time, process, signal for posix 2026-09-27 11:43:38 +03:00
boykopovar 62c16792ff feat(libkernel): impl pthread condition variables + posix thread attribute queries 2026-09-27 11:43:37 +03:00
boykopovar a709e220f2 feat(libkernel): implement posix mutex locking and timed waits 2026-09-27 11:43:37 +03:00
boykopovar ae2e5cba7e feat(libc): implement heap trace info 2026-09-27 11:43:36 +03:00
boykopovar c9cb3cae39 feat(libkernel): implement disabled address sanitizer state + replacement tables 2026-09-27 11:43:36 +03:00
boykopovar 9fd6816356 fix(libkernel): store rtld allocator table separately from application heap 2026-09-27 11:43:35 +03:00
boykopovar dbb56adcf6 feat(libkernel): implement process, cpu, uuid, gpi, gpo, sync funcs 2026-09-27 11:43:34 +03:00
boykopovar 55e1c4a238 feat(libkernel): implement application heap and thread atexit registration 2026-09-27 11:43:33 +03:00
boykopovar 2e654e4f89 feat(relinker): scan sce modules for syscalls 2026-09-27 11:43:33 +03:00
boykopovar 630cb018c0 feat(relinker): add --skip-sce-module flag 2026-09-27 11:43:32 +03:00
boykopovar 5887c8d6e2 feat(libkernel): add memory segment, backtrace, heap error report definitions 2026-09-27 11:43:32 +03:00
boykopovar 40101471ee feat(libkernel): add new posix, pthread, semaphore, process funcs definitions 2026-09-27 11:43:31 +03:00
boykopovar 0783e369da feat(libkernel): add definitions for standard guest libc imports 2026-09-27 11:43:31 +03:00
boykopovar 337e763597 fix(relinker): support operand-size prefixes on fs:[0] access 2026-09-27 11:43:30 +03:00
boykopovar 2cc34985c0 fix(codegen): decode int imm8 instruction length correctly 2026-09-27 11:43:30 +03:00
boykopovar fa10c6d7eb fix(relinker): scan reachable code for windows guest tls accesses 2026-09-27 11:43:30 +03:00
boykopovar 6b2db1d8a8 fix(relinker): support windows guest tls relocations and accesses 2026-09-27 11:43:29 +03:00
boykopovar 0c6765e6a6 fix(relinker): ignore non-loadable SCE segments outside file bounds 2026-09-27 11:43:29 +03:00
boykopovar 1379ec001b feat(relinker): add native guest module loading with export priority 2026-09-27 11:43:28 +03:00
boykopovar fce5889d91
Merge pull request #21 from obelisk-complex/test/wire-up-exception-runtime-test
test: wire up the orphaned exception runtime test
- `core/libs/CMakeLists.txt`: registered `ExceptionRuntime.cpp` as `exception_runtime_tests`/`exception_runtime`, following the existing `Guest*.cpp` test pattern, linked against `libc`.
2026-09-27 11:39:23 +03:00
boykopovar 228802b7f5
Merge pull request #23 from obelisk-complex/test/fix-agc-driver-test-bitrot
test(agc): fix and re-enable 3 of 8 bitrotted AGC driver tests
- `agc_driver_graphics_tests`: fixed the link failure by adding the three missing source files and linking `shader_recompiler_agc_driver`. Still fails at runtime against stale assertions accumulated over many commits of not being built (an expected "not implemented" message that texture support since removed, and a sampler test fixture value that no longer fits its 12-bit field). Left `EXCLUDE_FROM_ALL`; fixing the assertions is a separate pass across the whole 1150-line test file, not a build fix.
- `agc_driver_recompiler_tests`: root-caused but not fixed. It needs `COMPUTE_NUM_THREAD_X` set, and its pass condition checks for a "not implemented" stub error that no longer exists now that the real recompiler is in. Restoring its original intent needs a shader deliberately built to fail recompilation, which is a design decision, not something this PR should decide unilaterally. Left `EXCLUDE_FROM_ALL`.
- `agc_driver_tests`, `agc_shader_memory_tests`, `agc_driver_flip_tests` and `agc_driver_pm4_tests` already passed; registered them with `add_test` so none of the four can bitrot silently again.
2026-09-27 11:34:45 +03:00
boykopovar 7894745fba
Merge pull request #15 from obelisk-complex/fix/sscanf-signedness-and-substr-copy
fix: correct sscanf %x signedness and avoid a substr copy
- `core/libs/prx/libSceSysmodule/Export.cpp`: `devMajor`/`devMinor` now `unsigned int`.
- `core/libs/nid/include/nid/NidPatcherUtils.hpp`: two `substr(0, n)` calls replaced with `resize(n)`.
2026-09-27 11:30:50 +03:00
boykopovar 0b262e9987
Merge pull request #14 from obelisk-complex/fix/linux-exception-unwind-interposition
fix(exceptions): interpose libstdc++ ABI on Linux so the project's own unwinder drives it
- `OwnPersonality()` in `Unwind.cpp` now recognises the bare `__gxx_personality_v0` wrapper on Linux too (previously Windows-only).
- `Exports.cpp` exports the real ABI names (`__cxa_throw`, `__cxa_begin_catch`/`end_catch`, `__cxa_rethrow`, `__cxa_allocate`/`free_exception`, `__cxa_call_terminate`, `__cxa_get_exception_ptr`, `__cxa_current_exception_type`, `__cxa_init_primary_exception`, the `std::terminate`/`uncaught_exception(s)` mangled names, and the core `_Unwind_*` entry points) through the existing `GCC_GLOBAL_ALIAS` assembler-alias macro rather than new C++ definitions (a plain redefinition under these names conflicts with `<cxxabi.h>`'s own declarations). This lets ELF symbol interposition make this project's own implementation win process-wide over `libgcc_s.so.1`/`libstdc++.so.6`.
- `__cxa_init_primary_exception_nid_postfix` is new: GCC 13's inline `std::make_exception_ptr` calls `__cxa_init_primary_exception`, and nothing implemented it before.
- Deliberately did not alias `__dynamic_cast`, `__cxa_pure_virtual` or `__cxa_deleted_virtual`. Nothing in `core/libs/prx` needs them rerouted, and doing so would divert every RTTI cast in libstdc++ and third-party code (SDL2, glslang) through this project's slower walker for no benefit.
2026-09-27 11:27:36 +03:00
boykopovar aa7d8b1072
Merge pull request #16 from obelisk-complex/docs/spirv-validation-is-opt-in
docs: correct SPIR-V validation claim and a stale line citation
2026-09-27 11:17:01 +03:00
owner 6e810feb50 docs: drop SPIR-V gate note from TechnicalDebt.md per maintainer feedback
Maintainer noted the opt-in-via-documented-flag SPIR-V validation gap
isn't the silent-stub category this doc tracks; the README correction
stands on its own.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-26 23:30:21 -06:00
owner f4ff3be07f test(agc): fix and re-enable 3 of 8 bitrotted AGC driver tests
These EXCLUDE_FROM_ALL targets weren't registered with add_test, so
they silently bitrotted with no CI/ctest visibility:

- agc_driver_graphics_tests: fixed a link failure (Draw.cpp, Pipeline.cpp
  and GraphicsPipelineCache.cpp were never added to the target's sources
  when the test started calling into them). Still fails at runtime against
  several stale assertions (a removed "not implemented" error message, a
  sampler fixture value that doesn't fit its bitfield) accumulated over
  many commits of not being built; left EXCLUDE_FROM_ALL pending an
  assertion-maintenance pass.
- agc_driver_recompiler_tests: root-caused (missing COMPUTE_NUM_THREAD_X
  register setup, plus a pass condition checking for a stub error message
  that no longer exists now that the real recompiler is implemented) but
  left unfixed and EXCLUDE_FROM_ALL — restoring its original intent needs
  a shader deliberately built to fail recompilation, a design decision.

agc_driver_tests, agc_shader_memory_tests, agc_driver_flip_tests and
agc_driver_pm4_tests already passed; registered them with add_test too
so none of the five can bitrot silently again.

agc_driver_bda_device_tests: dropped from this commit's scope. Upstream
PR #20 already proposes the same one-line BdaContracts.cpp fix (matching
the runtime message's "signature" text), so BdaContracts.cpp is left
untouched here to avoid duplicating that fix. The test target stays
defined (EXCLUDE_FROM_ALL, still buildable by name) but is no longer
registered with add_test until #20 or an equivalent fix lands.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-26 14:49:14 -06:00
owner d3a1b89be3 test: wire up the orphaned exception runtime test
ExceptionRuntime.cpp existed complete and working but was never
registered in CMakeLists.txt, so it never built or ran. Wired it in
following the existing Guest*.cpp test pattern.

The other three orphaned test files (PthreadStart.cpp, FileStreams.cpp,
Formatting.cpp) were left out: each has genuine bitrot against current
code (a moved header, fseek returning errno instead of throwing on an
invalid whence, and vsnprintf's expected va_list mutation) that needs a
source-level decision, not a CMake wiring fix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-26 14:36:33 -06:00
owner 156d4c5f46 docs: correct SPIR-V validation claim and a stale line citation
README stated SPIR-V is "successfully produces validated via Spirv-Tools"
unconditionally, but ANYPS5_ENABLE_SPIRV_TOOLS defaults OFF and the only
validation call is gated behind it, so this doesn't happen in a default
build. Caveated the README line and added the gap to TechnicalDebt.md's
silent-stubs list. Also fixed a stale line-number citation there (a prior
refactor moved the SpirvTargetOptions assignment block from row 219 to 212).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-26 14:13:53 -06:00
owner 63209b584f fix: correct sscanf %x signedness and avoid a substr copy
libSceSysmodule/Export.cpp parsed /proc/self/maps device major/minor
numbers into signed int with a %x format, which is undefined behaviour
per the C standard even though it happened to work on this target;
switched to unsigned int to match the format specifier.

NidPatcherUtils.hpp's StripNidPostfix built a truncated copy with
substr(0, n) where the prefix is already the string itself; resize(n)
does the same truncation without the extra allocation and copy.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-26 14:11:50 -06:00
owner d01be2b0e9 fix(exceptions): alias uncaught_exception(s) to their purpose-built wrappers
Exports.cpp aliased the real std::uncaught_exception(s) mangled names
directly to __cxa_uncaught_exception(s)_nid_postfix instead of the
existing _ZSt18uncaught_exceptionv_nid_postfix/_ZSt19uncaught_exceptionsv_nid_postfix
wrappers, leaving the latter as dead code and breaking the file's own
bare-name -> matching-nid_postfix alias pattern (caught by fleet QA
review, no functional impact since it's a raw symbol alias and both
sides return in the same register).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-26 13:39:10 -06:00
owner a4c519b262 fix(exceptions): interpose libstdc++ ABI on Linux so the project's own unwinder drives it
On native Linux these PRX shared libraries and their test executables
dynamically link real libstdc++/libgcc, so a plain throw went through the
system's __cxa_throw/_Unwind_RaiseException. That still invoked this
project's own __gxx_personality_v0_nid_postfix (the CIE's personality
pointer is a raw function address, agnostic to which unwinder is walking
the stack), but handed it libgcc's incompatible private _Unwind_Context
layout, corrupting every field Personality.cpp reads and aborting with no
exception message.

Fix: OwnPersonality() now recognises the bare __gxx_personality_v0 wrapper
on Linux too (previously Windows-only), and Exports.cpp exports the real
ABI names (__cxa_throw, __cxa_begin_catch/end_catch, __cxa_rethrow,
__cxa_allocate/free_exception, __cxa_call_terminate, __cxa_get_exception_ptr,
__cxa_current_exception_type, __cxa_init_primary_exception, the std::
terminate/uncaught_exception(s) mangled names, and the core _Unwind_*
entry points) via the existing GCC_GLOBAL_ALIAS assembler-alias mechanism,
so ELF symbol interposition makes this project's own implementation win
process-wide over libgcc_s.so.1/libstdc++.so.6. __cxa_init_primary_exception
is newly implemented; GCC 13's inline std::make_exception_ptr needs it and
nothing provided it before.

Fixes 7 previously-aborting tests: guest_rendering_wait, guest_buffer_reuse,
guest_shader_link, guest_system_exit_parameters, guest_once, guest_memory,
guest_search.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-26 13:39:10 -06:00
boykopovar 1a0ebbc849
Merge pull request #9 from Pacuka/feat/scertc
feat(rtc): implement libSceRtc date and tick functions
- Ticks count microseconds since 0001-01-01 00:00:00 in the proleptic Gregorian calendar, up to 9999-12-31 23:59:59.999999. `sceRtcGetTickResolution` returns 1000000.
- Validation (`sceRtcCheckValid`, `sceRtcIsLeapYear`, `sceRtcGetDayOfWeek`) returns the matching `SCE_RTC_ERROR_INVALID_*` code (`0x80B50002`–`0x80B5000E`).
- Conversions: `sceRtcGetTick`/`SetTick`, `GetTime_t`/`SetTime_t`, `GetWin32FileTime`/`SetWin32FileTime`.
- Current time: `sceRtcGetCurrentTick`, `GetCurrentClock`, `GetCurrentClockLocalTime`. `sceRtcGetCurrentNetworkTick` uses the host clock.
- UTC and local time conversion through the host time zone.
- `sceRtcFormatRFC3339` (`YYYY-MM-DDThh:mm:ss.cc` plus `Z` or `±hh:mm`) and `sceRtcParseRFC3339`.
- Tick arithmetic (`sceRtcTickAdd*`) rejects results outside the valid range with `SCE_RTC_ERROR_INVALID_VALUE`.
- New exports: `sceRtcGetDaysInMonth`, `sceRtcTickAddMonths` and `sceRtcTickAddYears`. The last two clamp the day to the end of the target month (2024-01-31 + 1 month = 2024-02-29).
2026-09-26 13:41:16 +03:00