Commit Graph
12196 Commits
Author SHA1 Message Date
Gjon Gojcevic 9457d72cfb fix(agc): check every slice pitch of a resident color array and keep the volume layer guard
The resident image of a 2D array color view only compared the view's own
slice offset with the image's layer pitch, which is trivially equal for
slice 0. Every slice of the array image is now checked against the slice
size DecodeColorBuffer offsets the view by. AttachmentView again requires
layer 0 for a 3D target, as it did before layered 2D array views.

AI-assisted: yes
2026-10-19 15:52:35 +02:00
Gjon Gojcevic a15694eb94 feat(agc): render layered draws into a one-slice surface as an array of its view's slices
A layered draw into a color view of slices 0 to 5 of a 2D surface whose
CB_COLOR_ATTRIB3 declares one slice was refused. The CB clamps the
render target array index to the view's SLICE_MAX, not to the surface's
slice count, so each layer is written one slice pitch further on.
PPSA01317 renders a 512x512 cube map this way. Such a view now renders as
a 2D array of the view's last slice + 1 slices.

AI-assisted: yes
2026-10-19 15:52:35 +02:00
Gjon Gojcevic 8c84dfcd35 feat(agc): render layered draws into 2D array color views
A draw whose vertex shader exports the render target array index into a
color view of several slices of a 2D array target was refused. The view
now renders layers lastSlice - slice + 1 through a 2D array attachment
view of the array's resident image starting at its first slice, and the
draw marks every rendered slice dirty. A view of several slices of a
surface that is not a 2D array is still refused, as is a layered draw
without the array's resident image.

AI-assisted: yes
2026-10-19 15:52:35 +02:00
Dean 95d901b937 Merge pull request #7767 from fogydes/fix/relinker-got-access-index-address-size-and-bounds
fix(relinker): resolve EIP-relative GOT accesses and guard target overflow
2026-10-20 02:52:06 +13:00
Dean 0e476a72f2 Merge pull request #7764 from fogydes/fix/relinker-plt-compactor-bounds-and-underflow
fix(relinker): guard PLT compactor against displacement underflow and offset overflow
2026-10-20 02:51:52 +13:00
Adrià 85029a00f5 Merge pull request #6762 from simonbronk/fix/stencil-op-value-export
fix(agc): replace with a stencil operation value the pixel shader exports
2026-10-19 15:45:10 +02:00
Adrià a5c5d1194a Merge pull request #6919 from yabanana/fix/indirect-offset-analysis
fix(recompiler): recognize plain no-carry draw offset adds
2026-10-19 15:39:55 +02:00
Adrià 3efab5ed86 Merge pull request #6914 from moong15/pr/queued-index-read-order
fix(agc): order deferred write-backs after queued draws' index reads
2026-10-19 15:39:49 +02:00
Adrià f4366753aa Merge pull request #6908 from Zinebyte/fix/posix-sleep-cancellation
fix(libkernel): wake POSIX sleep for thread cancellation
2026-10-19 15:39:43 +02:00
mazen 16683be010 fix(agc): hold a pending producer batch with a timeline semaphore
A host event cannot stay unsignaled across vkQueueSubmit, and vkSetEvent is illegal while that wait is still pending. The fixture now waits on a timeline semaphore and signals it only after the leased producer is submitted, so the earlier label stays pending and the indirect dispatch still takes the CPU fallback.
2026-10-19 17:39:02 +04:00
Nithishvelan M 6c2ff1df85 feat(libSceNpAuth): export sceNpAuthGetAuthorizationCode and sceNpAuthGetIdToken
Export sceNpAuthGetAuthorizationCode (NID KxGkOrQJTqY) and
sceNpAuthGetIdToken (NID uaB-LoJqHis) in libSceNpAuth, delegating to the
corresponding V3 implementations.

Add test coverage in GuestNpAuth for both calls covering invalid
arguments, signed-out responses on sync requests, deferred async handling,
and unknown request IDs, as well as sceNpAuthGetAuthorizedAppCode. Update
technical debt documentation.
2026-10-19 19:06:14 +05:30
Giuseppe Magliano ff688b2146 fix(libkernel): check open flags before the path in open, _open and openat
FreeBSD 11.4 rejects access mode 3 in kern_openat and
O_CREAT|O_EXCL|O_DIRECTORY in vn_open_cred before namei reads the path
or resolves the directory descriptor. open, _open and openat checked a
NULL or empty path first and returned EFAULT or ENOENT for those flags.
InvalidOpenFlags moves to FileFlags.hpp and runs first in all three.
2026-10-19 15:34:43 +02:00
mopgobopotandClaude Opus 5.5 d2c3ec6f46 fix(relinker): keep non-GOT imports in unused-filter=1
unused-filter=1 kept a non-PLT import only when reachable code addresses its relocation exactly through a RIP-relative operand. That test only fits GLOB_DAT slots. An R_X86_64_64 import in a table read at an offset, such as a vtable entry called through lea rax,[rip+table]; call [rax+8], was dropped although it is used, and of a general dynamic TLS pair only DTPMOD64 was kept, so DTPOFF64 lost its relocation. The GOT access check now applies to GLOB_DAT relocations only; other import relocations are kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 16:30:14 +03:00
Adrià Franch f185afe130 test(videoout): match check_skips device-limitation text in telemetry skips 2026-10-19 15:28:45 +02:00
Eli Yarson b8607f4ced feat(videoout): write pad and present telemetry to APS5_VIDEOOUT_TELEMETRY_DIR
APS5_VIDEOOUT_TELEMETRY_DIR=<directory> appends one JSON object per line to <directory>/videoout.jsonl: a contract line for the run (commit and pid), a pad line whenever the published pad state changes in its buttons, sticks, L2 or R2, a present line after the first present and every 30 after that with the count and rate the window title shows, and a drops line with the number of lines the writer discarded, reported every ten seconds while it grows and once at a normal exit. A bounded queue of 4096 lines and one writer thread batch the file, so neither the present nor the input path waits for it; a pad change that the full queue refused stays pending for a later publish, and the frame count moves from UpdateTitle's function-static to DisplayWindow so the input path can name the present it belongs to.

Without the variable no file is opened and no thread is started: a present or an input update costs one call that checks a guard variable and returns null.
2026-10-19 15:27:49 +02:00
Dean 5eba12d6bd Merge pull request #7775 from whamre/fix/windows-tls-zero-fill
fix(relinker): keep the PT_TLS zero fill out of memory when converting to Windows
2026-10-20 02:23:39 +13:00
Dean 9145cf3a93 Merge pull request #7773 from fogydes/fix/relinker-syscall-scanner-bounds
fix(relinker): validate syscall scanner code section bounds and offset overflow
2026-10-20 02:23:25 +13:00
Dean 98024d4bce Merge pull request #7772 from fogydes/fix/relinker-section-header-table-overlap-and-bounds
fix(relinker): validate section header table bounds and reject overlapping sections
2026-10-20 02:23:11 +13:00
Dean 111f9eb6f2 Merge pull request #7771 from fogydes/fix/relinker-program-header-layout-extra-block-overlap
fix(relinker): reject program header table overlapping the extra block
2026-10-20 02:22:57 +13:00
Dean 1fad170b8b Merge pull request #7770 from fogydes/fix/relinker-windows-icon-resource-rva-and-overlap-guards
fix(relinker): validate resource section RVA and prevent section overlaps
2026-10-20 02:22:43 +13:00
Dean ad5e9f51ba Merge pull request #7768 from fogydes/fix/relinker-relative-relocation-index-bounds
fix(relinker): validate relative relocation table bounds, dynamic tag variants, and slot targets
2026-10-20 02:22:29 +13:00
Dean 7143c2acc8 Merge pull request #7763 from fogydes/fix/relinker-base-relocation-page-bounds-and-deduplication
fix(relinker): guard base relocations against page boundary overflow and deduplicate entries
2026-10-20 02:22:15 +13:00
Dean acbeb8475c Merge pull request #7823 from Chikimaro/feat/libscenet-usleep-inetptonex
feat(libSceNet): implement sceNetUsleep and sceNetInetPtonEx
2026-10-20 02:22:01 +13:00
Alex ColliniandClaude Sonnet 5.5 a71ba9edb9 fix(agc): revalidate an image table from its narrowed first-layer words
Revalidate rebuilt the cached texture of an image table element from the raw
T# words, while resolveImageTables binds the first-layer texture for a 2D
read of a 2D array. The whole array was rebuilt and compared against the
narrowed texture, so revalidation always failed. Narrow the words with
firstLayerWords before decoding, as the other paths do.

Add imageTableFirstLayerRevalidateTests, run by agc_draw_descriptors: it
fails with "an image table holding a 2D read of a 2D array did not
revalidate" without the fix.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-19 15:20:58 +02:00
Alex ColliniandClaude Opus 5.5 7ef917d474 fix(agc): build a 2D read of a 2D array from its base slice alone
A shader that declares a 2D image reads only the base slice of a 2D array
T# (the first-layer view), but the texture was built from every slice the
T# names. In Ghost of Yotei (PPSA26344) such a read names 1537 slices of a
3328x1872 R_X surface: a 12.4 GiB image that does not fit the 4090's
device-local budget and stalls 11-14 s on each rebuild.

The sampled lookups (stage A records, stage B bindings, revalidation and
image tables) now narrow such a T# to its base slice before the cache key,
the decode and the image are made, so a whole-array read of the same T#
keeps its own entry. Views of 1 GiB or more that stay whole are logged with
the guest allocation they lie in and how many of their slices fit it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 15:20:53 +02:00
Alex ColliniandClaude Opus 5.5 6058d607b2 fix(agc): build a sampled array view from its viewed slices
A sampled 2D array, 1D array or cube view created and snapshotted the whole
array from slice 0 to its last viewed slice. Ghost of Yotei views six faces
at slice 7227 of a 256x256 cube array (3.8 GB built for 3 MB) and one slice
at 1536 of a 3328x1872 R8 array (12.4 GiB built for 8 MiB).

SampledArrayWindow describes the viewed slices as an array of their own at
the first viewed slice when the layout of those slices does not depend on
their index: a thin array without DCC metadata, and for an XOR swizzle a
first slice that keeps the slice bits the equation mixes in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 15:20:43 +02:00
Adrià e01d909086 Merge pull request #6915 from Nixitov/feat/physhm
feat(libkernel): declare physhm_open and physhm_unlink
2026-10-19 15:18:41 +02:00
Savvanis SpyrosandClaude Opus 5.5 c5dbdf1fde fix(agc): name the RELEASE_MEM system counter instead of GDS data
A RELEASE_MEM with DATA_SEL 4 was refused as "GDS RELEASE_MEM data".
amdgpu's GFX10 packet header gives 4 as the 64-bit system counter and 5
as GDS data. Validation now refuses 4 as the system counter, whose
console frequency and epoch are not known, 5 as GDS data and 6 or 7 as
reserved, and the debt file records the system counter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 16:18:13 +03:00
Adrià 9494481b54 Merge pull request #6912 from Zinebyte/fix/pe-forwarder-strings
fix(nid): preserve PE forwarders when repacking export names
2026-10-19 15:14:39 +02:00
Adrià 15047c6a8e Merge pull request #6897 from tv7/fix/fstat-closed-descriptor
fix(libkernel): return EBADF from fstat on a descriptor that is not open on Windows
2026-10-19 15:14:34 +02:00
Josip Parlov acd1e0ef8f feat(libScePad): implement scePadGetAccessibilityControllerState (zBsgF0q8DIM)
The name hashes to zBsgF0q8DIM. Signature and error order follow the
OS 10.01 system module: NOT_INITIALIZED, INVALID_ARG for a NULL output,
INVALID_HANDLE for a bad handle. The emulated pad is not an Access
controller and reports 0.
2026-10-19 15:06:28 +02:00
Josip Parlov d68d797c76 fix(libScePad): return 0 from n3kSX62fgNo after scePadInit, with a pad open or not
The OS 10.01 system module checks only that the library is initialised,
then sends a per-process value to ShellCore over Mbus and returns 0 when
that call succeeds. It does not look at pad handles, so the throw while a
pad is open is gone. 0x809200ff, measured in a process that is not a game,
is the failed Mbus call; a game process is assumed to get 0.
2026-10-19 15:06:08 +02:00
Adrià Franch 8dd6217ded test(libkernel): take the EV_CLEAR wait clock before starting the sender 2026-10-19 15:05:52 +02:00
Alexej Szpevák d2cae8847d test(libkernel): cover EV_CLEAR on a pipe and with EV_DISPATCH
An EV_CLEAR read knote on a pipe fires once per write and reports EV_EOF with no data once the write end closes. Combined with EV_DISPATCH it reports once and disables itself; EV_ENABLE re-runs the filter as kqueue_register does, so data that arrived while disabled is reported, and an enable with nothing buffered reports nothing.
2026-10-19 15:05:28 +02:00
Alexej Szpevák 34447f7956 test(libkernel): cover EV_CLEAR writes on a socket
An EV_CLEAR write knote fires once when added to a writable socket, stays quiet after the guest's own send, fires again when the peer drains the data and frees the send space, fires on a fresh EV_ADD, and reports EV_EOF when the peer closes.
2026-10-19 15:05:28 +02:00
Alexej Szpevák 07fd38ae7c test(libkernel): cover EV_CLEAR reads on a socket
On a Unix stream socketpair an EV_CLEAR read knote fires once per arrival with the full byte count, stays quiet while data sits unread, without the wait spinning on the readable socket, fires again when re-added, is dropped when an arrival was read before the next scan, wakes a blocking kevent, and reports EV_EOF once when the peer closes.
2026-10-19 15:05:28 +02:00
Alexej Szpevák cb9a4c7417 feat(libkernel): support EV_CLEAR on sockets and pipes in kevent on Linux
kevent threw for EV_CLEAR on a socket or the read end of a pipe; Boost.Asio's kqueue reactor, among others, registers every socket that way. On Linux such a knote now watches its host descriptor through an edge watch. It is armed when added, on every later EV_ADD or EV_ENABLE while enabled, and by each host wakeup; when armed it is checked with the level-triggered readiness test and reported with the current data and EV_EOF, or disarmed if no longer ready, as kqueue_scan re-runs the filter; reporting it disarms it until the next edge. Waits block on the watch's epoll descriptor, so a socket that stays readable does not wake them. Windows and macOS still throw. GuestSockets::NativeDescriptor exposes the host socket behind a guest one for the watch.
2026-10-19 15:05:28 +02:00
MarcZX100 c5f8a3ff22 test(agc): isolate allocation budget query counts 2026-10-19 15:05:18 +02:00
MarcZX100 415dcab140 test(agc): account for allocation budget queries 2026-10-19 15:05:18 +02:00
MarcZX100 e6a78f41bf chore(agc): report heap budgets on buffer allocation failure 2026-10-19 15:05:18 +02:00
Tomás Ortellado 1c993d1889 test(agc): bound shader helper test runtime 2026-10-19 10:05:12 -03:00
Alexej Szpevák 7e67261d5f feat(libkernel): add an epoll edge watch over a host descriptor
FreeBSD activates an EV_CLEAR knote on each state change the object reports through KNOTE (sorwakeup, sowwakeup, pipeselwakeup), not on its level, so polling the level cannot tell an EV_CLEAR knote when to fire again. EdgeWatch::Watch registers the host descriptor with a private epoll instance in edge-triggered mode: every wakeup of the descriptor with a matching mask (data arriving, buffer space freed, a hang-up) queues one edge, which TakeEdge consumes, and the epoll descriptor itself is readable while an edge is pending, so a wait can block on it. Off Linux opening a watch throws.
2026-10-19 15:05:11 +02:00
Alexej Szpevák 5cbc46029b refactor(libkernel): let an equeue filter name the descriptor its waits block on
WaitForDescriptors always handed the knote's own descriptor to the host wait. A filter that tracks readiness through a descriptor of its own, such as an edge watch, needs the wait to block on that descriptor instead, or a descriptor that stays ready keeps waking the wait. KernelFilter gets a waitDescriptor, and the filter's owner is held for the length of the wait so the descriptor cannot be closed under it.
2026-10-19 15:05:10 +02:00
Adrià 3bb15be094 Merge pull request #6799 from milescoviello/fix/cube-face-image-store
fix(shader): store through DIM 2D image_store to a cube T#'s BASE_ARRAY face
2026-10-19 15:04:02 +02:00
Adrià a1dfc73380 Merge pull request #6748 from milescoviello/perf/read-only-descriptor-tables
perf(shader): declare the read-only descriptor tables NonWritable
2026-10-19 15:02:57 +02:00
Rajkamalcode cea6fabfae fix(libc): return -inf from y0f, y1f and ynf at zero
The guest's second-kind Bessel functions return -inf and raise the divide-by-zero exception for x = +-0 (see e_jn.c), but the UCRT returns NaN for y1 and yn. Route x == +-0 through a shared helper, cover ynf(2, 0) in the guest math test, and note the special case in the libc technical debt.
2026-10-19 18:31:00 +05:30
Aryan SharmaandClaude Haiku 5.5 3ef8925a99 feat(libSceRudp): implement sceRudpEnableInternalIOThread2
The managed SceRudp.Rudp.EnableInternalIOThread in PPSA06888's Unity
metadata takes (uint stackSize, uint priority, ulong affinity), which
gives the signature. Like sceRudpEnableInternalIOThread it reports
RUDP_ERROR_NOT_INITIALIZED before sceRudpInit and success after it,
without starting a thread.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
2026-10-19 15:00:54 +02:00
Aryan SharmaandClaude Haiku 5.5 7b626baa23 feat(libSceRudp): implement sceRudpNetReceived and declare sceRudpGetOption
sceRudpNetReceived follows sceRudpNetFlush: it reports
RUDP_ERROR_NOT_INITIALIZED before sceRudpInit and success after it, since
no packets are ever received. sceRudpGetOption now has the signature its
PPSA06888 call sites use, (ctx_id, option, value, len), and still throws
because the option codes, defaults and errors are unknown.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
2026-10-19 15:00:54 +02:00
Adrià c562814ca0 Merge pull request #6906 from Zinebyte/fix/nid-write-errors
fix(nid): report failed library writes
2026-10-19 15:00:31 +02:00
Adrià 27cbe9c154 Merge pull request #6904 from Zinebyte/fix/elf-sysv-nid-hash
fix(nid): rebuild SysV hashes after renaming ELF symbols
2026-10-19 15:00:25 +02:00