Commit Graph
6138 Commits
Author SHA1 Message Date
Akhil MoolaandClaude Opus 5.5 ad56d004f2 fix(agc): accept a border colour table that no address mode reads
A sampler descriptor with BORDER_COLOR_TYPE 3 names an entry of the border
colour table, but the hardware reads it only through an axis that addresses
the border (clamp modes 4 to 7). DecodeSamplerResource threw for every
table border colour, so a sampler that clamps to the edge on all axes, as
PPSA21567's Armadillo Challenge 2 compute shader uses, stopped the title
although its border colour is never sampled. It now throws only when an
axis uses a border mode, the same rule the colour compare emulation
applies, and otherwise uses a fixed Vulkan border colour.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 12:49:24 -06:00
Chad d2a0b0f7af Merge remote-tracking branch 'upstream/main' into feat/http2-cookie-box
# Conflicts:
#	docs/dev/TechnicalDebt.md
2026-10-06 13:42:48 -05:00
ChadandClaude Opus 5.5 cef560ecaf docs: record the FreeBSD 11.0 assumption for process-shared barrier attributes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 13:41:05 -05:00
Chad ac91853ae1 Merge remote-tracking branch 'upstream/main' into feat/barrierattr-process-shared 2026-10-06 13:40:57 -05:00
Ethan Barr cd0e534db3 fix(relinker): reject malformed dynamic segments 2026-10-06 10:42:19 -07:00
MichonandClaude Opus 5.5 177a452c60 fix(shader): read relative SGPRs through a one-hot mux
s_movrels and s_movrelsd_2 read the source register through a chain of
selects keyed on the M0 offset, and the relative destination write is a
select between that value and the old register. When the old register
also appears in the chain, the NVIDIA compiler (RTX 5080, 610.74)
evaluates select(a, select(b, x, y), x) as select(a || b, y, x) instead
of select(a && !b, y, x), so s_movrelsd_2_b32 clobbered s13 whenever the
source offset was 3. Rewriting the select, a branch with a phi, a masked
xor or a small function array all fold back into the same form.

Build the read as an OR of select(offset == k, s[base + k], 0) terms, with
the base register used for offsets outside [1, count) as before. The
result is unchanged, and the select nesting the compiler mishandles no
longer forms.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-06 19:37:21 +02:00
Alidin 953e6ceacf feat(libSceNpManager): implement sceNpGetNpId
Report the user as signed out, as the other identity getters do, and reject a null NpId. The NpId is left untouched, as in shadPS4 and prosper.
2026-10-07 01:18:42 +08:00
Fishybeing c6a91e15fd docs: describe the barycentric fallback in TechnicalDebt accurately 2026-10-06 19:14:41 +02:00
Alberto RuizandClaude Sonnet 5.5 2cd813da97 test(json2): unwind guest_json_tests on Windows
The test now catches the exception that Parser::parse throws for a number
that overflows a double. Windows test executables need
configure_windows_unwind, as guest_png_dec_tests has, or the exception
cannot be unwound and the process terminates.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R5WJS4ZdQynAJesCZKH5hb
2026-10-06 19:04:20 +02:00
Alberto RuizandClaude Opus 5.5 bdeeb17326 fix(json2): throw on numbers that overflow a double
Whether the console's parser rejects 1e309 or stores an infinite real
is unknown, and RFC 8259 allows both. Following the exact-or-throw rule,
sce::Json::Parser::parse now throws with the number text and a note that
the behaviour is unverified, instead of returning JsonErrorParse. The
partially built tree is freed before the exception leaves the parser.
The case is listed under unknown function info in TechnicalDebt.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R5WJS4ZdQynAJesCZKH5hb
2026-10-06 18:37:38 +02:00
Alberto RuizandClaude Opus 5.5 be6c0cf3ec fix(json2): reject numbers that overflow to infinity
The parser stored strtod's result for 1e309 and similar numbers, so a
document with such a value parsed as an infinite real. Serializing it
then threw "cannot serialize a non-finite number", which escaped the
guest call and terminated the process. sce::Json::Parser::parse now
returns JsonErrorParse for a number that is not finite after conversion.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R5WJS4ZdQynAJesCZKH5hb
2026-10-06 18:37:26 +02:00
Adrià FranchandClaude 42ab8af70e feat(shader): implement s_bfe_i64
Co-Authored-By: Claude <[email protected]>
2026-10-06 18:21:25 +02:00
Claude c10401e390 feat(agc): detile 3D textures in SW_64KB_Z_X and SW_64KB_S_X
3D textures in the 64 KiB Z and S XOR swizzles threw. As in AMD
addrlib's GFX10 rules, a Z_X volume is thin: each depth slice is laid
out like an array slice with the 2D Z_X equation, as the R_X and D_X
volumes already were. An S_X volume is thick: it takes the standard
64 KiB thick block and mip tail with its own S3 XOR equation, generated
from addrlib for the same configuration as the other equations.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 16:19:11 +00:00
Adrià FranchandClaude 05de11ac1e feat(libSceAjm.native): implement sceAjmBatchJobGetInfo
Co-Authored-By: Claude <[email protected]>
2026-10-06 18:01:46 +02:00
PacukaandClaude Opus 5.5 30a6e03636 fix(trophy2): accept a null data or details in sceNpTrophy2GetGameInfo
The Smurfs Dreams (Unreal Engine) asks only for the game details and
passes a null data pointer; on success it reads the trophy count from the
details, on a negative result it takes its error path. The function
already fills each output only when it is given, but rejected the call
unless both were. Only a call without either output is rejected now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 17:58:35 +02:00
Claude fef66c1406 feat(agc): implement 1D array textures
A T# of type 12 (1D array) threw while decoding. It now decodes to a
1D array dimension, checked like a 2D array with a height of one, and
holds depth + 1 layers laid out as a 2D array's. Its Vulkan image is
1D with that many layers, viewed as VK_IMAGE_VIEW_TYPE_1D_ARRAY for
sampling and storage, and the recompiler declares a 1D array shape for
arrayed 1D image resources instead of failing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 15:56:14 +00:00
Claude f6ce77bb7f feat(shader): accept texel offsets in 1D gathers
image_gather4_lz_o on a 1D view threw. The 1D gather emulation picks
the two texels around the coordinate itself, so the 6-bit x offset of
the address is added to the left texel index before both texel
centres are sampled, as the hardware offsets the footprint.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 15:49:37 +00:00
PacukaandClaude Opus 5.5 b06278d96c fix(audiodec): build libSceAudiodec.native from the libSceAudiodec sources
Titles that link the native module (The Smurfs Dreams imports
sceAudiodecClearContext and the other decoder exports from
libSceAudiodec.native) found only the dummy export there. Both modules
are now built from the same sources, as libSceFont and libSceAvPlayer
already do for their native modules.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 17:48:38 +02:00
gookie c80d01cff4 feat(libScePad): declare the VR controller exports
scePadVrControllerRead and scePadVrControllerGetDeviceInformation are
imported by titles that open PSVR2 Sense controller port types. No
library exported them, so eager binding failed at startup.

Declare them as throwing stubs: the VR controller port types are not
supported, and scePadOpen already rejects them.
2026-10-06 17:02:06 +02:00
Claude 16e76301ab feat(libSceAgc): implement the WRITE_DATA destination and cache policy patches
sceAgcWriteDataPatchSetDst, sceAgcWriteDataPatchSetCachePolicy, their
Async forms and sceAgcAsyncWriteDataPatchSetAddressOrOffset threw. They
now rewrite a WRITE_DATA packet in place: the destination in the
graphics (sceAgcDcbWriteData) or compute (sceAgcAcbWriteData) encoding,
the cache policy in bits 25-26 and the address in dwords 2-3, so the
patched packet equals the one written with those values. A register
destination is rejected when the packet requests write confirmation,
as when the packet is written.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 14:51:07 +00:00
alfalfa-starandClaude Opus 5.5 6b6b93e26b fix(agc): accept indirect register placeholders without an address
Unreal Engine reserves SET_*_REG_INDIRECT packets with a null register
list and no registers, and fills them in later with the
sceAgcSet*RegIndirectPatch* functions. The writers rejected the null
address. A null list is now accepted when it holds no registers, which
reads nothing; a null list with registers still throws.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 16:16:23 +02:00
alfalfa-starandClaude Opus 5.5 98ed835123 feat(agc): run COND_INDIRECT_BUFFER branches whose comparison always passes
PPSA14632 (Unreal Engine) writes sceAgcCbBranch(mode 1, compare
function 0, mask 0, reference 0) with a then buffer and a null else
buffer of 0 dwords. It leaves the compare address uninitialised, so it
is sometimes only 4-byte aligned. The writer rejected the null else
buffer and the misaligned compare address, and the driver accepted
opcode 0x3f only as the 4-dword INDIRECT_BUFFER, so the 14-dword branch
would have failed at submission.

sceAgcCbBranch no longer checks the compare address of an always-pass
branch, which reads nothing, or the address of a buffer of 0 dwords.
The driver runs the first buffer of an always-pass COND_INDIRECT_BUFFER
in modes 1 and 2 (if-then and if-then-else) in place of the packet. A
comparison, a predicated branch and other modes throw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 16:12:31 +02:00
Claude 8d7ff94689 feat(libSceKeyboard): translate the 106-key arrangement in sceKeyboardGetKey2Char
The 106-key (Japanese) arrangement threw. Its alphanumeric layer now
follows the JIS layout of the HID usages: the symbol keys right of the
digits and letters, the Ro key (0x87) and the Yen key (0x89). With the
Kana LED set it still throws, as the kana the console returns are
unknown.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 14:02:11 +00:00
MerijnandClaude Opus 5.5 3cd2ff9140 fix(libkernel): take a redirected delivery from rsp and the live registers
A thread suspended inside a system call returns through sysret, which
overwrites rcx and r11, so the delivery address passed in rcx was
garbage when the redirected thread resumed. PPSA12544 crashed that way
on its SaveDataProcessQueue thread, blocked in a host wait when Unity's
GC raised SIGUSR1. The redirected rip is now an entry stub that takes
the delivery from its fixed place above rsp. It also stores the live
general registers into the delivery's context first: the snapshot taken
while the thread was in the system call still holds the call number in
rax instead of its result, which the restore would have handed back to
the wait.

The guest test raises at a thread blocked on a host mutex in 20 rounds
and expects each delivery once the wait returns; it fails without this
change.

AI-assisted: yes

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 15:41:25 +02:00
alfalfa-starandClaude Opus 5.5 0ec3061a46 fix(recompiler): merge a loop selection where its other arm joins or leaves
A selection inside a loop whose arm either joins the other target or
continues/breaks (`if (a) { if (b) continue; x; }`) got the nearest
common post-dominator as its merge. When the loop exits after the outer
join, that is the outer selection's merge, so both selections shared
it. splitSharedMergeBlocks then inserted a forwarding block in front of
it, recomputed the same merge, and repeated until the budget ran out:
PPSA14632's compute shader 0x1a80ee0000 stopped with "CFG shared merge
splitting exceeded budget: originalBlocks=92 currentBlocks=460".

findSelectionMerge now picks the joined target when the other arm is a
conditional block with the header as its only predecessor, and every
successor of that arm is the joined target or the loop's continue or
merge block. The shader structures with 13 added blocks and no clones
or route variables.

In the result the outer selection header dominates the loop's continue
target, so the test's verifyStructured counted the continue target as a
selection member that branches outside (back to the loop header).
SPIR-V uses structural dominance, where the loop header's edge to its
continue target keeps it out of the selection, so verifyStructured now
skips the continue construct of an enclosing loop. spirv-val accepts
the new test's SPIR-V for both subgroup sizes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 15:31:45 +02:00
MerijnandClaude Opus 5.5 736ba56d85 fix(avplayer): deliver the frame at a jump while paused
A paused player returned no video at all. Unity's video player prepares
a clip by starting it, pausing, jumping to the start and polling
sceAvPlayerGetVideoDataEx until the frame at the jump arrives, and only
then resumes; PPSA12544 waited there forever on a black screen in its
intro cinematic. While paused, the first frame after a jump is now
delivered (the paused clock rebased to it); other frames are still held
until the player resumes. The guest test pauses, jumps and expects that
one frame and nothing after it.

AI-assisted: yes

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 15:20:51 +02:00
Adrià FranchandClaude 04ed454f75 feat(libSceSystemService): implement Disable/ReenableMusicPlayer
Co-Authored-By: Claude <[email protected]>
2026-10-06 15:16:45 +02:00
Adrià FranchandClaude c7abfa89b2 feat(libSceRazorCpu): implement sceRazorCpuFlushOccurred
Co-Authored-By: Claude <[email protected]>
2026-10-06 15:12:53 +02:00
Adrià FranchandClaude 7389b2581f feat(libc): implement std::_Fiopen
Co-Authored-By: Claude <[email protected]>
2026-10-06 15:09:04 +02:00
Fishybeing 38824ec524 fix(http): count sceHttpParseStatusLine as implemented
Its only NotImplemented_nid_no_patch call guarded the int range limit on the consumed byte count, so tools/progress.py listed the implemented function as missing. Throw std::out_of_range like sceHttpParseResponseHeader does for the same limit.
2026-10-06 14:57:53 +02:00
Fishybeing 5f1c45c223 fix(libkernel): correct the MemoryPool.hpp include guard
The guard tested CORE_LIBS_PRX_LIBKERNEL_... but defined CORE_LIBS_PRX_LINKERNEL_..., so it never took effect and GCC reports -Wheader-guard.
2026-10-06 14:57:51 +02:00
Fishybeing 5a04d3cc9e build(windows): guard NOMINMAX before including windows.h
Four sources defined NOMINMAX unconditionally, which redefines the macro the build already passes and warns on every MinGW build. Use the #ifndef guard the rest of the tree uses.
2026-10-06 14:57:48 +02:00
Adrià FranchandClaude a546bbef93 feat(libc): implement collate<char>::_Getcat
Co-Authored-By: Claude <[email protected]>
2026-10-06 14:53:47 +02:00
Adrià FranchandClaude 99260427f4 feat(libc): support %n in wide formatting
Co-Authored-By: Claude <[email protected]>
2026-10-06 14:45:44 +02:00
Celegans12 5e18e84f33 feat(ajm): implement sceAjmBatchJobControl
sceAjmBatchJobControl threw. It now appends a control job that keeps
the sideband input pointer and runs at sceAjmBatchStart: RESET (bit 13)
clears the context as sceAjmBatchJobClearContext does, INITIALIZE
(bit 14) initializes the codec, and SIDEBAND_GAPLESS_DECODE (bit 45)
overwrites the gapless total and skip counts, in this order.

The sideband input holds the gapless decode first, then the codec's
initialize parameters: 8 bytes for ATRAC9, 12 for Opus, none for MP3.
The output is the 8-byte result. Other flags, INITIALIZE for other
codecs, and other sizes throw. SIDEBAND_GAPLESS_DECODE without RESET
throws too: RPCSX and shadPS4 keep zero counts there. The bits and the
order follow shadPS4 (PS4), the overwrite with RESET follows RPCSX, and
the sizes follow the one title seen.
2026-10-06 14:45:10 +02:00
alfalfa-starandClaude Opus 5.5 b6176624aa fix(pad): return INVALID_HANDLE from scePadReadState for an unknown handle
PPSA14632 calls scePadReadState (eboot 0x4593a8) for the open pad and
then for a second pad slot it never opened, whose handle is 0. The
title skips only negative handles and ignores the result, but
scePadReadState threw for any handle other than the open one. It now
returns PAD_ERROR_INVALID_HANDLE (0x80920003), as the other pad
functions do and as shadPS4's scePadRead does for an unknown handle;
scePadRead passes it on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 14:43:00 +02:00
Adrià FranchandClaude 5784515e13 fix(libs): use the referenced NGS2 handle and session signaling argument error codes
Co-Authored-By: Claude <[email protected]>
2026-10-06 14:39:02 +02:00
alfalfa-starandClaude Opus 5.5 70864694d3 fix(audioout): accept a 3D latency of 1 in sceAudioOut2Set3DLatency
PPSA14632 calls sceAudioOut2Set3DLatency(0xFF, 1) during its audio
setup (eboot 0x5613e2c) and fails the setup on a nonzero return. Only
latency 2 from PPSA26344 was accepted, so the call threw. Latency 1 and
2 are now accepted for the system user; 0, 3 and other users still
throw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 14:36:20 +02:00
Adrià FranchandClaude 109f120595 feat(kernel): apply the memory type in sceKernelMtypeprotect
Co-Authored-By: Claude <[email protected]>
2026-10-06 14:32:47 +02:00
Adrià FranchandClaude ca6557aed1 feat(kernel): reject invalid sceKernelBatchMap2 entries with EINVAL
Co-Authored-By: Claude <[email protected]>
2026-10-06 14:27:48 +02:00
Adrià FranchandClaude fe557fb0e2 feat(kernel): lazily initialize the adaptive static mutex initializer
Co-Authored-By: Claude <[email protected]>
2026-10-06 14:23:25 +02:00
Adrià FranchandClaude 1311e6e455 feat(kernel): support getrusage RUSAGE_THREAD on Linux
Co-Authored-By: Claude <[email protected]>
2026-10-06 14:19:40 +02:00
Adrià FranchandClaude 263cb6626c feat(jpegenc): honor the encode restart interval
Co-Authored-By: Claude <[email protected]>
2026-10-06 14:16:07 +02:00
Adrià FranchandClaude 803f1b0e71 feat(videodec2): implement sceVideodec2GetAvcPictureInfo
Co-Authored-By: Claude <[email protected]>
2026-10-06 14:11:24 +02:00
Adrià FranchandClaude 232719f9f8 feat(libs): implement sceWebBrowserDialogGetStatus
Co-Authored-By: Claude <[email protected]>
2026-10-06 14:06:52 +02:00
Yossi Yadgar e998b2dd66 feat(agc): choose the Vulkan device by name with ANYPS5_GPU 2026-10-06 14:55:12 +03:00
Adrià FranchandClaude f617b40a45 feat(tools): add a hardware oracle for RDNA instruction semantics
Co-Authored-By: Claude <[email protected]>
2026-10-06 13:54:28 +02:00
Slick Daddy d2d96ad5cc style(cmake): restore indent on test foreach in BUILD_TESTING block 2026-10-06 14:45:28 +03:00
Aryan RawatandClaude Opus 5.5 8ef51df303 feat(playerinvitationdialog): implement scePlayerInvitationDialogGetResult
scePlayerInvitationDialogGetResult makes the common dialog checks of
sceWebBrowserDialogGetResult: NOT_INITIALIZED before the dialog is
initialized, ARG_NULL for a null result and NOT_FINISHED until the
dialog finishes. The dialog shows no UI and sends no invitation, so the
finished dialog reports USER_CANCELED with error code 0. The 40-byte
result layout (error code, result, 32 reserved bytes) is taken from
SharpProspero.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 11:42:02 +00:00
ahirm-finarth 29888493b5 fix(shader): preserve pixel export mappings in replay 2026-10-06 16:41:45 +05:30