Commit Graph
12196 Commits
Author SHA1 Message Date
Adrià 39ff296960 Merge pull request #6097 from XD3V3LOP3RX/fix/host-import-probe-use-stamp
fix(graphics): keep discarded import probes from pinning windows
2026-10-18 18:19:35 +02:00
HQasperandClaude Opus 5.5 e5b4bd72dd fix(recompiler): write a coherent dwordx2 as one 64-bit atomic store
A glc or dlc buffer_store_dwordx2 is one 64-bit write on the GPU, so a
workgroup that polls a {flag, value} pair never sees the flag without
its value. It was emitted as two dword stores, and the coherent dwordx2
load was one 64-bit read only in programs with 64-bit buffer atomics,
the only ones that had the u64 storage-buffer view.

GTA V builds each BLAS with a single-pass decoupled look-back scan that
publishes its tiles' pairs with buffer_store_dwordx2 and has no 64-bit
atomics. A tile read an earlier tile's new flag with its old value 0,
the scan came out short, the BVH got overlapping nodes and the refit
kernel looped until the device was lost.

A program with a coherent raw two-dword buffer load or store now has
the u64 view whenever the device has shaderBufferInt64Atomics. Such a
store whose dwords are in bounds, adjacent and 8-byte aligned is one
device-scope OpAtomicStore. The load takes the same condition, which
now also checks the second dword's bounds and that the dwords are
adjacent. All other accesses keep the per-dword path.

LookBackScan also runs its kernel with the two buffer_atomic_swap_x2
replaced by glc buffer_store_dwordx2. Without this change that variant
fails its first whole scan.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 18:18:12 +02:00
Maz bb39eba819 fix(agc): decode COLOR_8_8 UINT as R8G8_UINT 2026-10-18 18:17:52 +02:00
lakhantheboss 766f4ea872 fix(npmanager): validate null output pointers 2026-10-18 21:40:59 +05:30
MarcZX100 fd872264e2 fix(agc): omit unavailable storage MSAA placeholders 2026-10-18 16:02:26 +00:00
Adrià FranchandClaude Sonnet 5.5 96c692c887 test(agc): expect 32-bit buffer atomics off a DWORD boundary to act on their containing dword
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-18 17:54:44 +02:00
Nahid DelicandClaude Opus 5.5 7e4ce1ab3d fix(shader): act on the containing dword for unaligned 32-bit buffer atomics
The RDNA2 ISA (8.1.7) ignores the two low address bits of dword or wider
non-formatted accesses in alignment mode DWORD. MXGP 26 (PPSA30839) sets
bits with buffer_atomic_or at odd byte offsets, which recorded an
unaligned BDA fault and dropped the atomic. A 32-bit buffer atomic now
acts on the dword that holds its address; 64-bit atomics off an 8-byte
boundary still fault.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 17:54:44 +02:00
Adrià 81cb863394 Merge pull request #6061 from wachi35676/fix/libc-drive-component-under-mount
fix(libc): keep a drive-letter component of a guest path under its mount on Windows
2026-10-18 17:51:46 +02:00
MarcZX100 75d0e9a7f4 test(videoout): correct first flip pacing assertion 2026-10-18 15:46:12 +00:00
ps54allandClaude Opus 5.5 8545c23013 feat(shader): sample converted unorm images in the shader
10_11_11_UNORM (format 30) images are read and written through an
R32_UINT view, so the hardware sampler cannot filter them. image_sample
of a 2D or 2D array view now fetches the one or four texels at LOD 0,
decodes them and blends them in the shader, with bilinear weights on
the 8-bit grid, for point or bilinear filtering with wrap or
clamp-to-edge addressing.

A shader gets the converted sample mode only after a converted
descriptor reaches one of its sampled images: that capture throws
ConvertedSampleRequired and the driver prepares the program again
with GuestContext::convertedSamples.

The R10_G11_B11 float format is sampled natively since #7271 and keeps
its refusal on the converted path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 17:43:35 +02:00
Adrià 91ddd9e3a6 Merge pull request #5998 from MarcZX10/codex/agc-account-kept-storage-images-5961-latest
fix(agc): include retained storage images in recorder budget
2026-10-18 17:37:36 +02:00
Adrià a0f3dc4014 Merge pull request #6091 from Ondra97/codex/fix-cond-canceled-signal
fix(libkernel): preserve condition signals across cancellation
2026-10-18 17:33:22 +02:00
Yunus Shaikh 71de590bd4 Merge main into fix/agc-sample-location-grid-exact 2026-10-18 08:29:13 -07:00
Adrià 9b6837704f Merge pull request #6014 from SandstromPL/fix/agc-msaa-enable-clear-depth-target
fix(agc): rasterize a multisampled depth target without MSAA_ENABLE at the pixel center
2026-10-18 17:26:06 +02:00
Adrià 4ed044d51c Merge pull request #6012 from EagleBearerYS/feat/videoout-performance-overlay
feat(agc,videoout): show an optional performance overlay with F10
2026-10-18 17:26:01 +02:00
Leonardo Feitosa 96770813c3 fix(agc): track DCC storage images with more than one mip as one unit 2026-10-18 12:25:46 -03:00
Dean 3f4a7f3b22 Merge pull request #6142 from milescoviello/fix/net-setsockopt-kernel-socket
fix(libSceNet): set an option on a libkernel socket through sceNetSetsockopt
2026-10-19 04:23:20 +13:00
Dean 5f37c3e09a Merge pull request #6088 from notaxeltv/feat/libc-cnd-init-default-name-ppsa34015
feat(libc): _Cnd_init_with_default_name_override (PPSA34015)
2026-10-19 04:22:55 +13:00
Dean 029cc57054 Merge pull request #6140 from milescoviello/fix/net-close-kernel-socket
fix(libSceNet): close a libkernel socket through sceNetSocketClose
2026-10-19 04:22:51 +13:00
bl4nkTHEBUNKER 15af4e3fa7 feat(libSceSystemGesture): report primitive touch events from the pad reports
sceSystemGestureUpdatePrimitiveTouchRecognizer reads the pad reports the title
passes in and tracks every touch as a primitive, so the primitive event queries
report begin, active and end events with their pressed and current positions,
delta vector, delta time and elapsed time instead of reporting that no touch
input exists. sceSystemGestureGetPrimitiveTouchEventByPrimitiveID no longer
throws for a tracked touch.
2026-10-18 17:08:43 +02:00
Hussein Kadhim b3522206cb fix(libkernel): reject alarm seconds beyond the itimer range
FreeBSD alarm() is setitimer(ITIMER_REAL), and setitimer fails with EINVAL
for it_value.tv_sec above INT32_MAX / 2, so alarm() returns -1 and leaves
the pending alarm alone. alarm(UINT_MAX) armed an alarm decades away and
returned the old remaining time instead.

(cherry picked from commit 2dea16d07d4e0b36e4a3d1eebe3b5c3ffb739807)
2026-10-18 15:06:37 +00:00
MarcZX100 5394684198 fix(agc): create legal sampled cache placeholders 2026-10-18 15:02:29 +00:00
fogydes 68f0acf4f7 fix(libSceJobManager): prevent wait deadlock on node exhaustion and clean up lifecycle 2026-10-18 20:30:35 +05:30
hugodearaujo 9895d130c4 fix(libSceAgc): accept register range values at any byte address, as the console does 2026-10-18 11:59:50 -03:00
milescovielloandClaude Opus 5.5 8e7d8874c8 test(agc): check a subgroup whose BDA reads leave the lookup at different checks
A 64-lane program that doesn't stop invocations reads one dword per lane at
0xfff00 + low over a table whose first range is [0x100000, 0x100010): one
lane below the first range, one past its end, one at its last dword and the
others at its start. The unmapped lanes must read zero with the unmapped
fault recorded, the others their dword, and every read kind must match the
anchored program.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 14:52:10 +00:00
milescovielloandClaude Opus 5.5 d86aea90ba fix(shader): leave the BDA lookup functions through one return
The lookups returned from each failed check. On NVIDIA 595.99 a subgroup
whose invocations left `get_bda_pointer` or `probe_bda_pointer` through three
different returns (one past a range's end, one below the first range and one
that found its range) never finished (Xid 109), which is how #5859's
anchor tests hang `agc_driver_bda_device`. Each check now branches to the end
of a single-pass loop, where a phi takes the result, and the function
returns once. The lookups stay DontInline.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 14:52:04 +00:00
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
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
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