Commit Graph

1223 Commits

Author SHA1 Message Date
Adrià 097f4e2284
Merge pull request #3373 from MathiasDevelopes/codex/feat-coredump-thread-context-export
feat(libkernel): export sceCoredumpGetThreadContextInfo
2026-10-11 11:36:29 +02:00
Adrià 65d4a8b189
Merge pull request #3375 from MarcZX100/codex/libc-unlocked-streams-lockfree-1765
feat(libc): implement unlocked character I/O
2026-10-11 11:31:03 +02:00
Adrià Franch 48c9156d10 docs: remove stray blank line in the TechnicalDebt list 2026-10-11 11:28:44 +02:00
MathiasDevelopes 92303a2ee5 feat(libkernel): export sceCoredumpGetThreadContextInfo
Titles that import it now load; calling it throws like the other
coredump queries, since host crashes are not turned into guest dumps.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit e0e5fd9ffbbaffdc065d1471ce1c91b144af5f98)
(cherry picked from commit 2ac0c88fdbb9e380b6eb5a37d5f98d557940f131)
(cherry picked from commit 1279010b1bc123d3b87664ede15ec6ab2ced806a)
2026-10-11 11:28:39 +02:00
Adrià 0333ec91ed
Merge pull request #1482 from awake-devel/fix/libkernel-umtx-op
feat(libkernel): implement _umtx_op wait and wake operations
2026-10-11 11:26:12 +02:00
Adrià 09bd4aa1a3
Merge pull request #1431 from Zaid-Talib/claude/focused-turing-ivfmjn
feat(libkernel): deliver sceKernelRaiseException on Linux
2026-10-11 11:22:31 +02:00
Romans Pokrovskis 228532e9a8 fix(libc): keep unlocked stream status queries lock-free
Use unlocked POSIX EOF/error queries after unlocked byte operations so status synchronization cannot reacquire the stream lock. Keep the verified UCRT status calls on Windows, and cover byte, status, error, and held-lock behavior.

Co-authored-by: MarcZX100 <marczxrr@gmail.com>
2026-10-11 09:18:23 +00:00
Adrià e8e4dfdb36
Merge pull request #3337 from AchrafReyani/carry/export-ppsa01530-ppsa13356-imports
fix(exports): export the calls PPSA01530, PPSA23827 and PPSA13356 import
2026-10-11 11:16:45 +02:00
Adrià Franch 3879e7ed54 fix(libkernel): throw on a size-0 _umtx_op timeout that is not a valid timespec 2026-10-11 11:13:33 +02:00
Hannah Lyons 93cb3a1b0d fix(libkernel): compare the full WAIT_UINT value and throw on _umtx_op operation 1 2026-10-11 11:13:09 +02:00
clem-gb 79f90f3d9b feat(libkernel): implement _umtx_op wait and wake operations
Titles that ship their own libc.prx or Unity's PS5Util.prx import
_umtx_op (04AjkP0jO9U) for atomic waits, call_once and futex-style
waits. Implement UMTX_OP_WAIT, UMTX_OP_WAKE, UMTX_OP_WAIT_UINT,
UMTX_OP_WAIT_UINT_PRIVATE and UMTX_OP_WAKE_PRIVATE as FreeBSD 11's
kern_umtx.c does, on the sceKernelSyncOnAddressWait waiter queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HeC9bA3n74TzJRYv9AgBE8
2026-10-11 11:13:08 +02:00
Claude c356112f32 fix(libkernel): keep raises off unregistered threads and clamp the handler's MXCSR
Two defects found in review of the Linux delivery:

A raise right after scePthreadCreate reached the new thread before
RunThread set currentThread, so scePthreadSelf() in the handler adopted
a second handle, and could deadlock on glibc's thread lock when the
signal interrupted pthread_getattr_np. The creator now blocks all
signals around the std::thread construction, so the child starts with
them blocked, and RunThread restores the creator's mask once the thread
is registered, as libthr does. A raise in that window stays pending and
is delivered just before the entry runs.

A handler that set reserved MXCSR bits made rt_sigreturn fail with
SIGSEGV. The MXCSR the handler leaves is now masked with the frame's
MXCSR_MASK (0xffbf when it reads 0), as FreeBSD's fpusetregs does, on
both platforms; Windows also keeps CONTEXT.MxCsr equal to
FltSave.MxCsr.

guest_raise_exception raises right after each of 50 thread creations and
checks scePthreadSelf() in the handler, and its context round trip sets
a reserved MXCSR bit and FZ and checks that only FZ is kept.

AI-assisted: yes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwJx7AHrSUaMGSpEGhL1Kb
2026-10-11 11:12:02 +02:00
Adrià 90c152e840
Merge pull request #1333 from TibixDev/pr/descriptor-pool-recycling
perf(agc): recycle descriptor pools after their last set is released
2026-10-11 11:11:24 +02:00
Claude dca5a88ef2 feat(libkernel): deliver sceKernelRaiseException on Linux
sceKernelRaiseException threw on Linux, so a title whose garbage
collector stops threads with it (Unity's PS5Util raises SIGUSR1 on each
thread and reads mc_rsp from the handler's context) could not run there.

The raise now sends the host SIGUSR1 to the target thread with
pthread_kill. The host handler, installed on first use with SA_SIGINFO
and SA_RESTART, builds the FreeBSD-layout ucontext from the interrupted
registers and the FXSAVE area, calls the guest handler on the target's
own stack and writes the registers back, so the handler's changes reach
the interrupted code, as they do on Windows. errno is left as the
handler leaves it, as libthr does.

A raise on another thread takes the target's join lock with the host
signal blocked and returns ESRCH once the thread has finished, so a
detached thread's pthread_t is never signalled after it exits. The
pthread_t is recorded when the thread is created or adopted. Handlers
are now lock-free atomics, as the host handler reads them.

guest_raise_exception now runs on every platform. It also checks that
r13 and xmm8 reach the handler and that r12 and xmm8 written by the
handler reach the interrupted code.

AI-assisted: yes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwJx7AHrSUaMGSpEGhL1Kb
2026-10-11 11:11:23 +02:00
Adrià Franch 3c8c02f194 docs(debt): move the PPSA01530 imports line into Unknown function info and note the inferred Ult forwards 2026-10-11 11:07:12 +02:00
Achraf Reyani c9f4689248 fix(exports): drop the sceNpWebApi2GetMemoryPoolStats stub and register the test with the shared guest tests
include from Equeue.cpp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 11:07:03 +02:00
xXPBSXx c4d29f6a99 fix(exports): export the calls PPSA01530, PPSA23827 and PPSA13356 import
Forwards _sceUltWaitingQueueResourcePoolCreate and _sceUltSemaphoreCreate to the existing calls, like the other underscore Ult exports. Declares sceNetShowIfconfig, sceNpWebApi2GetMemoryPoolStats, Json::Value::setNullAccessCallBack, kqueue, kevent and one pad call of unknown name without an implementation.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 11:07:03 +02:00
TibixDev 058b7e8f94 fix(agc): support alternate channel order in 16-bit color targets
Map red and blue exports, write masks and constant-color blend factors together. Reject conflicting simultaneous target constants.

Semantics: Mesa 26.2.2 src/amd/common/ac_formats.c ac_translate_colorswap; console equivalence remains unverified. Graphics tests passed. Written with AI assistance.
2026-10-11 10:59:37 +02:00
TibixDev 4e7ca3c760 fix(agc): recycle descriptor pools after their last set is released
Allocate cached sets without individual-free pools. Reset a pool after its
last owner releases it. Keep stable pool indices, skip full pools, and
terminate if reset fails. No GPU wait is added.

This avoids RADV 26.2.2's affected individual-free allocation path.

Validation: Fedora 44 Release graphics tests pass. The reset-failure
regression fails on the previous behavior and passes on this change.
llvmpipe and RX 6600 pass the 3,301-set lifecycle test with core and
synchronization validation. Windows was not tested.

AI-assisted: yes.
2026-10-11 10:54:44 +02:00
Adrià 3c3992c5c2
Merge pull request #2985 from MrMha/fix/wait-memory-timeout-2832
fix(agc): keep polling unsatisfied memory waits after diagnostics
2026-10-11 10:50:34 +02:00
Adrià 536cbf4a98
Merge pull request #3341 from AchrafReyani/carry/shareplay-connection-info
fix(libSceSharePlay): export sceSharePlayGetCurrentConnectionInfoA with no Share Play session
2026-10-11 10:49:50 +02:00
Adrià 3fb2e29d75
Merge pull request #3315 from pushkarreddyy/feat/libc-nan
feat(libc): implement nan and nanf
2026-10-11 10:49:06 +02:00
Adrià d5477f8402
Merge pull request #2015 from arvindfroi/fix/agc-placeholder-images
fix(agc): typed image heaps on devices without nullDescriptor
2026-10-11 10:48:40 +02:00
Adrià f6b421b73c
Merge pull request #3040 from CouchRiv/fix-shader-ldexp-f16-denorm-flush
fix(shader): flush v_ldexp_f16 denormals per the f16 denormal mode
2026-10-11 10:48:14 +02:00
Adrià d3e84f8543
Merge pull request #3296 from SynnZer0/feat/npwebapi2-memory-pool-stats
feat(libSceNpWebApi2): implement sceNpWebApi2GetMemoryPoolStats
2026-10-11 10:46:44 +02:00
Adrià 71dda5b333
Merge pull request #3297 from SynnZer0/fix/libkernel-module-info-st-size
fix(libkernel): ignore the input st_size of sceKernelGetModuleInfoFromAddr
2026-10-11 10:45:21 +02:00
pushkarreddyy 31906bf9b0 feat(libc): implement nan and nanf
Add standard quiet NaN generators nanf (DZU+K1wozGI) and nan (zck+6bVj5pA) to libc.

Resolves startup failure in VLC for PS5 (PPSA85300) where execution halts at nanf on Linux once strsep is available.
2026-10-11 14:12:36 +05:30
SynnZer0 c5bcc085ba feat(libSceNpWebApi2): implement sceNpWebApi2GetMemoryPoolStats
PPSA21703's Unity PSN plugin imports sceNpWebApi2GetMemoryPoolStats
(Xweb+naPZ8Y), so the title did not start.

sceNpWebApi2Initialize now records the pool size of each context and
sceNpWebApi2Terminate forgets it. The statistics report that size with
no peak or current use, as sceHttp2GetMemoryPoolStats does, since nothing
is allocated from the pool. A null output or an unknown context throws.
The signature and layout follow the Http2 statistics and are recorded in
TechnicalDebt.

The library gets its own CMakeLists.txt, equivalent to the generic rule,
to register its test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 10:42:09 +02:00
Arvind Frøiland 7216621545 fix(agc): typed image heaps on devices without nullDescriptor
The typed descriptor heaps write a null descriptor for a null guest
image, and the device therefore required VK_EXT_robustness2's
nullDescriptor. MoltenVK has the extension but not the feature, so on
macOS no Vulkan device opened and every GPU test was skipped. The
feature is now enabled when the device has it. Without it, the device
creates a placeholder image per typed image heap: 1x1, cleared to zero,
of the heap's dimension, sample count, numeric class and access, and a
null guest image binds the placeholder of its heap. A heap whose
placeholder the device cannot create throws when a null image reaches
it. TechnicalDebt.md lists where a placeholder differs from a null
descriptor.

agc_placeholder_images checks every image resource the recompiler maps
to a heap against that heap's placeholder, so the two cannot drift
apart, and agc_shader_device_profile now expects a device without
nullDescriptor to be accepted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 10:32:49 +02:00
Adrià 0c617bae95
Merge pull request #374 from MichonGoddijn231849/fix/depth-htile-fast-clear
fix(agc): depth fast clears through the HTILE metadata
2026-10-11 10:27:15 +02:00
Alex 327bf794a2 docs(shader): flush v_ldexp_f16 results before rounding in the debt entry
The entry said the result is flushed before or after the scale. The
lowering flushes the exact scaled value below the minimum normal before
rounding. Measured on RDNA2 (gfx1036) with round to nearest over every
half magnitude 0x0000..0x0fff of both signs, scaled by 2^-1 and 2^0,
IEEE 0 and 1, denorm16 0..3: no mismatch.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 04:24:27 -04:00
Claude b87dd8d845 docs(shader): note the per-bit f16 denormal field against the f32 mode 1 and 2 refusals
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K9MzdVqDf6wHUKzNymQSze
2026-10-11 04:24:00 -04:00
Alex 63b2bcb354 fix(shader): flush v_ldexp_f16 denormals per the f16 denormal mode
v_ldexp_f16 ignored the FLOAT_MODE denorm16 flush bits on main. Flush a
denormal half input when bit 0 is clear. When bit 1 is clear, flush the
result when its exact value is below the minimum normal half, decided
on the f32 product before the half conversion rounds it: 0x07ff scaled
by 2^-1 is zero on RDNA2, not the minimum normal. NaN handling and
destination high-half preservation stay the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-11 04:24:00 -04:00
Adrià 7b5214d429
Merge pull request #846 from merwie/feat/relinker-module-dir
feat(relinker): add --module-dir for modules loaded at run time
2026-10-11 10:23:54 +02:00
Adrià bbd7157150
Merge pull request #822 from Celegans12/feat/agc-unnormalized-sampler-offsets
feat(agc): accept texel offsets with unnormalized sampler coordinates
2026-10-11 10:23:33 +02:00
Adrià 5c34f9e25e
Merge pull request #3319 from pushkarreddyy/feat/libSceHttp2-ping-interval
feat(libSceHttp2): export sceHttp2WebSocketSetPingInterval
2026-10-11 10:22:11 +02:00
Michon 56ea14f44c fix(agc): an HTILE fill covers a depth surface only over its whole pipe-aligned metadata
A fill was taken to cover the surface when it spanned ceil(w/8)*ceil(h/8)*4 bytes, a linear HTILE layout. In
the pipe-aligned SW_64KB_Z_X layout a surface's HTILE words lie across a 32 KiB metadata block per 1024x512
pixels (AMD PAL gfx10 addrlib: a 16x16 surface has a valid word at offset 260), so a fill of the linear size
cleared tiles it never wrote. HtileMetadataBytes gives that extent; the fast clear tests fill it (the compute
fixture now dispatches one group per KiB with TGID_X).

Reported with a PAL reproducer by @Amoenus.

Co-Authored-By: Amoenus <5391396+Amoenus@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 10:19:53 +02:00
Michon c133e23dde fix(agc): depth fast clears through the HTILE metadata
Rebased onto main as one commit (the six commits of #374). A uniform fill over a depth surface's whole
HTILE (DMA_DATA, the fill kernels or a CPU store) clears the depth and stencil aspects its ZMask and
SMem fields say, to DB_DEPTH_CLEAR / DB_STENCIL_CLEAR, when the surface is next bound or sampled.

Main's RADV clear_htile_mask recognition (#2229) now goes through the same pending clear: an HTILE clear
marks the matching surfaces' depth aspect, and one for a surface not created yet is applied when it is
first bound. Main's HTILE address decode and this one are merged into one (TILE_SURFACE_ENABLE, a
nonzero DB_HTILE_DATA_BASE and a depth format).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 10:19:53 +02:00
Abdulrahman Elkordy 0d2eeb87eb fix(libSceSharePlay): fill the connection info with no Share Play session
sceSharePlayGetCurrentConnectionInfoA now writes a 72-byte
SceSharePlayConnectionInfoA that reports no session: status DORMANT,
mode 0, empty online IDs, account IDs 0 and both user IDs invalid (-1).
A null pointer returns SCE_SHARE_PLAY_ERROR_INVALID_ARGS (0x810E0001)
instead of throwing. KytyPS5 and fpPS4 agree on the layout and the error
code; KytyPS5 sets the user IDs to -1, fpPS4 leaves them 0.

Claude-Session: https://claude.ai/code/session_012SLQbhAiexxW6TtjYToW8a
2026-10-11 17:14:21 +09:00
xXPBSXx 00fba4472c fix(libSceSharePlay): export sceSharePlayGetCurrentConnectionInfoA
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 17:14:21 +09:00
Merijn 1c6eac425d feat(relinker): add --module-dir for modules loaded at run time
Relinks the ELF modules of extra directories under the module parent directory. Modules the executable or another module needs start with the executable; the others are initialized when the title loads them with sceKernelLoadStartModule, with its start arguments (Windows: __aps5_guest_initialize export; Linux: left out of DT_NEEDED).

Squashed onto main by the reviewer (history had a merge commit).
2026-10-11 10:11:31 +02:00
Celegans12 d0d127b17d feat(agc): accept texel offsets with unnormalized sampler coordinates
Explicit-LOD offset samples through FORCE_UNNORMALIZED samplers now add
sign-extended texel offsets to f32 coordinates before clamping, using
OpFAdd with NoContraction and a sampler specialization selector.

Without native nonconstant-offset support, retain only runtime image
modes valid for unnormalized sampling and reject normalized samplers.
Preserve constant-swizzle handling, indirect-image rejection and main's
flat-volume and flat-line compatibility rules when selecting those modes.

Serialize image compatibility and folding flags and the sampler folding
flag in cache format 34, with roundtrip, preparation and execution coverage.
Retain main's request format 15 and runtime ABI 11.
2026-10-11 10:08:25 +02:00
Adrià f60923bf50
Merge pull request #3294 from kr4y4/feat/shader-compute-user-data-calls
feat(shader): link compute shaders' user-data callees at dispatch
2026-10-11 10:07:22 +02:00
Adrià Franch cfb372a035 fix(libSceHttp2): make sceHttp2WebSocketSetPingInterval throw, document under unknown function info
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-11 10:06:26 +02:00
pushkarreddyy fb2b7b8dce feat(libSceHttp2): export sceHttp2WebSocketSetPingInterval
Export sceHttp2WebSocketSetPingInterval (YfaXPnc8PJE) in libSceHttp2.

Resolves unresolved ELF import in Palworld (PPSA23126, Issue #2648) bundled libdiscord_partner_sdk.prx.
2026-10-11 10:06:05 +02:00
Adrià 1be0a7ce9b
Merge pull request #3324 from AchrafReyani/carry/host-import-span-windows-alias
fix(agc): import a span's ranges one at a time when Windows refuses its alias
2026-10-11 10:01:20 +02:00
krishnaraya 6d9321fc57 feat(shader): link compute shaders' user-data callees at dispatch
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 09:59:27 +02:00
Adrià 59f0269723
Merge pull request #3328 from overlordxrz-source/feat/sharpprospero-sw-version
feat(libs): implement the SharpProspero version queries and export sceSystemServiceLaunchApp
2026-10-11 09:59:15 +02:00
Adrià e89aabc916
Merge pull request #3326 from AchrafReyani/carry/conventions-silent-stub-section
fix(conventions): restrict silent stub exemptions to their section
2026-10-11 09:58:47 +02:00
Adrià 5460611fed
Merge pull request #3323 from TheAggie/feat/libkernel-cpuset-setaffinity
feat(libkernel): implement cpuset_setaffinity for the calling thread or process
2026-10-11 09:57:15 +02:00