Commit Graph
6138 Commits
Author SHA1 Message Date
Morten HolmandClaude Sonnet 5.5 20e8bb09ba fix(libc): run guest exit handlers before the host exit handlers
LibcExit called std::exit, which ran the static destructors of the libraries
before the guest exit handlers. A guest handler that freed memory then locked
a destroyed std::mutex, which throws, and a noexcept guest destructor ended in
std::terminate. The guest handlers now run first, while the library objects
are alive.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-08 17:53:56 +02:00
Jan ŠléglandClaude Fable 5.1 e6a9b50512 feat(libkernel): implement the sigset functions
Add sigemptyset, sigfillset, sigaddset, sigdelset and sigismember with
FreeBSD 11 semantics (lib/libc/gen/sigsetops.c): a 128-bit set of four
32-bit words, signal n at bit n - 1, signals 1 to 128 valid. sigfillset
sets every bit. An invalid signal returns -1 with errno EINVAL and leaves
the set untouched; sigismember returns 1 or 0. A null set throws.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-08 17:45:57 +02:00
boykopovar e4c604d64e fix(shader): update linux shader cache structure size assertions 2026-10-08 18:43:06 +03:00
emirplusandClaude Opus 5.5 b4cc6d26b9 feat(relinker): support Windows guest TLS reads by ALU register-address instructions
Recognize read-direction ALU forms (add, or, adc, sbb, and, sub, xor, cmp) that read from fs:[mem] where mem has a base or index register (such as 64 48 33 03, xor rax, fs:[rbx], in #217). The stub loads the TLS value through the computed address, performs the ALU operation, and preserves scratch registers and flags.

Extend test_tls_function_coverage with execution and stub coverage cases for register-addressed ALU operations, including rax, rcx, rbx and r13 destinations, wide and 32-bit forms, and verification of register and flag preservation.

Refs #217

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 18:39:24 +03:00
Pedro a294b80d29 feat(libkernel): implement getuid, geteuid, getgid, getegid and issetugid
Part of #1578.
2026-10-08 10:39:06 -05:00
XairRrR df3aa1a9db fix(libkernel): raise the open file soft limit on Linux
Each direct memory backing keeps a memfd open, so a title such as
Dreaming Sarah (PPSA02929) holds about 1100 descriptors at startup.
With the systemd default soft limit of 1024, later opens fail with
EMFILE: memfd_create throws "create direct memory backing: Too many
open files", or the title's fopen returns NULL and it faults in fread.

libkernel now raises the RLIMIT_NOFILE soft limit to the hard limit
when it is loaded, before the title creates any descriptor, and throws
if the limit cannot be read or raised.
2026-10-08 17:38:48 +02:00
Nahuel Genchi 5115c24fc7 Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into fix-flip-compute
# Conflicts:
#	core/libs/prx/libSceAgcDriver/CMakeLists.txt
2026-10-08 12:36:13 -03:00
st44rplatinum 7894cda94d feat(libSceSystemService): implement Disable/ReenableMediaPlay 2026-10-08 18:35:19 +03:00
boykopovar 6741e90a1c fix(shader): restore prepared image compatibility and update regression fixtures 2026-10-08 18:32:12 +03:00
Morten HolmandClaude Sonnet 5.5 5333a20537 fix(agc): do not use fragment barycentric on MoltenVK
MoltenVK reports VK_KHR_fragment_shader_barycentric, but its SPIR-V to MSL step
rejects the PerVertexKHR decoration that the barycentric path uses, so every
pixel shader on that path fails to compile into a pipeline. Treat the feature
as unavailable when the driver is MoltenVK, so the no-barycentric path is used.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-08 17:31:20 +02:00
7647710248 test(audiodec): cover the raw M4AAC configuration search with a 5.1 stream
A raw 5.1 LC frame decodes as 6 channels with a maximum of 6 and of 8,
which is only reached by moving past the mono/stereo configuration. The
configuration search is listed under unknown function info, together with
a mono raw stream being reported as 2 channels.

Co-authored-by: Dextroid17 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 17:29:50 +02:00
PacukaandClaude Opus 5.5 7b722253a4 fix(audiodec): take the M4AAC raw channel layout from the stream
For a raw M4AAC stream the maximum channel count was written into the
AudioSpecificConfig as the channel configuration. The maximum only bounds
the stream: The Smurfs Dreams creates its decoder with 8 channels at most
and sends stereo, so FFmpeg refused configuration 8 (reserved) and a
stereo stream under configuration 6 or 7 decodes no frame. The decoder
now starts from the mono/stereo configuration and on the first access
unit that it cannot decode moves on to the configurations with more
channels, up to the maximum, keeping the first one that decodes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 17:29:46 +02:00
MichonandClaude Opus 5.5 fc05d1e3e3 fix(agc): a fill of a surface's DCC keys is a key fill over other images' memory
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-08 17:27:13 +02:00
boykopovar 0fa7114e93 fix(tests): correct raw buffer bounds in DCC many-buffer and interlock tests 2026-10-08 18:24:15 +03:00
boykopovar d0a62b7ba0 fix(tests): correct raw buffer bounds modes in image tests 2026-10-08 18:21:50 +03:00
boykopovar 381d12b3b4 fix(tests): correct buffer bounds modes in GDS LDS and scalar tests 2026-10-08 18:20:08 +03:00
Mohd FaourandClaude Fable 5.1 ce5a2136a8 fix(sysmodule): report a module that is not loaded as SCE_SYSMODULE_ERROR_UNLOADED
sceSysmoduleIsLoaded returned 0x80A90002 and the unload calls 0x80A90003
for a module that is not loaded. Neither value exists in the SDK: the
sysmodule facility is 0x5A and the error is 0x805A1001, which titles
compare against (GTA V PPSA04263: cmp eax,0x805a1001 after IsLoaded) to
decide whether to load and initialise the module themselves. Return that
value from all three places and cover it in guest_sysmodule.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-08 17:13:02 +02:00
boykopovar bae0aed3bf fix(driver): adapt shader preparation to updated main apis 2026-10-08 18:12:47 +03:00
ahmedhamouda78 73eb8465d6 feat(agc): write the measured sceAgcDcbResetQueue packet sequence
Replace the CLEAR_STATE approximation with the envelope and per-op-bit packet groups measured on PS5 firmware 13.60. Emit groups for op bits 0x001, 0x002, 0x004, 0x008, 0x010, 0x020, 0x080, 0x100 and 0x800 in ascending order; throw for 0x040, 0x200 and 0x400 whose packets the driver rejects. state 2 sets the envelope flag and state 3 sets the 0x004 and 0x800 group payload dword.
2026-10-08 15:10:08 +00:00
Leandro 9bae5b0879 Merge branch 'main' into fix/kernel-download0-at-start 2026-10-08 17:09:06 +02:00
boykopovar eb68ad3b02 fix(shader): preserve main buffer alignment and image formats in prepared shaders 2026-10-08 17:51:05 +03:00
Adrià 4b005b229e Merge pull request #1603 from yabanana/fix/formatting-test-registration
fix(ci): remove stale formatting test exception
2026-10-08 16:49:19 +02:00
Adrià eb2818f505 Merge pull request #1476 from awake-devel/fix/timedwait-nested-waiter
fix(libkernel): give each nested TimedWait its own waiter on Windows
2026-10-08 16:48:48 +02:00
Scott SchusterandClaude Opus 5.5 a43f1411c4 fix(libc): align guest heap allocations to 32 bytes
Clang's PS4 and PS5 targets set the default new alignment and the suitable
alignment to 32 bytes, so PS5 code may store to a fresh malloc or operator
new result with 32-byte-aligned AVX instructions. The guest heap aligned
blocks to 16 bytes, and the arena's 32-byte classes put every small block
16 bytes past a 32-byte boundary after its header, so such a store faulted.
The minimum alignment is now 32 bytes; the padding still assumes only the
16-byte alignment the raw blocks guarantee.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 09:42:06 -05:00
Scott SchusterandClaude Opus 5.5 f983f51223 fix(agc): write queued labels at a suspend point before a device exists
A suspend point flushes the labels queued since the last submission. It
recorded them only when a Vulkan device existed, and the device is created
lazily, so labels queued by a title that had not yet drawn were never
written. RADV ends each submission with a RELEASE_MEM to a marker it polls
from the CPU; when the end of that submission was folded into a following
suspend point, the marker stayed at 0 and RADV reported the device lost.
The labels are now recorded either way, which writes them from the CPU
without a device.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 09:40:37 -05:00
boykopovar 082f371758 fix(shader): correct emulated color comparison specialization 2026-10-08 17:40:12 +03:00
boykopovar 4b5a395219 fix(shader): correct msaa sample addressing and prepared test failure cleanup 2026-10-08 17:40:10 +03:00
boykopovar 6a4c5b5ded fix(shader): support non-array image views and packed unorm runtime modes 2026-10-08 17:38:11 +03:00
boykopovar e5cd1c6079 test(font): avoid deleting an open system font on windows 2026-10-08 17:37:40 +03:00
boykopovar 1b3da3a740 test(agc): update graphics binding and bda range checks 2026-10-08 17:37:40 +03:00
boykopovar c3e6727163 fix(agc): prune expired rectangle preparation links 2026-10-08 17:37:39 +03:00
boykopovar 6acf4ee0ee test(agc): isolate shader linking and interpolant preparation checks 2026-10-08 17:37:38 +03:00
boykopovar 1f8a7e0b94 test(shader): align specialization checks with runtime abi 2026-10-08 17:37:37 +03:00
boykopovar 19ede29259 test(agc): fix mrt export index and vertex fetch abi checks 2026-10-08 17:37:36 +03:00
boykopovar 8c4e0b1524 fix(shader): propagate binding plan initialization failures outside call_once 2026-10-08 17:37:35 +03:00
boykopovar 6c858dab2c fix(shader): validate unsupported sRGB sampling and SINT d16 writes at materialization 2026-10-08 17:37:35 +03:00
boykopovar 6ac7fbc5a4 fix(agc): stop profile writer before DLL teardown 2026-10-08 17:37:34 +03:00
boykopovar 416e284a31 fix(tests): align prepared shader checks with raw compute caching 2026-10-08 17:37:33 +03:00
boykopovar 92fcdbb1f7 fix(tests): correct buffer OOB modes in image and BVH tests 2026-10-08 17:37:33 +03:00
boykopovar fa2df2e2ff fix(tests): correct buffer descriptors in memory and wave execution tests 2026-10-08 17:37:32 +03:00
boykopovar 49f36309bf fix(tests): correct buffer OOB modes in half, FMA and packed arithmetic tests 2026-10-08 17:37:31 +03:00
boykopovar 9e7aad07c8 fix(tests): correct buffer OOB modes in F32, F64 and division tests 2026-10-08 17:37:30 +03:00
boykopovar 972122bcef fix(tests): correct buffer OOB modes in VOP and SDWA tests 2026-10-08 17:37:29 +03:00
boykopovar d2c6546124 fix(tests): correct buffer OOB modes in DPP, DS, LDS and scalar tests 2026-10-08 17:37:28 +03:00
boykopovar 0cd9650100 fix(shader): initialize null pixel shader registration state 2026-10-08 17:37:27 +03:00
boykopovar 2d93308780 fix(shader): preserve main behavior in cached specialization 2026-10-08 17:37:25 +03:00
Adrià 29e533aca0 Merge pull request #1469 from arvindfroi/refactor/coredump-stopinfo-gpu-name
refactor(libkernel): name the Jrs7UUkGOFo Coredump stub by its NID
2026-10-08 16:37:04 +02:00
boykopovar 7fc7372274 perf(shader): cache registered state + reduce preparation transaction overhead 2026-10-08 17:37:03 +03:00
Adrià 700c0babc6 Merge pull request #1468 from arvindfroi/refactor/ajm-wvorbis-names
refactor(libSceAjm.native): name the WVorbis stubs by their NIDs
2026-10-08 16:36:34 +02:00
boykopovar 2441bd265d perf(log): write frame timings async to a buffered file 2026-10-08 17:29:49 +03:00