Commit Graph
8546 Commits
Author SHA1 Message Date
milescovielloandClaude Opus 5.5 20764888c3 feat(libkernel): report the guest address-space map through kern.proc.vmmap
sysctl {CTL_KERN, KERN_PROC, KERN_PROC_VMMAP, pid} for the calling process
returns packed FreeBSD 11 kinfo_vmentry records, one per used range of the
guest arena, with the protection sceKernelVirtualQuery reports. Other pids
return ESRCH, a write EPERM, a short buffer ENOMEM. GuestArena gains a
query for the used range at or after an address.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 20:43:31 +00:00
Dean 82cad6b5fc Merge pull request #6237 from milescoviello/fix/loadexec-exit-shutdown
fix(libSceSystemService): park guest threads during LoadExec's shutdown as exit does
2026-10-18 09:41:59 +13:00
Dean 0f0d4004a4 Merge pull request #6517 from Wild-Badger/fix/libc-wide-collate-layout
fix(libc): count wide collate string elements
2026-10-18 09:41:21 +13:00
Dean e0045fb6ef Merge pull request #6518 from qpavyros/codex/mutexattr-invalid-attributes
fix(libkernel): return EINVAL for invalid mutex priority attributes
2026-10-18 09:41:01 +13:00
Dean b5e570d06a Merge pull request #7092 from milescoviello/fix/kevent-note-lowat
fix(libkernel): take NOTE_LOWAT on socket read and write events
2026-10-18 09:40:43 +13:00
Dean ee14990418 Merge pull request #7073 from AlexOfTheForest/fix/getlk-unlock
fix(libkernel): answer F_GETLK with F_UNLCK on Linux and macOS
2026-10-18 09:39:47 +13:00
thuanquangandClaude Opus 5.5 7b45d1034e fix(shader): run buffer atomics through a V# off a DWORD boundary
The binding plan refused every buffer atomic through a V# whose base is
not a multiple of 4. On RDNA2 such an atomic works when base + offset is
on a DWORD boundary and stops the dispatch otherwise, which the runtime
buffer atomic already does, so the refusal is dropped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 03:22:06 +07:00
thuanquangandClaude Opus 5.5 e1341df3b9 fix(libSceVideodec2): decode after a flush without a reset
sceVideodec2Decode threw when it followed sceVideodec2Flush without
sceVideodec2Reset. It now resets FFmpeg's drained decoder and decodes the
unit, keeping the pictures the flush has not returned yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 02:42:34 +07:00
thuanquangandClaude Opus 5.5 f2a4236ab6 fix(agc): draw rect lists in last provoking vertex mode
The generated rect-list control stage gave every corner of a rectangle the
flat inputs of its first vertex, so last mode was refused for rect lists.
BuildRectListShaders now also builds a control stage that takes them from
the rectangle's third vertex when the pixel shader has a flat input, and a
draw in last mode uses it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 02:38:26 +07:00
Nithishvelan M 87f2e7a88c fix(libSceSaveData.native): drop size 0 and resource validation per review 2026-10-18 01:05:22 +05:30
lorkydey 7c07ebd095 feat(libc): implement getw and putw 2026-10-17 21:28:18 +02:00
Nithishvelan M 18ce9241e6 fix(libSceMsgDialog.native): validate null argument and busy state across dialog lifecycle 2026-10-18 00:39:01 +05:30
Adrià 5859889b29 Merge pull request #6133 from AkulTyagi11/feat/libc-modti3
feat(libc): implement __modti3
2026-10-17 21:06:42 +02:00
Nithishvelan M eb7c5f5c9c docs(libSceVoiceQoS): address review notes on endpoint attributes and call count 2026-10-18 00:31:35 +05:30
thuanquangandClaude Opus 5.5 a314f2b85f fix(shader): flush f64 floor, ceil, fract and frexp denormal inputs
v_floor_f64, v_ceil_f64, v_fract_f64, v_frexp_mant_f64 and
v_frexp_exp_i32_f64 ignored the FLOAT_MODE f16/f64 denormal field. On
RDNA2 (gfx1031) bit 6 clear flushes a denormal input to a zero of its
sign, so v_ceil_f64 of 2^-1074 is 0 instead of 1, and bit 7 clear
flushes the denormal result v_fract_f64 gives for a positive denormal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 01:54:10 +07:00
Nithishvelan M c43c931005 fix(libSceSaveData.native): validate initialization and parameters in transaction resource lifecycle 2026-10-18 00:19:48 +05:30
milescovielloandClaude Opus 5.5 c3a7e4f7f2 docs(shader): record the measured 16_16_16_16_FLOAT cube face store
simonbbby measured four-channel 16_16_16_16_FLOAT stores through the same
8x8 cube arrays on gfx1036: they land on the BASE_ARRAY face and leave the
rest of the backing unchanged, so the debt entry no longer lists the
title's format as unmeasured.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 18:48:41 +00:00
milescovielloandClaude Opus 5.5 cf6ebdf856 docs(shader): record the measured cube face image_store
simonbbby measured DIM 2D image_store through 8x8 cube arrays on RDNA2
(gfx1036): 32_UINT and 32_FLOAT stores with BASE_ARRAY 0 and 6 write that
face and nothing else.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 18:48:41 +00:00
milescovielloandClaude Opus 5.5 dbf176f2ef fix(shader): store through DIM 2D image_store to a cube T#'s BASE_ARRAY face
A DIM 2D image_load through a cube T# already reads texel (x, y) of the
T#'s BASE_ARRAY face (#4139, measured on RDNA1). A DIM 2D image_store to
a cube T# had no matching runtime mode and threw "image descriptor is
incompatible with the static runtime image interface". Crimson Desert
writes a 16_16_16_16_FLOAT cube this way from a compute shader.

A mip-less image_store to an image the program only stores to now takes
the same face mode, writing texel (x, y) of the BASE_ARRAY face, the
face the measured load reads. Stores were not measured on hardware; the
debt entry says so. Formats that store through a conversion (SINT) keep
throwing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 18:48:41 +00:00
Nithishvelan M aaba312e6d feat(libSceNetCtl): support NET_CTL_INFO_HTTP_PROXY_PORT and validate null in sceNetCtlGetNatInfo 2026-10-18 00:06:43 +05:30
milescovielloandClaude Opus 5.5 a7c68a3919 fix(libSceLibcInternal): fail posix_spawn with ENOENT when the program is not there
Dusklight (PPSA99305) aborts on main as soon as its Select disc image
item is chosen: SDL's file dialog probes "zenity --version" through
posix_spawnp, and posix_spawnp throws "process creation not implemented".

FreeBSD 11.4's posix_spawn returns the error of the child's exec, and
an exec of a program that is in no directory of PATH (_PATH_DEFPATH
when PATH is unset) fails with ENOENT. Both calls now return ENOENT
without writing the process ID when the program is not in the guest
file system, and keep throwing when it is. SDL then reports the file
dialog as unsupported and the title stays on its menu.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 18:31:37 +00:00
Nithishvelan M 39c430bd48 fix(libSceSystemGesture): validate gesture handle and recognizer in sceSystemGestureGetTouchEventByIndex 2026-10-18 00:01:22 +05:30
Nithishvelan M 9518b73656 fix(libSceSaveDataDialog.native): return NOT_RUNNING from progress bar updates when not running 2026-10-17 23:56:59 +05:30
Nithishvelan M 5a1039bbc1 feat(libSceVoiceQoS): implement sceVoiceQoSSetRemoteEndpointAttribute 2026-10-17 23:51:50 +05:30
Nicolas FalesyandClaude Opus 5.5 1ffffc318d feat(libkernel): export nmount
Prospero Themes (PPSA90210) imports nmount (3YnXspQNyw8) from libkernel
and fails to load without it:
"./app.elf: symbol lookup error: ./app.elf: undefined symbol: 3YnXspQNyw8".

Mounting file systems is not supported, so it throws if called, like
execvp does for executable replacement. The title opens its theme
library without calling it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Sovthwyu4H63RMbRVha2Sy
2026-10-17 14:08:53 -04:00
JJenkx b17406a33a fix(ngs2): return PS5 errors for invalid voice handles 2026-10-17 14:07:44 -04:00
Nicolas FalesyandClaude Opus 5.5 05b457d49a feat(libkernel): implement pthread_condattr_setpshared
PSFlyCast (PPSA99247) imports pthread_condattr_setpshared (3BpP850hBT4)
from libkernel and fails to load without it:
"./app.elf: symbol lookup error: ./app.elf: undefined symbol: 3BpP850hBT4".

The attribute stores PTHREAD_PROCESS_PRIVATE (0) or
PTHREAD_PROCESS_SHARED (1); a null or uninitialized attribute and any
other value return EINVAL without changing it, following FreeBSD 11
libthr thr_condattr.c and pthread_mutexattr_setpshared here. Sharing
across processes is not modeled, as for mutexes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Sovthwyu4H63RMbRVha2Sy
2026-10-17 14:06:11 -04:00
hugodearaujo ef622e2f8f feat(agc): import shared ranges whose backing offset is not 64 KiB aligned
A sparse import binds whole 64 KiB blocks, so a range whose memfd offset
is not a multiple of 64 KiB fell back to one UDMABUF_CREATE and, above
udmabuf's size limit, to copies. The sparse buffer now starts at the
block below the range: HostImport::lead holds that distance, the
import's device address points at the range itself, and every offset
into the import's buffer goes through HostImportOffset.
2026-10-17 15:03:33 -03:00
jagrat Singh 586028c991 feat(libSceVoice): implement sceVoiceGetResourceInfo 2026-10-17 23:26:26 +05:30
MarcZX100 a2ed4abead docs(dev): clarify guest clock scale coverage 2026-10-17 17:50:36 +00:00
MarcZX100 c732321bd3 docs(dev): describe the guest clock scale switch 2026-10-17 17:50:36 +00:00
thuanquangandClaude Opus 5.5 20502c0022 feat(agc): render 5_6_5 UNORM color targets
Goosebumps Terror in Little Creek (PPSA27305) aborts in gameplay with
"unsupported color format 16 number type 0 component swap 2": it renders
into a COLOR_5_6_5 UNORM target. The target now renders into
R5G6B5_UNORM_PACK16. AMD keeps X in bits 0-4 and Z in bits 11-15, and
Mesa's ac_translate_colorswap programs SWAP_STD_REV for a surface with
red in bits 11-15, so with SWAP_STD_REV the exports are written as they
are and with SWAP_STD they are written with X and Z exchanged, as for
1_5_5_5. The alternate swaps and other number types keep throwing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 23:59:26 +07:00
SandstromPLandClaude Opus 5.5 3dadf77121 fix(agc): draw a one-sample depth target under a multisampled rasterizer without MSAA_ENABLE as one sample
With #6014 merged, the first draw of METAL GEAR SOLID: Peace Walker's
(PPSA18216) opening movie stops on "the depth target's sample count
differs from the rasterizer's" (mrfelek on #6196). The state he reported
is a 4x PA_SC_AA_CONFIG, MSAA_ENABLE clear, a one-sample 1440x810 depth
target and no color target; on main alone it throws earlier, on "a depth
target". Like the one-sample color targets of bb877791a, such
a depth target, with or without one-sample color targets, is now drawn
as a one-sample draw at the pixel center, before the multisampled-target
check and instead of the sample-0 path, which needs MSAA_ENABLE.

Points, lines, alpha-to-coverage, a sample-mask export and DB_EQAA Z
interpolation or overrasterization throw on this path, and so do
PS_ITER_SAMPLE and ANCILLARY or SAMPLE_COVERAGE pixel inputs when the
pixel program runs. A skipped pixel program is replaced by the null
program, which uses neither.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 22:18:56 +05:30
simonbronk f0d68fb436 fix(libc): reject null secure scan destinations
Prevent reached null conversion destinations from crashing sscanf_s and vsscanf_s. Return EOF before writes and retain earlier assignments. Add regression coverage through both guest ABI entry points.

AI-assisted: yes (OpenAI Codex). Windows WinLibs GCC 15.2 Release: production baseline crashes with the new regression; fixed shared libc passes guest_scan_count, guest_formatting, guest_wide_formatting and guest_strings (4/4). Conventions pass. Full all-target build was deliberately stopped after 83s with 3691 pending targets, not completed. No title or console run; constraint-handler invocation remains unimplemented as documented. No performance or coverage-percentage claim.
2026-10-17 18:46:36 +02:00
unknown 7c71fc603a fix(libSceHttp): make URI escaping independent of host locale 2026-10-17 18:46:12 +02:00
milescovielloandClaude Opus 5.5 6e0886d76d perf(shader): drop the result flush of a product behind its tiny-product check
A v_mul_f32 in a FLOAT_MODE that flushes f32 denormals emits the
nearest-even tininess check, the NaN result selection and then a
result flush. The check already turns every product that rounds below
2^-126 into a zero of its sign, so the flush can't change what it
keeps. DenormalFlushEliminator now proves that: a select arm guarded
by the tiny-product check of the same denormal-free factors, an arm a
select takes only when its own bits are NaN, and an and with a mask
that has no significand bits are denormal-free.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 16:34:08 +00:00
Muhammad Wasif Ali WasifandClaude Opus 5.5 78cabf5dcd fix(libc): keep a drive-letter component of a guest path under its mount on Windows
A guest path is resolved by appending its components to the host root or
to a mount alias directory through std::filesystem::path. On Windows a
component such as "C:" that came first in the appended part was parsed as
a root name, so operator/ replaced the host directory instead of
appending: "/savedata0/C:/Windows/win.ini" and "/app0/../C:/Windows/win.ini"
resolved to "C:\Windows\win.ini", and "/C:/x" lost the component and
resolved to "<root>\x". A colon is an ordinary character in a FreeBSD
file name, so those names belong under the mount.

Guest paths are now split into component names and joined to the host
directory as text. Explicit native drive paths are still passed through.
On NTFS a name containing ":" still opens an alternate data stream; the
libc debt list now records it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 21:22:08 +05:00
ThatsLeo e14a4e5138 fix(shader): stop first-lane reads that reach themselves from recursing
MayEvaluate and the evaluator track the first-lane reads they are inside, so a read reached again through a loop-carried phi or a constant slot is not evaluable instead of recursing.
2026-10-17 18:11:28 +02:00
ThatsLeo 745cdb5bf7 perf(shader): judge first-lane and constant reads by what they read
MayEvaluate took ReadFirstLane and ReadConst as evaluable without looking at
their sources, so plans kept conditions behind per-lane values.
2026-10-17 18:03:33 +02:00
Dean 66702f1cff Merge pull request #7060 from Aryansh1520/fix/libc-backtrace-self-linux
feat(libc): implement sceLibcBacktraceSelf and GetBufferSize on Linux
2026-10-18 04:49:45 +13:00
Dean 7b763e6359 Merge pull request #7068 from AlexOfTheForest/fix/fopen-errno
fix(libc): translate host errno from fopen, freopen and fopen_s
2026-10-18 04:49:08 +13:00
XairRrR ac840ec7dd fix(agc): take a later slice's HTILE clear when every word has ZMask 0
A bind of slice 1 or later of a depth array read the slice's HTILE but took
its clear only when all its words were equal, because the HTILE word layout
of those slices is not modelled. Neither step needs the layout: the clear
is taken when every word of the range has ZMask 0 (a check over the set of
words), and the store-back rewrites each word in place from its own bits.
The value the surface is cleared to is DB_DEPTH_CLEAR, which the DB's depth
test reads for every cleared tile whatever its Min/Max Z (HTILE_Z_CLEAR_REG
in Mesa's src/amd/common/ac_descriptors.h), the same rule slice 0 already
follows.

PPSA05684 resets the four slices of its 2048x2048 D16 sun cascade array
every frame by writing ZMask 0 words with Min/Max Z 0 or 1 into their HTILE.
Slices 1 to 3 kept the previous frame's depth, and the main menu lost its
volumetric sun shafts and sunlit foliage.

agc_driver_depth_fast_clear_submit: slice 1 with words alternating 0x0 and
0xfffffff0 takes the clear, stores them back expanded and leaves slice 0's
HTILE alone. The refusal case keeps a word left expanded and is renamed.

AI-assisted: yes
2026-10-17 17:40:57 +02:00
David 26bc5ce87c Merge remote-tracking branch 'origin/main' into fix/netctl-default-route-macos
# Conflicts:
#	docs/dev/debt/libSceNetCtl.md
2026-10-17 19:31:46 +04:00
Destroyers212xandClaude Opus 5.5 10c1c24cea docs(relinker): record Rosetta instruction support on an M1 with macOS 26.6.2
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 11:22:28 -04:00
fma-rc 8f37cddff0 feat(agc): link calls through the AGC FS table 2026-10-17 16:47:09 +02:00
mattogepetoandClaude Opus 5.5 8f0caa1796 docs(libkernel): move the socket type debt entry away from other changes
The entry sat right after "connect to AF_UNSPEC", where the open #6884 adds
its own entry, so whichever merges second would conflict. Move it after the
mlockall entry, which no open pull request changes. The text is unchanged.

Written with AI assistance (Claude).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 16:41:52 +02:00
sebastian 3f5f84996a feat(ajm): resample interleaved s16 PCM through codec 23
Broken Sword - Shadow of the Templars: Reforged (PPSA21480) decodes its
audio itself and uses AJM codec 23 only to resample interleaved s16 PCM
from 44.1 to 48 kHz: every block initializes the instance with
0, 2, 44100, sets the ratio 0.91875 and decodes 235 frames into a
256-frame output. The run threw "AJM: decoding codec 23 is not
implemented".

A codec 23 run now consumes its whole input and emits every output
frame whose position lies inside it, with the Catmull-Rom of the
existing resampler. Cases the title does not show throw, among them a
run after a resampled run without a new initialize.
2026-10-17 16:40:32 +02:00
AlxcBTW c05b2567be perf(agc): replace the plane copies around a depth plane's UAV clear by a depth clear
A compute kernel that stores one colour to every texel of a storage image over a depth plane (a shadow atlas clear) copied
the whole plane depth image -> staging buffer -> mirror before the dispatch and mirror -> staging buffer -> depth image
after it, although the kernel reads nothing and writes every texel.

A dispatch of the 15-word 8x8x1 image clear kernel (direct, no partial last group) whose T# lies on a depth surface now
reads its colour from guest memory under the GPU mutex, the place the kernel reads it. When the dispatch covers the whole
plane, the plane is one layer of level 0, the colour is a value the plane's format holds exactly (0 or 1 for a 16-bit
unorm view, 0 or 0xffff for a 16-bit uint view, 0 or a normal float in (0, 1] for a 32-bit view) and nothing is waiting to
write the colour, the dispatch still writes the mirror but the copy-in is left out, and the copy-out becomes a clear of the
depth image to that value. The colour is read again when the copy-out is replaced; a changed value keeps the copy-out.
Every other dispatch, stencil planes and declined values keep both copies.

agc_driver_depth_clear_hle_tests runs the clear sequences with the clear taken and with the copies, and compares the depth
image texel by texel through the mirror, the guest memory and the depth tests.
2026-10-17 16:29:18 +02:00
Dean 83cbb70e2e Merge pull request #7142 from javierUDP/fix/system-python-compatibility
fix: keep the Python tools and tests on Python 3.9
2026-10-18 03:25:00 +13:00
mattogepetoandClaude Opus 5.5 a6c123ca4a fix(libkernel): return EPROTOTYPE for a socket type inet does not have
socket() returned EPROTONOSUPPORT for every socket type it does not create.
FreeBSD 11.4's socreate returns EPROTOTYPE when no protocol is found, the
protocol is 0 and the type is not 0, and EPROTONOSUPPORT when a protocol was
given. Its inet domain (in_proto.c) has SOCK_RAW entries in every kernel and
a SOCK_SEQPACKET entry only with SCTP, and no SOCK_RDM or other type.

Return EPROTOTYPE for a type the inet domain never has, such as SOCK_RDM,
with protocol 0. SOCK_RAW and SOCK_SEQPACKET keep EPROTONOSUPPORT, since
whether the console creates them is not known. Test the unknown types and
mismatched protocols for AF_INET and AF_INET6, and list the socket types and
families that are not created in the library's technical debt file.

Written with AI assistance (Claude).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 16:00:45 +02:00