Commit Graph
8546 Commits
Author SHA1 Message Date
Slick Daddy abf83aa4a8 feat(libSceVideodec): implement the video decoder on top of libSceVideodec2
libSceVideodec's five exports were stubs that threw. Decoder creation,
decoding, flushing, resetting and deleting are implemented with the
structure layouts of shadPS4's PS4 library, and the decode runs through
libSceVideodec2, which decodes H.264 with FFmpeg. The picture is copied
into the caller's frame buffer with the pitch aligned to 64 and the coded
height, the chroma after the luma rows, and the picture information holds
the timestamps and the crop offsets.

A guest test decodes the H.264 fixture through the library and checks the
pictures against the reference hashes.
2026-10-20 00:17:11 +03:00
juanpimg 2f0ed638dc feat(prx): declare the missing PS5 3.20 system exports
AnyPS5 resolves a title's imports by NID, so a title that imports a system
function no library provides fails to load with an unresolved import. The
PS5 3.20 export inventory lists 193 such exports across 37 PS5 system
libraries AnyPS5 implements but does not provide.

Declare them as throwing stubs so those titles load and reach their next
blocker. Each declaration calls NotImplemented_nid_no_patch and returns 0;
none of them implements the function. Declarations with a credible
prototype use it and cite the source with a pinned commit, and the rest
are declared without parameters, which resolves the import without making
an ABI claim. The technical-debt files record the limitation per library.

libSceMbus and libSceSystemService are left out because pull request #7821
declares them. libSceAgc is left out because its exports are versioned, so
the 3.20 NID names a different symbol from the one AnyPS5 ships.
libSceAvPlayer.native is left out because it compiles libSceAvPlayer's
Export.cpp.

Names and NIDs come from the PS5 3.20 export inventory at
https://github.com/DNNDHH/PS5-3.20_Libs/tree/b2a77c09cd71c01f34c790cfbe98c751a13262ad
2026-10-19 23:16:55 +02:00
David 84746e14d8 Merge remote-tracking branch 'origin/main' into feat/libkernel-jit-shared-memory-macos
# Conflicts:
#	docs/dev/debt/libkernel.md
2026-10-20 01:09:38 +04:00
Yossi Yadgar 3bdd430a32 docs(debt): note a float color export into a uint target is accepted 2026-10-20 00:07:54 +03:00
XairRrR 0e9d052541 Merge main into pr-7154
# Conflicts:
#	core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
2026-10-19 23:07:50 +02:00
Dean Galvin 5e88d5f83e Merge main into pr-6730
# Conflicts:
#	core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
#	core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
#	docs/dev/debt/libSceAgcDriver.md
2026-10-20 09:56:39 +13:00
Dean 3756c72dc6 Merge pull request #6479 from EagleBearerYS/perf/agc-host-import-blocks
perf(agc): take the host import budget from the device's memory budget
2026-10-20 09:52:09 +13:00
Dean 524259954a Merge pull request #6457 from EagleBearerYS/perf/agc-host-import-aligned-blocks
perf(agc): import adjacent host ranges as aligned blocks and stop re-trying budget refusals
2026-10-20 09:51:55 +13:00
David ba9991c648 docs(debt): record triangle strips through the barycentric tessellation stages 2026-10-20 00:39:46 +04:00
mugurc 7701a9b9da feat(libkernel): UDP sockets and name resolution on macOS hosts
The guest socket layer relies on a few Linux calls:

- The equeue wait uses poll with the timeout rounded up to a millisecond;
  macOS has no ppoll.
- A readable stream socket whose peer closed is reported with POLLHUP by
  peeking one byte; macOS has no POLLRDHUP.
- FIONREAD on a datagram socket, and the byte count that fstat and kevent
  report for it, is SO_NREAD, the size of the next datagram; macOS adds the
  source address to FIONREAD.
- socketpair throws for SOCK_SEQPACKET, which has no AF_UNIX pair on macOS.
- gethostbyname replaces gethostbyname_r, which macOS lacks.

The UDP test sends on its connected socket without an address, as #7475
does, because macOS, like FreeBSD, fails sendto with an address on a
connected socket with EISCONN. The log test uses a datagram pair with
enlarged buffers instead of SOCK_SEQPACKET.
2026-10-19 23:36:56 +03:00
Alexej Szpevák 675ff30898 feat(libc): scan 16-bit wide conversions in the sscanf family on Linux
sscanf, vsscanf, sscanf_s and vsscanf_s threw on Linux for %ls, %lc, %l[, %S and %C, because glibc stores a 32-bit wchar_t per character into the guest's 16-bit buffer. ScanGuest, the per-directive scanner the _s forms already use, now scans those fields itself: the input is decoded as UTF-8, mirroring the narrow printf family's UTF-8 output, and each character is stored as one 16-bit unit, the width and the _s size counting characters; %ls skips leading white space and stops at the next, %l[ matches an ASCII scanset with ranges and negation, and a %lc field that meets the end of the input early keeps what it read, as FreeBSD's convert_wchar does. sscanf and vsscanf route a format with a wide conversion through ScanGuest and keep the host path otherwise. The UTF-8 decoding and scanset matching live in ScanWideField.cpp, which throws for input that is not UTF-8, a character outside the BMP, a scanset member outside ASCII and positional arguments next to a wide conversion; wide conversions in fscanf still throw.
2026-10-19 22:30:07 +02:00
Dean Galvin adf8e05f46 Merge main into pr-7042
# Conflicts:
#	core/shader/recompiler/Translation/include/Translation/TranslationContext.hpp
#	core/shader/recompiler/Translation/src/Float64Instructions.cpp
#	docs/dev/debt/shader.md
2026-10-20 09:25:06 +13:00
Dean 6d89a7bd8a Merge pull request #7036 from thuanquang/fix/f64-rounding-denormal-flush
fix(shader): flush f64 floor, ceil, fract and frexp denormal inputs
2026-10-20 09:22:37 +13:00
Dean 6b981a212c Merge pull request #7675 from valenciana-nc/fix/recvmsg-guest-validation
fix(libkernel): fail recvmsg with EFAULT on guest memory it cannot read or write
2026-10-20 09:21:54 +13:00
Adrià 12ee57a39b Merge pull request #7396 from ErenYeager1836/fix/playgo-dialog-get-result-not-finished
fix(libScePlayGoDialog): return error for uncompleted dialog in scePlayGoDialogGetResult
2026-10-19 22:18:46 +02:00
Adrià 602d8e66b1 Merge pull request #7429 from ps54all/feat/shader-ds-ordered-count-swap
feat(shader): model ds_ordered_count swap
2026-10-19 22:17:42 +02:00
Dean Galvin f1ac3be50c Merge main into pr-6557
# Conflicts:
#	core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
2026-10-20 09:15:59 +13:00
0xcrstnandClaude Opus 5.5 1a4d738912 fix(shader): fault when a lane selects a folded or invalid descriptor web arm
A path of a descriptor web whose dwords depend on the program counter, EXEC
or a lane mask selected the first descriptor, and an image arm whose words
are not a T# was bound as a null image. Both are assumed never to be taken,
but nothing reported it if a lane took one, so a wrong image or zeros went
unnoticed.

The folded path now gets its own selector value, which still selects the
first descriptor and records an InvalidDescriptor BDA fault (new IR
DescriptorFault) when a lane reaches the read with it. An image arm is
checked in the shader with the words the selected arm read: not a null
descriptor, and a TYPE from 2 to 7 or a FORMAT outside the GFX10 image
format table records the same fault with the arm's first two words. Both
faults are recorded only for lanes the image instruction's EXEC enables. The
materializer binds a null image only for exactly those words; any other
invalid arm is refused as before. The GFX10 format ranges are shared
between both checks. A web whose every path is folded no longer leaves its
selector Phis in the program.

Only reads split through a descriptor web bind the fault buffer, which
keeps their dispatches out of pipelined dispatch and stencil replay; splits
along incoming edges keep requiring a valid T# and bind none. The debt entry and
the APS5_STRICT_DESCRIPTOR_WEBS row say so, and note that a shader that
also uses an image table reads its fault buffer back only when a table
record is poisoned.

The descriptor Phi and undefined format tests expect the fault buffer only
for descriptor webs, and a T# shared by every arm of a split S# must stay
mandatory. agc_driver_descriptor_web_faults dispatches a web with two SRT
arms, each over its own texture, and a program-counter path: a lane on
either valid arm reads that arm's texture without a fault, a lane on the
folded path or on an undefined arm faults at the read, and nothing faults
or is written with EXEC empty.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 23:08:34 +03:00
0xcrstnandClaude Opus 5.5 d959b84152 fix(shader): treat a T# whose format is not a GFX10 image format as invalid
validImageDescriptor accepted any nonzero FORMAT, so words that are no T#
passed whenever their TYPE nibble was 8 or more. An optional descriptor web
arm holding such words was then not bound as a null image, and the dispatch
failed on a sampled image of an unsupported format instead. PPSA23566
(UFC 6) has such an arm (formats 402-463): a compute shader picks one of 32
SRT T#s through an s_setpc_b64 jump table indexed by min(i, 32), and the
default entry reaches the image_sample_lz with the loop-entry value of the
T# registers, which a constant-buffer load filled with floats. The console
never samples that arm: the default entry is taken only from iteration 32
on, when the registers hold iteration 31's T#.

A FORMAT outside the GFX10 image format table (Mesa gfx10-rsrc.json
GFX10_FORMAT: 1-77, 128-154, 156-182, 265-292) now makes the descriptor
invalid. An optional descriptor web arm is bound as a null image, as other
invalid arms are; a direct image is refused as invalid unless it is a null
descriptor, and an image table entry faults when selected with the
InvalidFormat reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 23:08:34 +03:00
0xcrstnandClaude Opus 5.5 70f7069fd0 fix(shader): fold descriptor web paths that hold EXEC or a lane mask
The descriptor web fold covered only program-counter values. PPSA23566
(UFC 6) compute shader 0x1163c84000 also has a path whose T# registers hold a
lane mask accumulated in a loop ("a Phi that does not resolve to one value:
Phi(CompositeExtractU32x4(Ballot(FPUnordGreaterThanEqual32), ...), BitwiseAnd32(...))"),
and throws on it while a career fight loads.

Treat EXEC and Ballot results like the program counter, also through loop
Phis: such a path selects the first descriptor, as before f5ba4e9c6.
Unwritten registers keep their own image. APS5_STRICT_DESCRIPTOR_WEBS=1
throws as before. The descriptor Phi test expects the program-counter, EXEC
and compare-mask entries to plan the loop's two SRT T#s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 23:07:31 +03:00
0xcrstnandClaude Opus 5.5 16a2da03fa fix(shader): fold descriptor web paths that hold the program counter
f5ba4e9c6 made a T# split across SRT descriptors throw when one path's
descriptor dwords depend on the program counter. Such a path appears when a
loop's entry edge reaches the read with registers left from s_getpc_b64; a
descriptor built from the program counter is garbage on hardware too, so the
path does not reach the read in a working title. PPSA23566 (UFC 6) throws on
this for compute shader 0x1163c84000 while loading a career fight ("descriptor
web: a descriptor dword depends on the program counter").

Select the first descriptor on such a path again, as before f5ba4e9c6, for
program-counter values only; EXEC and compare-mask values still throw.
APS5_STRICT_DESCRIPTOR_WEBS=1 throws as before. The descriptor Phi test now
expects the program-counter entry to plan the loop's two SRT T#s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 23:07:30 +03:00
Adrià cde1ffdedd Merge pull request #7254 from gjonn/feat/agc-layered-2d-array-color-views
feat(agc): render layered draws into 2D array color views
2026-10-19 22:05:15 +02:00
Adrià 7fe0790e59 Merge pull request #7388 from pushkarreddyy/feat/recompiler-waterfall-image-table
feat(recompiler): support waterfall select conditions and key bounds in pointer image tables
2026-10-19 22:04:09 +02:00
Dean f1861e4141 Merge pull request #7855 from KernelPanicNT/fix/pngdec-create-max-width
fix(libScePngDec): reject a maximum image width above 1000000
2026-10-20 08:52:31 +13:00
Adrià dfd22c1887 Merge pull request #7428 from mrfelek/fix/ngs2-setup-clears-callback
fix(libSceNgs2): clear the voice callback on sampler and mixer setup
2026-10-19 21:52:05 +02:00
Dean aea539e17a Merge pull request #7854 from KernelPanicNT/fix/userservice-initialize-priority
fix(libSceUserService): check the thread priority on initialization
2026-10-20 08:51:52 +13:00
Adrià f745930f03 Merge pull request #7413 from thuanquang/fix/table-call-hoisted-descriptor
fix(shader): link a table call whose descriptor load sits before its loop
2026-10-19 21:50:42 +02:00
voidlakhan 0d24f581f4 docs(ampr): preserve existing debt entries 2026-10-19 19:47:08 +00:00
Johan David e4898783b6 feat(agc): sample the draw committer with APS5_SAMPLE_COMMITTER
Queue 0's draw committer records the draws the packet worker hands
over. When the worker's APS5_SAMPLE_WORKER stacks wait in
DrawPipeline::Enqueue, the committer is the thread that bounds the
frame, and only APS5_SAMPLE_THREADS sees it: 40 addresses, 12 frames
deep, without whole stacks.

APS5_SAMPLE_COMMITTER=<file> attaches the worker's sampler to the
committer when its thread starts and writes the same two files. Both
use one start function, and StopWorkerSampler stops both.
2026-10-19 14:45:14 -05:00
XairRrR a1c0f34f4b Merge main into pr-7154
# Conflicts:
#	core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
2026-10-19 21:43:06 +02:00
Leonardo 2b64ff202c Merge branch 'main' into feat/voiceqos-packet-attribute 2026-10-19 21:42:23 +02:00
Adrià 8075b6af19 Merge pull request #7398 from ErenYeager1836/fix/login-dialog-close-status
fix(libSceLoginDialog): transition to finished on dialog close
2026-10-19 21:38:18 +02:00
Adrià d10ef4d2c6 Merge pull request #7381 from thuanquang/fix/volume-array-sample
fix(shader): sample a 3D T# through DIM 2D_ARRAY as a volume
2026-10-19 21:38:12 +02:00
XairRrR ed599f525b fix(agc): serve sampled views of arrays past maxImageArrayLayers from their viewed slices
The sampled lookup kept the whole array's layer count: a texture over an
array of more than maxImageArrayLayers layers read and snapshotted the
whole surface and then threw in the Texture constructor, on every lookup,
even when the descriptor viewed a few slices. A menu that samples a
16x16 array of up to 8065 layers through its image tables spent
~55 ms per frame reading those surfaces only to reject them.

cachedTexture now applies the window the storage path uses
(StorageArrayWindow, renamed ArrayLayerWindow since both paths use it):
a view whose slices fit the limit is served as an array of its own
starting at its first slice, and a view whose slices alone exceed the
limit throws before anything is read. A 2D image is one layer whatever
its last array field holds and is no longer refused by the storage path.

agc_driver_image_array_window_past_layer_limit samples and loads three
slices at 8100-8102 of an 8103-layer 1D array (before: "a texture array
with more layers than maxImageArrayLayers is not implemented") and checks
that a view of all its layers is refused with the window's error on a
device whose limit is lower.

AI-assisted: yes
2026-10-19 21:37:26 +02:00
XairRrR ae8500deb8 fix(agc): pass 3D storage volumes through StorageArrayWindow unchanged
A volume's depthOrLastArray is its depth, bounded by maxImageDimension3D,
not by maxImageArrayLayers: a 2049 to 4096 deep volume is a valid image
and threw since the window was introduced. Reported by Dextroid17.

AI-assisted: yes
2026-10-19 21:36:46 +02:00
XairRrR 3b6f6359f7 fix(agc): serve storage views of arrays past maxImageArrayLayers from their viewed slices
A PS5 array may hold up to 8192 layers; Vulkan devices allow fewer (2048 on
NVIDIA). A storage view of such an array created its whole image, with more
layers than the device allows: vkCreateImage is then invalid
(VUID-VkImageCreateInfo-arrayLayers-02256) and a store into a layer the device
did not back faults the GPU. Uncharted: Legacy of Thieves Collection (PPSA05684) views a 16x16 RGBA8
array of up to 7809 layers in slices of a few hundred to 2048 in its
orphanage chapter, which lost the device (Xid 109, write invalid) a few minutes in.

StorageArrayWindow describes the viewed slices as an array of their own
starting at the first viewed slice when the whole array is past the limit;
a non-XOR swizzle does not depend on the slice index, so the slices detile
alike. Views whose slices alone exceed the limit, XOR swizzles that mix in
the slice, and any other image past the limit now throw instead of creating
an invalid image.

AI-assisted: yes
2026-10-19 21:36:46 +02:00
Adrià f39852fd41 Merge pull request #7397 from ErenYeager1836/fix/npauth-authorized-app-dialog-close-status
fix(libSceNpAuthAuthorizedAppDialog): transition to finished on dialog close
2026-10-19 21:36:12 +02:00
Adrià 7866e7d97c Merge pull request #7394 from ErenYeager1836/feat/vr-setup-dialog-get-status
feat(libSceVrSetupDialog): export sceVrSetupDialogGetStatus
2026-10-19 21:33:59 +02:00
Adrià 67e5c8a48f Merge pull request #7403 from milescoviello/fix/fcntl-host-socket
fix(libkernel): handle fcntl and FIONREAD on a host socket descriptor
2026-10-19 21:30:50 +02:00
Adrià d7e62d8e25 Merge pull request #7258 from Pipodi/fix/sampled-array-viewed-slices
fix(agc): build sampled array views from the slices they read
2026-10-19 21:16:23 +02:00
ntamas94andClaude Opus 5.5 ad52647cd9 fix(libSceNet): parse sceNetInetPtonEx IPv4 text as the PS4 does
On PS4 firmware 10.71 sceNetInetPtonEx reads IPv4 text the way
inet_aton does, not the way sceNetInetPton does: "1.2.3" is 1.2.0.3,
"127.1" is 127.0.0.1, hex and octal parts are accepted, a part value
wraps at 32 bits ("1.4294967296" is 1.0.0.0) and the text ends at the
first whitespace. Two differences from BSD inet_aton were measured: a
part starting with "09" is decimal ("0989" is 989), and an octal part
containing 8 or 9 fails.

The flags argument changed nothing for 0, every single bit up to
0x100, 0x10000, 0x80000000 and -1, so it is ignored instead of
throwing. IPv6 still converts as sceNetInetPton does, which matches
the console.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 21:10:55 +02:00
Adrià c0adf025b8 Merge pull request #6815 from JJenkx/fix/msaa-load-on-plane
fix(shader): read 2D textures through MSAA image loads
2026-10-19 21:07:00 +02:00
thuanquangandClaude eeb1c4f034 fix(agc): sample formats that FORCE_DEGAMMA leaves unchanged without it
Co-Authored-By: Claude <[email protected]>
2026-10-20 01:58:42 +07:00
battleblob1andClaude Opus 5.5 f4a4b8aea9 fix(recompiler): replay every eight-bit stencil reference a pixel shader may export
Without VK_EXT_shader_stencil_export (NVIDIA), stencil reference exports
are emulated by replaying the draw once per value. An export the prover
could not bound to at most 16 values was refused. The replay shader
compares the export's low eight bits, so an unbounded export now
replays all 256 values, and proven values are reduced to their low
eight bits as the comparison sees them.

Refs #4276

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 21:57:24 +03:00
Sergio ec2e056d50 feat(libSceRtc): implement process-local clock setters 2026-10-19 20:55:33 +02:00
klosixgaming-arch f8f797282d fix(agc): accept PA_CL_CLIP_CNTL CLIP_DISABLE without depth clamp
DecodeState and DrawRejection rejected PA_CL_CLIP_CNTL bit 16
(CLIP_DISABLE), skipping draws that set it. Vulkan handles viewport
guard-band clipping automatically without requiring explicit clip
toggles. Accept bit 16 in ClipControlMask without altering depthClamp,
and record the unmodelled console clipping behavior in technical debt.

Tested with agc_driver_graphics_tests.
2026-10-19 13:43:12 -05:00
Adrià d07148f69f Merge pull request #7321 from jagrat04/feat/libSceVoiceQoS-firmware-exports
feat(libSceVoiceQoS): export missing firmware functions from database
2026-10-19 20:41:11 +02:00
Adrià 965dc2d78c Merge pull request #7298 from eliyarson/feat/videoout-telemetry
feat(videoout): write pad and present telemetry to APS5_VIDEOOUT_TELEMETRY_DIR
2026-10-19 20:40:04 +02:00
Claude bff194647a feat(libSceFont): open the other script files of a system font set
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-19 18:31:56 +00:00
Claude 5c6f6da7dc feat(libkernel): accept pipe read ends in sceKernelAddReadEvent
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-19 18:30:55 +00:00