Commit Graph
12196 Commits
Author SHA1 Message Date
Savvanis SpyrosandClaude Opus 5.5 4aadd19659 fix(relinker): accept a relative jump table padded to 16 bytes before more code
FindTrailingRelativeJumpTable accepted a jump table after a function's
code only when padding followed it up to the end of the inspected range.
A PS4 function's table can end past its FDE, be padded to the next
16-byte boundary and be followed by more code before the next FDE. The
table is now accepted when padding reaches that boundary; it then ends
there, so the code after it is still analysed as code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 04:07:56 +03:00
xXPBSXxandClaude Sonnet 5.5 dd945495e3 fix(libkernel): check truncate length and utimes times before the path
FreeBSD 11.4 kern_truncate returns EINVAL for a negative length before it
looks up the path, and getutimes rejects an out-of-range tv_usec before
namei in utimes and lutimes. The guest calls checked a NULL or empty path
first, so truncate(NULL, -1) and utimes("", {usec -1}) returned EFAULT or
ENOENT where FreeBSD returns EINVAL.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-20 03:07:47 +02:00
MarcZX10 8c301fb5c7 fix(agc): honor ANYPS5_GPU in BDA tests 2026-10-20 01:06:47 +00:00
MarcZX10 4cb397a4c9 test(agc): cover BDA fixture GPU selection 2026-10-20 01:06:47 +00:00
Dean Galvin f06c9f9222 Merge main into pr-6604
# Conflicts:
#	docs/dev/debt/shader.md
2026-10-20 14:05:05 +13:00
Muhammad Wasif Ali WasifandClaude Opus 5.5 58f0e89ca3 fix(agc): keep resident DCC targets watched under aligned block imports
Since host imports group adjacent ranges into aligned blocks (#6457), an
import can span both 64 KiB blocks that an earlier import left unwatched
and the metadata of resident multisampled DCC targets.

ImportWatched with staysWatched took the whole import out of the write
watch when any part of it was not watched before. It now walks and
compares each run of watched blocks of the import on its own, and
unwatches only the blocks that were not watched or whose walk failed.

A resident DCC target took the generation of its metadata from a walk
of the metadata's pages alone. CPU stores to the rest of the metadata's
64 KiB block made before that walk were stamped later by the import's
walk, so the block read as written, and the import window marked the
metadata page as possibly stored over: the next draw refused the
target. The generations now come from a walk of the whole blocks.

agc_write_tracking and agc_driver_msaa_dcc_clear_* gain regression
tests for both.

Fixes #8103

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 06:04:44 +05:00
Adrià b50976750d Merge pull request #7640 from Pipodi/perf/texture-cache-scan-admission
perf(agc): refuse uncached textures while the sampled cache's least recently used entry is still in use
2026-10-20 02:57:27 +02:00
Savvanis SpyrosandClaude Opus 5.5 45cc02c49c fix(relinker): start Windows runtime modules the executable needs when the title loads them
A --module-dir module that only the executable needs was initialized by
the Windows entry stub with no start arguments, so a later
sceKernelLoadStartModule with arguments found it started and its
module_start never saw them. Unity's mono-ps4.sprx keeps those
arguments for the plugins it loads. Such a module is now deferred like
any other runtime module: mapped at startup and started, with its
arguments, when the title loads it. Modules another guest module needs
are still started at startup, and Linux and macOS are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 03:57:24 +03:00
Adrià 509cad049d Merge pull request #7707 from milescoviello/fix/uint-direct-point-sampler
fix(shader): point-filter direct samplers paired with unsigned integer images
2026-10-20 02:57:22 +02:00
xXPBSXxandClaude Sonnet 5.5 49940998cd docs(libc): list the lookup order and the backslash separator among the rename dot component differences
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-20 02:57:14 +02:00
xXPBSXxandClaude Sonnet 5.5 9899ba0fa2 fix(libc): fail a rename of a path that ends in a dot component with EINVAL
rename and sceKernelRename resolved "dir/." to "dir" and renamed the directory. FreeBSD 11.4's lookup fails a last component of "." for DELETE and RENAME with EINVAL, for the source and the destination alike. Check the guest string before it is resolved: a last component of "." (also under trailing slashes) fails with EINVAL when its parent exists, ENOENT when it does not and ENOTDIR when it is not a directory.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-20 02:57:14 +02:00
babyhuey b28198008c feat(libkernel): implement sceKernelOpenEventFlag
Return the handle of an event flag this process created under the
given name, or ENOENT. Twispero opens the shell's
SceShellCoreUtilAppFocus flag at start-up and treats a failed open as
unknown focus.
2026-10-19 20:52:47 -04:00
Dean a569f47cb7 Merge pull request #7876 from ErenYeager1836/feat/libc-export-tgammaf
feat(libc): export tgammaf float math function
2026-10-20 13:52:11 +13:00
xXPBSXxandClaude Sonnet 5.5 1ccbbc2faa fix(libkernel): fail chflags on an oversized path name with ENAMETOOLONG instead of throwing
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-20 02:46:54 +02:00
xXPBSXxandClaude Sonnet 5.5 6bc6c444e0 fix(libc): fail an oversized guest path name with ENAMETOOLONG
stat, open, mkdir, rename and the other calls that resolve a guest path answered ENOENT (or EIO for rename) for a name longer than 255 bytes or a path of 1024 bytes or more, because the host path just did not exist. FreeBSD 11.4's namei fails a component above NAME_MAX and a path of MAXPATHLEN bytes with ENAMETOOLONG. Check both limits on the guest string before it is resolved; FilesystemError already maps the error to 63.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-20 02:46:53 +02:00
xXPBSXxandClaude Sonnet 5.5 d5d17788ae fix(libkernel): fail a socket call on an open non-socket descriptor with ENOTSOCK
bind, listen, accept, connect, shutdown, getsockname, getsockopt, setsockopt, send, recv and the other calls that look up a guest socket answered EBADF for a descriptor that is open but not a socket, for example a pipe end. FreeBSD 11.4's getsock_cap fails these with ENOTSOCK and keeps EBADF for a closed or invalid descriptor.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-20 02:44:17 +02:00
RengundomandClaude Opus 5.5 9abcd45861 fix(trace): fail a benchmark file replace from the move, not the stream
The Windows build failed agc_performance_trace: ReplaceGzipFile made the
write fail by putting a directory at <name>.tmp, so the std::ios_base::failure
came out of libstdc++'s ofstream and could not unwind to the test's catch on
Windows.

The test now blocks the move instead, with a directory at the destination:
MoveFileExW (or rename) fails and ReplaceGzip throws std::system_error from
the driver's own code. ReplaceGzip also removes its temporary file when the
move fails, and the test checks that the blocked destination, the missing
temporary file and the other benchmark file are as expected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 19:42:04 -05:00
Adrià 340247a083 Merge pull request #7695 from jotitadev/fix/macos-write-watch-unfair-mutex
fix(libc): let the macOS write watch fault handler go first
2026-10-20 02:38:47 +02:00
Adrià 1b0ff1e153 Merge pull request #7673 from tibzejoker/perf/fold-unused-bits
perf(shader): fold masks, shifts and field extracts through bits they do not use
2026-10-20 02:35:37 +02:00
xXPBSXxandClaude Sonnet 5.5 a957b8c106 test(libkernel): check and close the IPv6 socket of guest_socket_address_length
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-20 02:30:55 +02:00
xXPBSXxandClaude Sonnet 5.5 cd09badb2b fix(libkernel): fail a short or long socket address like FreeBSD
bind, connect and sendto answered EFAULT for an address length below 2 and EAFNOSUPPORT for an AF_INET address below 16 or an AF_INET6 address below 28 bytes. FreeBSD 11.4's getsockaddr fails a length below 2 with EINVAL and above SOCK_MAXADDRLEN (255) with ENAMETOOLONG, and the protocols compare the length with sizeof(struct sockaddr_in) or sockaddr_in6 and fail with EINVAL.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-20 02:30:55 +02:00
hamb3r 1819d3965e test(libc): enable guest_backtrace on Windows and cover path buffer growth 2026-10-20 03:28:30 +03:00
hamb3r 6fb1b56526 feat(libc): implement sceLibcBacktraceSelf and GetBufferSize on Windows 2026-10-20 03:28:24 +03:00
hamb3r ba1a85ebb3 feat(libc): add Windows module path helper for backtrace resolution 2026-10-20 03:28:17 +03:00
Adrià ad80f5f967 Merge pull request #7655 from farosch/main
feat(libkernel): log guest exception context
2026-10-20 02:28:16 +02:00
hamb3r 3845df2f1e test(libc): cover Dinkumware _Pad and _Thrd_join in guest_libc_threads 2026-10-20 03:22:07 +03:00
hamb3r 3524b04740 feat(libc): move Dinkumware thread exports from libSceAmpr to libc 2026-10-20 03:22:00 +03:00
hamb3r 6ce8bc0373 feat(libc, libkernel): register pthread_create and pthread_join callbacks with libc 2026-10-20 03:21:53 +03:00
Savvanis SpyrosandClaude Opus 5.5 6e4c01f91c feat(libSceNpManager): answer the PS4 account id and presence queries for a signed-out user
sceNpGetAccountId and sceNpSetGamePresenceOnline report NP as signed
out, and sceNpUnregisterPlusEventCallback returns 0 like the premium
form.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 03:19:49 +03:00
Adrià 34b1b77abf Merge pull request #7651 from DavidSamir/fix/relinker-amd-only-branch-targets
fix(relinker): ignore direct branch targets inside an instruction past its prefixes
2026-10-20 02:13:47 +02:00
Adrià fafadca12c Merge pull request #7529 from Aspct3434/feat/swscanf-pointer
feat(libc): scan %p in swscanf and swscanf_s
2026-10-20 02:09:37 +02:00
Adrià 5253446882 Merge pull request #7543 from ionut27001/fix/libkernel-getrlimit-console
fix(libkernel): report the getrlimit values measured on a PS5 for RLIMIT_STACK, RSS, MEMLOCK and NPROC
2026-10-20 02:07:39 +02:00
battleblob1andClaude Opus 5.5 f95471ec6a feat(shader): read domain inputs at a control-point index computed from data
A domain program that picks one of its patch's control points from data
(Onimusha: Way of the Sword, PPSA27836, selects a corner with v_cmp and
v_cndmask before a buffer_load from the off-chip ring) was refused with
"the tessellation ring or LDS address is not affine in the control point
and relative patch". Computed indices were accepted only for hull LDS
reads.

- The address evaluator gives off-chip EvaluationInput reads the same
  dynamic term as hull LDS reads, and a value read from the patch's own
  ring or LDS no longer counts as depending on the relative patch index,
  since the lowered read takes the patch implicitly.
- When the program also uses its relative patch index as data, the
  index is replaced by the grouped patch instead of 0, which left a
  computed read's address pointing into another patch. Such reads now
  subtract their relative patch term, for hull and domain reads alike;
  reads in programs that do not use the index as data keep their address.
- The computed offset must be a whole number of control points, and the
  backend clamps the domain gl_in index to the last output control point
  as it already does for hull reads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 03:05:55 +03:00
xXPBSXxandClaude Sonnet 5.5 906b2527b8 fix(libc): convert the character argument of strrchr to char
strrchr passed its int argument to the host strrchr unchanged. On Windows the
host compares it with the signed char bytes of the string, so a byte of 0x80 to
0xFF passed as an unsigned value (0xE9) or a value above 255 (0x12F) was not
found, where FreeBSD converts the argument to char first.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-20 01:52:52 +02:00
bl4nkTHEBUNKER f57b79ef51 fix(libScePad): report the DualSense touchpad resolution
The controller information reported 1920 by 943, the DualShock 4 height with
the DualSense pixel density, while the host controller's fingers were scaled to
1920 by 942 and the keyboard touch contacts sat on the 942 centre line. A title
that maps touch coordinates through the reported resolution lost the lower part
of the touchpad. The width and height now live beside the pad state and all
three places use them.
2026-10-20 01:52:50 +02:00
Dean 3aa35dc014 Merge pull request #6730 from EagleBearerYS/perf/agc-remember-evicting-refusals
perf(agc): remember an evicting import request's budget refusal until it could succeed
2026-10-20 12:52:11 +13:00
Dean 2d97b2468d Merge pull request #5480 from Nesyth/perf/agc-dma-copy-on-gpu-behind-pending-source
perf(agc): record a DMA copy of up to 64 KiB on the GPU when the GPU still stores into its source
2026-10-20 12:51:57 +13:00
Adrià ef0eed9b31 Merge pull request #6680 from 011010/feat/libSceNgs2-geom-report
feat(libSceNgs2.native): keep a registry of report handlers
2026-10-20 01:50:58 +02:00
Adrià 8038a425fb Merge pull request #7574 from bl4nkTHEBUNKER/feat/system-gesture-primitive-touch
feat(libSceSystemGesture): report primitive touch events from the pad reports
2026-10-20 01:45:51 +02:00
Adrià 25ab3510ca Merge pull request #7623 from thuanquang/fix/subvector-loop-exec-zero
fix(shader): test an empty exec mask in s_subvector_loop_begin with one compare
2026-10-20 01:41:41 +02:00
Celegans12 95c90a54ef test(agc): compare a remapped import with the one alive before the remap
agc_trimmed_import fails on Windows with NVIDIA and AMD drivers at the
1440 KiB unmap case: after the pages are mapped again, the import of the
whole range has the same VkDeviceMemory handle as the first import.

In that case the first import is not kept: its kept side has a new backing
serial, so the trimmed memory is released and freed by the recorder syncs
of the checks that follow. The driver then hands the freed handle value to
the new import of the whole range, so the comparison with the first
import's handle fails even though that memory no longer exists.

Compare the remapped import with the kept side's import instead, which is
still alive or held by the recorder when the whole range is imported
again. In the cases that keep the trimmed import this is the first import,
as before.

AI-assisted: yes
2026-10-20 01:41:16 +02:00
Adrià 5907b297a3 Merge pull request #7572 from Delciob/fix/commondialog-already-initialized-error-code
fix(libSceCommonDialog): ALREADY_INITIALIZED is 0x80B80004
2026-10-20 01:38:37 +02:00
Adrià ea40a70edb Merge pull request #7628 from milescoviello/test/hex-failure-values
test(agc): print hex values of failing checks in hex
2026-10-20 01:37:32 +02:00
Retr0 04c16c74f9 fix(libkernel): mark both socketpair ends close-on-exec for SOCK_CLOEXEC
socketpair accepted SOCK_CLOEXEC but left both descriptors out of the
close-on-exec set, so F_GETFD read 0 on them. FreeBSD 11's
kern_socketpair opens both files with O_CLOEXEC when the type carries
SOCK_CLOEXEC, as socket already does here.
2026-10-20 02:26:15 +03:00
Adrià 88fb5592c6 Merge pull request #7611 from Lindamea1/fix/kernel-pthread-attr-sched-getters
feat(libkernel): implement scePthreadAttrGetschedpolicy and scePthreadAttrGetinheritsched
2026-10-20 01:23:13 +02:00
Th3EvilGod 81b28cef61 fix(libc): use precise Windows thread sleep 2026-10-20 03:21:28 +04:00
Adrià 606ebafd20 Merge pull request #7612 from Lindamea1/fix/netctl-getinfov6-export
feat(libSceNetCtl): declare sceNetCtlGetInfoV6
2026-10-20 01:20:06 +02:00
Adrià 5158970e85 Merge pull request #7521 from Myrarc/fix/sigtimedwait-deadline
fix(libkernel): preserve sigtimedwait deadline across wakeups
2026-10-20 01:17:59 +02:00
Adrià 1a2d485032 Merge pull request #7597 from voidlakhan/fix/np-null-pointer-checks
fix(npmanager): validate null output pointers
2026-10-20 01:15:52 +02:00
Adrià 1292e251c4 Merge pull request #7591 from mrfelek/fix/recompiler-offset-sgpr-reuse
fix(recompiler): fold draw offsets that the shader only reloads after the fetch add
2026-10-20 01:13:50 +02:00