Commit Graph
14017 Commits
Author SHA1 Message Date
Dean e5f18ea99a Merge pull request #7558 from mugurc/fix/libc-app-archive-exit
fix(libc): keep the app0.zar state through exit handlers
2026-10-19 03:51:56 +13:00
Adrià 50fafac3d8 Merge pull request #5993 from Get-fix/ps4/param-sfo
feat(libkernel): read param.sfo when param.json is absent
2026-10-18 16:50:34 +02:00
Adrià 2da44a1873 Merge pull request #5918 from karimibrahim07/fix/libkernel-adopted-stack
fix(libkernel): report the precommitted stack of an adopted thread on Windows
2026-10-18 16:50:30 +02:00
Adrià e00260b6b3 Merge pull request #5994 from Get-fix/ps4/sce-module-code-extent
fix(relinker): stop module syscall scans at the PLT and skip the PS4 loader path
2026-10-18 16:45:24 +02:00
Adrià bb86ca38b8 Merge pull request #5992 from Get-fix/ps4/libkernel-underscore-io
fix(libkernel): export _readv, _writev, _fcntl, _fstat, __sys_socketex
2026-10-18 16:45:19 +02:00
Adrià a01f668ae5 Merge pull request #5930 from Ondra97/codex/fix-net-recvmsg-host-write
fix(libSceNet): guard recvmsg guest outputs
2026-10-18 16:45:14 +02:00
MarcZX100 27497f0474 fix(agc): account for batch-retained evicted storage images 2026-10-18 14:34:09 +00:00
MarcZX100 902b0515a2 fix(agc): account recorded storage images in keep budget 2026-10-18 14:32:59 +00:00
Karim Ibrahim 267cb56a0d fix(libkernel): report the precommitted stack of an adopted thread on Windows
An adopted thread (the main thread, or a host thread that calls
scePthreadSelf) reported its whole Windows stack reservation, and so
did sceKernelIsStack on a host thread before adoption. A relinked
executable reserves 0x210000 bytes for its main thread and commits the
top 0x200000, so the lowest 64 KiB of the reported stack hold only
reserved pages and Windows' guard pages. mprotect fails there, so
HotSpot in Java 25 LAN / DNS (PPSA99869) could not create the main
thread's stack guard pages ("Attempt to allocate stack guard pages
failed").

When everything above the bottom allocation granule is committed
read-write, the host stack is now reported from there, as created
guest threads report only their committed stack. Other host stacks
keep the whole range. The committed-pages walk is shared with
StartNativeThread and throws when VirtualQuery fails.
2026-10-18 16:24:10 +02:00
slopggobblercobbler81 0029bddb55 fix(libSceAppContent): return NOT_MOUNTED for invalid download mount point
Return SCE_APP_CONTENT_ERROR_NOT_MOUNTED instead of throwing APS5_INVALID_ARG_EX when a mount point other than /download0 is passed to sceAppContentDownloadDataFormat or sceAppContentDownloadDataGetAvailableSpaceKb, aligning with sceAppContentTemporaryDataFormat. Check null mount_point in sceAppContentDownloadDataGetAvailableSpaceKb with SCE_APP_CONTENT_ERROR_PARAMETER.
2026-10-18 16:12:23 +02:00
ionut27001andClaude Opus 5.5 213a741eb2 fix(libkernel): match inet_ntop and inet_pton padding and null pointers as measured on a PS5
Measured from a payload process on a PS5 (firmware 12.70), where
__inet_ntop/__inet_pton and the plain inet_ntop/inet_pton exports
resolve to the same functions:
- inet_ntop follows an AF_INET6 result with zero bytes up to size (sizes
  4 to 65536 sampled) and never writes past size; AF_INET writes only the
  text and its NUL.
- An unsupported family returns EAFNOSUPPORT first, even with null
  pointers.
- A null source or text raises SIGSEGV during the call, before the size
  is checked; here it throws instead of returning EFAULT.
- A null destination is reached only after the size check and the text
  parse: ENOSPC for a size that is too small, 0 for text that does not
  parse, and SIGSEGV (a throw here) otherwise.
The test pins the measured inet_pton and inet_ntop rows, including all
inputs the existing assertions use. The text-form debt entry is replaced
by one that records what a payload process measured (the text forms, the
order of the checks and the padding) and what is still assumed: the
sizes that were not sampled, sizes above 65536, and a title process.
inet_ntoa_r calls __inet_ntop, so a null inet_ntoa_r buffer with room
for the text now throws, and a null buffer that is too small sets ENOSPC
instead of EFAULT; the libSceLibcInternal debt entry says so.

AI-assisted: yes

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 17:02:40 +03:00
Slick Daddy 536fef3228 fix(libc): format %p the way the console's libc does
The console's libSceLibcInternal.sprx (measured on firmware 12.70 in
#7549) prints %p as bare lowercase hex without a 0x prefix, prints 0 for
a null pointer, ignores #, + and the space flag, counts only the digits
towards the width, pads with spaces on the left (on the right for - and
with zeros for 0 when there is no precision), treats the precision as
the minimum number of digits, prints nothing for a null pointer under
%.0p, and accepts the l length. FormatPointer instead followed FreeBSD
and printed 0x..., which is what a title does not see on hardware.

FormatPointer now prints the digits alone, the narrow Windows formatter
accepts %lp, and Linux routes %p and %lp to the guest formatter instead
of glibc, which prints the FreeBSD form and (nil) for a null pointer.
The wide family still refuses %lp, because the console's swprintf was
not measured with it; it returns -1 as it does for any other conversion
the formatter rejects. The debt note records the pointer cases the
console was not measured with and what the Linux routing means for a
format that mixes %p with a refused conversion.
2026-10-18 16:59:34 +03:00
mrfelekandClaude Opus 5.5 5e0deae1f4 docs(libSceNgs2): note that a setup inside the voice callback clears it
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BywPXoZACVi8ALV4JKvuPZ
2026-10-18 15:56:37 +02:00
milescovielloandClaude Opus 5.5 2f3e71bae6 perf(shader): emit runtime V# byte writes through the looping helper
A store through a V# the shader computes (EmitBdaWrite) still emitted its
byte path inline: one get_bda_write_pointer lookup, a mapped check, a byte
store and a note_bda_write per byte, five write lookups per 32-bit store.
It now calls write_bda_bytes after the same overflow check, like stores
through bound V#s since 70a884408; the helper does the same lookup, store
and note per byte in order, so faults are recorded as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 13:55:47 +00:00
Dean a62c724c38 Merge pull request #6135 from DavidSamir/fix/videoout-cursor-exports
feat(libSceVideoOut): export the hardware cursor functions as not implemented
2026-10-19 02:54:55 +13:00
Dean f834e249c4 Merge pull request #6129 from fdfawef324/claude/agc-tessellation-refusal-fields
fix(agc): print the VGT_TF_PARAM and VGT_LS_HS_CONFIG fields of a refused tessellation draw
2026-10-19 02:54:51 +13:00
Dean 6bef39cb44 Merge pull request #6122 from fdfawef324/claude/mc-agc-event-write-streamout
feat(agc): accept SAMPLE_STREAMOUTSTATS events without a destination in EVENT_WRITE
2026-10-19 02:54:48 +13:00
Dean 644e384808 Merge pull request #5859 from gjonn/perf/shader-bda-anchors
perf(shader): look up the BDA range of a user-data pointer once at program entry
2026-10-19 02:54:44 +13:00
Werner 3c84815d9f test(relinker): bound the relinker's memory in the Windows sparse load test
Since 6158444 trims zero raw data, the far-gap executable is the same size
with and without the sparse load image, so the size checks no longer fail
without the fix. The test now also checks the peak memory of the Windows
and macOS conversions where the resource module is available: 4.3 GB
without the fix, a few MB with it, against a 512 MiB limit.

Reported by simonbronk in the review.
2026-10-18 13:43:09 +00:00
Werner c0dec34d82 Merge remote-tracking branch 'origin/main' into fix/windows-sparse-load-image 2026-10-18 13:39:35 +00:00
capmare 8489e74f89 docs(libSceFontFt): pin the shadPS4 link to a commit 2026-10-18 15:29:08 +02:00
iAlturki e9a7b8ea54 fix(tools): accept UTF-8 BOMs in trace digest inputs 2026-10-18 16:27:26 +03:00
Maz e79cf0f754 fix(libkernel): stop O_NOFOLLOW from opening a Windows directory junction
lstat reports the junction as a symbolic link, but open with O_NOFOLLOW still opened the target.
2026-10-18 17:19:02 +04:00
lakhantheboss 23aa711e7f fix(pad): return invalid argument error on null buffer in scePadRead and scePadReadState
scePadRead_nid_postfix and scePadReadState threw APS5_INVALID_ARG_EX (std::invalid_argument) when passed a null output buffer or a non-positive buffer count, terminating the guest process across the PRX ABI boundary.

Both functions now return PAD_ERROR_INVALID_ARG (-2137915391) on invalid arguments, matching the error return contract of all sibling libScePad APIs.
2026-10-18 18:45:15 +05:30
Evgeniy Kazarin 7c345db5a5 fix(libc): validate resident allocations before release 2026-10-18 09:14:12 -04:00
mugurc 6f2a61ade0 fix(libkernel): recognize listening sockets on macOS hosts
macOS does not support getsockopt with SO_ACCEPTCONN; it fails with
ENOPROTOOPT. So on macOS the guest's getsockopt of SO_ACCEPTCONN failed,
connect did not see that a stream socket was listening (an address of
another family failed with EAFNOSUPPORT instead of EOPNOTSUPP), and the
read event of a listening socket reported FIONREAD's 0 instead of the
waiting connection and did not ignore its low watermark.

On macOS the listening state is read from the SO_ACCEPTCONN flag of the
socket options that proc_pidfdinfo reports, and the three places that ask
go through NativeListening. Other hosts keep getsockopt.
2026-10-18 16:13:50 +03:00
babyhuey 2d8d3b9dc1 fix(libc): keep the host standard stream when a guest freopen of it fails 2026-10-18 09:12:17 -04:00
mugurc f347461351 feat(libSceSystemService): LoadExec on macOS hosts
sceSystemServiceLoadExec found its own executable through /proc/self/exe
and replaced the process with fexecve after close_range, none of which
macOS has, so on macOS every call except "exit" threw. On macOS:

- the running executable's path comes from _NSGetExecutablePath, resolved
  with std::filesystem::canonical, as libSceNpEntitlementAccess and
  libSceFont already do;
- the target must be an x86-64 Mach-O executable (MH_MAGIC_64,
  CPU_TYPE_X86_64, MH_EXECUTE) that the user may run;
- macOS has no fexecve, so the process is replaced by path with
  posix_spawn and POSIX_SPAWN_SETEXEC; POSIX_SPAWN_CLOEXEC_DEFAULT closes
  every descriptor but the standard streams, as close_range does on Linux;
- before the replacement the exit starts and the shutdown callbacks run
  (LibcStartExit, then LibcRunShutdown), as on Linux, so guest threads
  that call a stopped library wait instead of unwinding;
- descriptor 2 gets the host standard error back before the replacement,
  as on Linux, and guest_system_load_exec_standard_error runs on macOS.

A launch without arguments keeps the Linux execv path, which macOS has.
guest_system_exit finds its own executable the same way on macOS.
2026-10-18 16:05:07 +03:00
mugurc d10c1b43ba fix(libc): keep the app0.zar state through exit handlers
Every path resolution reaches the app0.zar state, which was a
function-local static: it is destroyed during exit before the handlers
registered ahead of its first use run, so a path resolved in such a
handler locked a destroyed mutex. glibc lets that pass; macOS fails it
with EINVAL, and guest_path_lifetime failed there. The state is now
allocated once and never destroyed, as the working directory state
beside it already is.
2026-10-18 16:03:19 +03:00
Gjon Gojcevic ca7f2f60b5 fix(shader): update the DescriptorBinding size assert for samplerCoordinatesIgnored
The new samplerCoordinatesIgnored field adds 40 bytes to DescriptorBinding
under libstdc++ on Linux x86_64, where the size assert is compiled. The
encoder and decoder already carry the field.

AI-assisted: yes
2026-10-18 09:02:32 -04:00
Gjon Gojcevic a2e79fb3fd fix(shader): bind an unnormalized S# normalized when it samples only null images
An S# that forces unnormalized coordinates was refused when it samples a
T# the shader declares 3D, 2D-array, cube or multisampled, since Vulkan
allows unnormalized coordinates only with a single-level 1D or 2D view.
A null T# reads zeros at any coordinate, and a T# whose channels all
select constants is emitted as those constants without a sample, so when
the S# samples no other T# its coordinates cannot change a result. Such
an S# is now marked in its binding (samplerCoordinatesIgnored) and the
driver creates its sampler without FORCE_UNNORMALIZED. The flag is part
of the binding content key and of the shader disk cache, whose format
version is raised to 38. An S# that also samples a real T# while a null
T# of such a shape shares it is still refused. PPSA01317 pairs an
unnormalized clamped bilinear S# with a null 3D T# and a 3D T# whose
channels all select 0 for image_sample_lz in a compute shader during
boot.

AI-assisted: yes
2026-10-18 09:02:31 -04:00
Dean 385ed71f2c Merge pull request #7368 from CrimsonMac/fix/device-lds-mixed-width-atomics
fix(shader): use 64-bit buffer atomics for device-memory LDS
2026-10-19 01:51:59 +13:00
milescovielloandClaude Opus 5.5 39a934bfc1 perf(shader): keep a specialized module's instructions in one arena
Specialization parsed every instruction of the prepared module into
its own std::vector, so a module of n instructions made n allocations
when it was read and n frees when the specialization ended. Parsed
instructions now take their words from a WordArena the Specialization
owns, through an ArenaAllocator whose first chunk is the size of the
module's words, so parsing allocates about once and the arena frees
its chunks when the specialization ends. An allocator without an arena
(Make's results and other temporaries) uses std::allocator as before,
and assigning one to an instruction copies it into the arena. The
specialized module is unchanged.

This is a plain allocator rather than std::pmr because Apple's libc++
marks std::pmr unavailable before macOS 14.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 12:45:01 +00:00
Adrià 5bf2e139ef Merge pull request #7537 from adriadam10/ci/pages-paths
ci(pages): deploy only when the site or the progress changes
2026-10-18 14:40:46 +02:00
Adrià FranchandClaude afe2141a7c ci(pages): deploy only when the site or the progress changes
Co-Authored-By: Claude <[email protected]>
2026-10-18 14:40:02 +02:00
Elias 5bdefb9e37 fix(web): explain missing release.json when serving demo/web directly 2026-10-18 15:38:31 +03:00
Yunus Shaikh 7f03326540 test(agc): compare the device grid's depth with the composite only where the grid reads it back at the guest's locations 2026-10-18 05:37:40 -07:00
lakhantheboss a605f94732 fix(savedata): return parameter error on null arguments in setParam 2026-10-18 18:06:26 +05:30
Dean Galvin bb2ab91841 Merge branch 'main' into 6445 2026-10-19 01:25:59 +13:00
milescovielloandClaude Opus 5.5 91a9e5608e docs(libkernel): note the FIONREAD count of a host datagram socket
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 12:22:56 +00:00
Dean 6efb7261b5 Merge pull request #7140 from AlexOfTheForest/fix/listen-backlog-data
fix(libkernel): report the accept queue length for a listening socket's read event
2026-10-19 01:21:56 +13:00
Dean dce6a3ed4e Merge pull request #6492 from Pipodi/fix/resource-cache-released-textures
fix(agc): drop resource-cache entries that hold released sampled textures
2026-10-19 01:21:52 +13:00
milescovielloandClaude Opus 5.5 2b8049cc7a perf(shader): probe at most eight declaration cache slots
SpirvModule's interned type and constant lookups probe a 512-slot cache
linearly from the key's slot. Once a module has declared more than 512
of them, every slot is taken, so a key that is not cached probed all
512 slots before falling back to declarationIds, and then overwrote
the last slot it probed. A lookup now probes at most eight slots and,
when none of them is free, replaces the key's own slot. The cache only
memoizes declarationIds, which allocates every id, so the module is
unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 12:19:43 +00:00
aspct3434andClaude Opus 5.5 2a45c85ac1 feat(libc): scan %p in swscanf and swscanf_s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 16:16:16 +04:00
ivica00andCursor 2d96ff77a8 fix(agc): drain DMA_DATA unless APS5_PIPELINE_DMA is set
Co-authored-by: Cursor <[email protected]>
2026-10-18 14:13:08 +02:00
Yunus Shaikh ca7ea10d30 docs(environment): add the rows for the performance overlay switches 2026-10-18 05:09:14 -07:00
Yunus Shaikh 0172d28496 Merge main into feat/videoout-performance-overlay 2026-10-18 05:08:24 -07:00
Yunus Shaikh 790fe18183 docs(environment): add the rows for the image table reuse switches 2026-10-18 05:07:16 -07:00
Yunus Shaikh 54f2cf31b1 Merge main into perf/shader-image-table-reuse-v3-pr 2026-10-18 05:06:50 -07:00
Romans Pokrovskis 28a4397434 docs(dev): correct periodic trace summary interval units 2026-10-18 15:06:20 +03:00